summaryrefslogtreecommitdiff
path: root/src/plugins/autotoolsprojectmanager
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-04-16 10:03:48 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-04-16 10:03:48 +0200
commit6b8167c663f3e2b2b5b421f59045602e2e9bc633 (patch)
tree8c8f4fffebb790867cd75121f888af49f986b33e /src/plugins/autotoolsprojectmanager
parentbf4d9aed33f0b49cf8f6d4d5edd1915d70f326c3 (diff)
parent53553165ba6a9d8dfbac6dab2e246d6a60221a7e (diff)
downloadqt-creator-6b8167c663f3e2b2b5b421f59045602e2e9bc633.tar.gz
Merge remote-tracking branch 'origin/2.5'
Diffstat (limited to 'src/plugins/autotoolsprojectmanager')
-rw-r--r--src/plugins/autotoolsprojectmanager/makefileparser.cpp15
-rw-r--r--src/plugins/autotoolsprojectmanager/makefileparser.h2
2 files changed, 12 insertions, 5 deletions
diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.cpp b/src/plugins/autotoolsprojectmanager/makefileparser.cpp
index c87ca62b46..972f6bce0a 100644
--- a/src/plugins/autotoolsprojectmanager/makefileparser.cpp
+++ b/src/plugins/autotoolsprojectmanager/makefileparser.cpp
@@ -57,6 +57,11 @@ MakefileParser::MakefileParser(const QString &makefile) :
{
}
+MakefileParser::~MakefileParser()
+{
+ delete m_textStream.device();
+}
+
bool MakefileParser::parse()
{
m_mutex.lock();
@@ -261,11 +266,11 @@ void MakefileParser::parseSubDirs()
+ slash + makefileName;
// Parse sub directory
- QFile *file = new QFile(subDirMakefile);
+ QFile file(subDirMakefile);
// Don't try to parse a file, that might not exist (e. g.
// if SUBDIRS specifies a 'po' directory).
- if (!file->exists())
+ if (!file.exists())
continue;
MakefileParser parser(subDirMakefile);
@@ -422,15 +427,15 @@ void MakefileParser::parseIncludePaths()
QFileInfo info(m_makefile);
const QString dirName = info.absolutePath();
- QFile *file = new QFile(dirName + QLatin1String("/Makefile"));
- if (!file->open(QIODevice::ReadOnly | QIODevice::Text))
+ QFile file(dirName + QLatin1String("/Makefile"));
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return;
// TODO: The parsing is done very poor. Comments are ignored and targets
// are ignored too. Whether it is worth to improve this, depends on whether
// we want to parse the generated Makefile at all or whether we want to
// improve the Makefile.am parsing to be aware of variables.
- QTextStream textStream(file);
+ QTextStream textStream(&file);
QString line;
do {
line = textStream.readLine();
diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.h b/src/plugins/autotoolsprojectmanager/makefileparser.h
index d943453fec..8038f8c39f 100644
--- a/src/plugins/autotoolsprojectmanager/makefileparser.h
+++ b/src/plugins/autotoolsprojectmanager/makefileparser.h
@@ -65,6 +65,8 @@ public:
*/
MakefileParser(const QString &makefile);
+ ~MakefileParser();
+
/**
* Parses the makefile. Must be invoked at least once, otherwise
* the getter methods of MakefileParser will return empty values.