Skip to content

Commit 5aadf24

Browse files
committed
GUI: Remove code for automatic deallocated classes.
Project file code still read the list of automatically deallocated classes from project file. That feature hasn't been supported in few last releases.
1 parent 9296c71 commit 5aadf24

4 files changed

Lines changed: 2 additions & 84 deletions

File tree

gui/gui.cppcheck

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
<!-- cppcheck project file -->
44

55
<project version="1">
6-
<autodealloc>
7-
<class name="AboutDialog"/>
8-
<class name="FileViewDialog"/>
9-
<class name="ThreadHandler"/>
10-
</autodealloc>
116
<includedir>
127
<dir name="../lib" />
138
</includedir>

gui/mainwindow.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,6 @@ Settings MainWindow::GetCppcheckSettings()
304304

305305
if (projectRead)
306306
{
307-
QStringList classes = pfile.GetDeAllocatedClasses();
308-
QString classname;
309-
foreach(classname, classes)
310-
{
311-
// the auto-dealloc is deprecated
312-
//result.addAutoAllocClass(classname.toStdString());
313-
}
314-
315307
QStringList dirs = pfile.GetIncludeDirs();
316308
QString dir;
317309
foreach(dir, dirs)

gui/projectfile.cpp

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
#include "projectfile.h"
2424

2525
static const char ProjectElementName[] = "project";
26-
static const char AllocElementName[] = "autodealloc";
27-
static const char ClassElementName[] = "class";
28-
static const char ClassNameAttrib[] = "name";
2926
static const char IncludDirElementName[] = "includedir";
3027
static const char DirElementName[] = "dir";
3128
static const char DirNameAttrib[] = "name";
@@ -63,13 +60,11 @@ bool ProjectFile::Read(const QString &filename)
6360
if (xmlReader.name() == ProjectElementName)
6461
insideProject = true;
6562

66-
// Find allocelement from inside project element
67-
if (insideProject && xmlReader.name() == AllocElementName)
68-
ReadAutoAllocClasses(xmlReader);
69-
63+
// Find include directory from inside project element
7064
if (insideProject && xmlReader.name() == IncludDirElementName)
7165
ReadIncludeDirs(xmlReader);
7266

67+
// Find preprocessor define from inside project element
7368
if (insideProject && xmlReader.name() == DefinesElementName)
7469
ReadDefines(xmlReader);
7570

@@ -98,11 +93,6 @@ bool ProjectFile::Read(const QString &filename)
9893
return true;
9994
}
10095

101-
QStringList ProjectFile::GetDeAllocatedClasses() const
102-
{
103-
return mDeAllocatedClasses;
104-
}
105-
10696
QStringList ProjectFile::GetIncludeDirs() const
10797
{
10898
return mIncludeDirs;
@@ -113,48 +103,6 @@ QStringList ProjectFile::GetDefines() const
113103
return mDefines;
114104
}
115105

116-
void ProjectFile::ReadAutoAllocClasses(QXmlStreamReader &reader)
117-
{
118-
QXmlStreamReader::TokenType type;
119-
bool allRead = false;
120-
do
121-
{
122-
type = reader.readNext();
123-
switch (type)
124-
{
125-
case QXmlStreamReader::StartElement:
126-
127-
// Read class-elements
128-
if (reader.name().toString() == ClassElementName)
129-
{
130-
QXmlStreamAttributes attribs = reader.attributes();
131-
QString name = attribs.value("", ClassNameAttrib).toString();
132-
if (!name.isEmpty())
133-
mDeAllocatedClasses << name;
134-
}
135-
break;
136-
137-
case QXmlStreamReader::EndElement:
138-
if (reader.name().toString() == AllocElementName)
139-
allRead = true;
140-
break;
141-
142-
// Not handled
143-
case QXmlStreamReader::NoToken:
144-
case QXmlStreamReader::Invalid:
145-
case QXmlStreamReader::StartDocument:
146-
case QXmlStreamReader::EndDocument:
147-
case QXmlStreamReader::Characters:
148-
case QXmlStreamReader::Comment:
149-
case QXmlStreamReader::DTD:
150-
case QXmlStreamReader::EntityReference:
151-
case QXmlStreamReader::ProcessingInstruction:
152-
break;
153-
}
154-
}
155-
while (!allRead);
156-
}
157-
158106
void ProjectFile::ReadIncludeDirs(QXmlStreamReader &reader)
159107
{
160108
QXmlStreamReader::TokenType type;

gui/projectfile.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ class ProjectFile : public QObject
4747
*/
4848
bool Read(const QString &filename = QString());
4949

50-
/**
51-
* @brief Get list of automatically deallocated classes.
52-
* @return list of classes.
53-
*/
54-
QStringList GetDeAllocatedClasses() const;
55-
5650
/**
5751
* @brief Get list of include directories.
5852
* @return list of directories.
@@ -66,12 +60,6 @@ class ProjectFile : public QObject
6660
QStringList GetDefines() const;
6761

6862
protected:
69-
/**
70-
* @brief Read list of automatically deallocated classes from XML.
71-
* @param reader XML stream reader.
72-
*/
73-
void ReadAutoAllocClasses(QXmlStreamReader &reader);
74-
7563
/**
7664
* @brief Read list of include directories from XML.
7765
* @param reader XML stream reader.
@@ -91,11 +79,6 @@ class ProjectFile : public QObject
9179
*/
9280
QString mFilename;
9381

94-
/**
95-
* @brief List of automatically deallocated classes.
96-
*/
97-
QStringList mDeAllocatedClasses;
98-
9982
/**
10083
* @brief List of include directories used to search include files.
10184
*/

0 commit comments

Comments
 (0)