From d6f6da10fa13a254413ac6a26a3bd08d9005bb2e Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Sun, 27 Feb 2011 18:32:53 +0200 Subject: [PATCH 01/10] GUI: Add ignored paths support to project file. This patch adds support for ignored paths in the project file. There is new element which can contain one or more elements with name attribute containing the path to ignore. --- gui/projectfile.cpp | 58 +++++++++++++++++++++++++++++++++++++++++++++ gui/projectfile.h | 23 ++++++++++++++++++ 2 files changed, 81 insertions(+) diff --git a/gui/projectfile.cpp b/gui/projectfile.cpp index abd82ebcd..611848c79 100644 --- a/gui/projectfile.cpp +++ b/gui/projectfile.cpp @@ -37,6 +37,9 @@ static const char PathName[] = "dir"; static const char PathNameAttrib[] = "name"; static const char RootPathName[] = "root"; static const char RootPathNameAttrib[] = "name"; +static const char IgnoreElementName[] = "defines"; +static const char IgnorePathName[] = "path"; +static const char IgnorePathNameAttrib[] = "name"; ProjectFile::ProjectFile(QObject *parent) : QObject(parent) @@ -87,6 +90,10 @@ bool ProjectFile::Read(const QString &filename) if (insideProject && xmlReader.name() == DefinesElementName) ReadDefines(xmlReader); + // Find ignore list from inside project element + if (insideProject && xmlReader.name() == IgnoreElementName) + ReadIgnores(xmlReader); + break; case QXmlStreamReader::EndElement: @@ -130,6 +137,11 @@ QStringList ProjectFile::GetCheckPaths() const return mPaths; } +QStringList ProjectFile::GetIgnoredPaths() const +{ + return mIgnoredPaths; +} + void ProjectFile::ReadRootPath(QXmlStreamReader &reader) { QXmlStreamAttributes attribs = reader.attributes(); @@ -263,6 +275,47 @@ void ProjectFile::ReadCheckPaths(QXmlStreamReader &reader) while (!allRead); } +void ProjectFile::ReadIgnores(QXmlStreamReader &reader) +{ + QXmlStreamReader::TokenType type; + bool allRead = false; + do + { + type = reader.readNext(); + switch (type) + { + case QXmlStreamReader::StartElement: + // Read define-elements + if (reader.name().toString() == IgnorePathName) + { + QXmlStreamAttributes attribs = reader.attributes(); + QString name = attribs.value("", IgnorePathNameAttrib).toString(); + if (!name.isEmpty()) + mIgnoredPaths << name; + } + break; + + case QXmlStreamReader::EndElement: + if (reader.name().toString() == IgnoreElementName) + allRead = true; + break; + + // Not handled + case QXmlStreamReader::NoToken: + case QXmlStreamReader::Invalid: + case QXmlStreamReader::StartDocument: + case QXmlStreamReader::EndDocument: + case QXmlStreamReader::Characters: + case QXmlStreamReader::Comment: + case QXmlStreamReader::DTD: + case QXmlStreamReader::EntityReference: + case QXmlStreamReader::ProcessingInstruction: + break; + } + } + while (!allRead); +} + void ProjectFile::SetIncludes(QStringList includes) { mIncludeDirs = includes; @@ -278,6 +331,11 @@ void ProjectFile::SetCheckPaths(QStringList paths) mPaths = paths; } +void ProjectFile::SetIgnoredPaths(QStringList paths) +{ + mIgnoredPaths = paths; +} + bool ProjectFile::Write(const QString &filename) { if (!filename.isEmpty()) diff --git a/gui/projectfile.h b/gui/projectfile.h index 23496c90c..8fe2efb93 100644 --- a/gui/projectfile.h +++ b/gui/projectfile.h @@ -74,6 +74,12 @@ public: */ QStringList GetCheckPaths() const; + /** + * @brief Get list of paths to ignore. + * @return list of paths. + */ + QStringList GetIgnoredPaths() const; + /** * @brief Set project root path. * @param rootpath new project root path. @@ -101,6 +107,12 @@ public: */ void SetCheckPaths(QStringList paths); + /** + * @brief Set list of paths to ignore. + * @param defines List of paths. + */ + void SetIgnoredPaths(QStringList paths); + /** * @brief Write project file (to disk). * @param filename Filename to use. @@ -142,6 +154,12 @@ protected: */ void ReadCheckPaths(QXmlStreamReader &reader); + /** + * @brief Read lists of ignores. + * @param reader XML stream reader. + */ + void ReadIgnores(QXmlStreamReader &reader); + private: /** @@ -171,6 +189,11 @@ private: * @brief List of paths to check. */ QStringList mPaths; + + /** + * @brief Paths ignored from the check. + */ + QStringList mIgnoredPaths; }; /// @} #endif // PROJECT_FILE_H From e81fa466992f09056390d124f7339f440a6a3922 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Sun, 27 Feb 2011 18:36:09 +0200 Subject: [PATCH 02/10] GUI: Convert some projectfile method arguments const. --- gui/projectfile.cpp | 8 ++++---- gui/projectfile.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gui/projectfile.cpp b/gui/projectfile.cpp index 611848c79..9ff0d79a3 100644 --- a/gui/projectfile.cpp +++ b/gui/projectfile.cpp @@ -316,22 +316,22 @@ void ProjectFile::ReadIgnores(QXmlStreamReader &reader) while (!allRead); } -void ProjectFile::SetIncludes(QStringList includes) +void ProjectFile::SetIncludes(const QStringList &includes) { mIncludeDirs = includes; } -void ProjectFile::SetDefines(QStringList defines) +void ProjectFile::SetDefines(const QStringList &defines) { mDefines = defines; } -void ProjectFile::SetCheckPaths(QStringList paths) +void ProjectFile::SetCheckPaths(const QStringList &paths) { mPaths = paths; } -void ProjectFile::SetIgnoredPaths(QStringList paths) +void ProjectFile::SetIgnoredPaths(const QStringList &paths) { mIgnoredPaths = paths; } diff --git a/gui/projectfile.h b/gui/projectfile.h index 8fe2efb93..2986f11a7 100644 --- a/gui/projectfile.h +++ b/gui/projectfile.h @@ -93,25 +93,25 @@ public: * @brief Set list of includes. * @param includes List of defines. */ - void SetIncludes(QStringList includes); + void SetIncludes(const QStringList &includes); /** * @brief Set list of defines. * @param defines List of defines. */ - void SetDefines(QStringList defines); + void SetDefines(const QStringList &defines); /** * @brief Set list of paths to check. * @param defines List of paths. */ - void SetCheckPaths(QStringList paths); + void SetCheckPaths(const QStringList &paths); /** * @brief Set list of paths to ignore. * @param defines List of paths. */ - void SetIgnoredPaths(QStringList paths); + void SetIgnoredPaths(const QStringList &paths); /** * @brief Write project file (to disk). From 9de4ce8c8e612114d7cbab4e8853d6aecfe940b8 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Sun, 27 Feb 2011 19:09:20 +0200 Subject: [PATCH 03/10] GUI: If project open failed project got invalid. The project was deleted but not set as NULL when the project open failed. Fix this by deleting the project only when the opening succeeds. --- gui/mainwindow.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index c7b966b6e..2239568a8 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -724,8 +724,6 @@ void MainWindow::OpenHtmlHelpContents() void MainWindow::OpenProjectFile() { - delete mProject; - const QString filter = tr("Project files (*.cppcheck);;All files(*.*)"); QString filepath = QFileDialog::getOpenFileName(this, tr("Select Project File"), @@ -740,6 +738,7 @@ void MainWindow::OpenProjectFile() mUI.mActionCloseProjectFile->setEnabled(true); mUI.mActionEditProjectFile->setEnabled(true); + delete mProject; mProject = new Project(filepath, this); mProject->Open(); QString rootpath = mProject->GetProjectFile()->GetRootPath(); From 46f7a81b7b3b04dcc62b0e76387c66d6cb8732ab Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 28 Feb 2011 00:13:28 +0200 Subject: [PATCH 04/10] GUI: Take filtering into use in GUI. Add applying of filtering into list of files to check if we have an active project file. Filtering is quite much similar to the filtering in CLI. If we have directory filter ("gui/") then we check all paths if they contain "gui" part. In practice we search for string "/gui" from the paths. If we have filename filtering ("gui/projectfile.cpp") then we check if any of the paths end with that. --- gui/filelist.cpp | 52 ++++++++++++++++++++++++++++++++++++++++----- gui/filelist.h | 27 +++++++++++++++++++++++ gui/mainwindow.cpp | 2 ++ gui/projectfile.cpp | 2 +- 4 files changed, 77 insertions(+), 6 deletions(-) diff --git a/gui/filelist.cpp b/gui/filelist.cpp index cc1580904..4e26eb1f3 100644 --- a/gui/filelist.cpp +++ b/gui/filelist.cpp @@ -96,12 +96,54 @@ void FileList::AddPathList(const QStringList &paths) QStringList FileList::GetFileList() const { - QStringList names; - QFileInfo item; - foreach(item, mFileList) + if (mIgnoredPaths.empty()) + { + QStringList names; + foreach(QFileInfo item, mFileList) + { + QString name = QDir::fromNativeSeparators(item.canonicalFilePath()); + names << name; + } + return names; + } + else + { + return ApplyIgnoreList(); + } +} + +void FileList::AddIngoreList(const QStringList &paths) +{ + mIgnoredPaths = paths; +} + +QStringList FileList::ApplyIgnoreList() const +{ + QStringList paths; + foreach(QFileInfo item, mFileList) { QString name = QDir::fromNativeSeparators(item.canonicalFilePath()); - names << name; + if (!Match(name)) + paths << name; } - return names; + return paths; +} + +bool FileList::Match(const QString &path) const +{ + for (int i = 0; i < mIgnoredPaths.size(); i++) + { + if (mIgnoredPaths[i].endsWith('/')) + { + const QString pathignore("/" + mIgnoredPaths[i]); + if (path.indexOf(pathignore) != -1) + return true; + } + else + { + if (path.endsWith(mIgnoredPaths[i])) + return true; + } + } + return false; } diff --git a/gui/filelist.h b/gui/filelist.h index 1a1818408..a896e6070 100644 --- a/gui/filelist.h +++ b/gui/filelist.h @@ -30,6 +30,10 @@ * can be also added recursively when all files in subdirectories are added too. * The filenames are matched against the filter and only those files whose * filename extension is included in the filter list are added. + * + * This class also handles filtering of paths against ignore filters given. If + * there is ignore filters then only paths not matching those filters are + * returned. */ class FileList { @@ -60,6 +64,12 @@ public: */ QStringList GetFileList() const; + /** + * @brief Add list of paths to ignore list. + * @param paths Paths to ignore. + */ + void AddIngoreList(const QStringList &paths); + protected: /** @@ -74,8 +84,25 @@ protected: */ bool FilterMatches(const QFileInfo &inf); + /** + * @brief Get filtered list of paths. + * This method takes the list of paths and applies the ignore lists to + * it. And then returns the list of paths that did not match the + * ignore filters. + * @return Filtered list of paths. + */ + QStringList ApplyIgnoreList() const; + + /** + * @brief Test if path matches any of the ignore filters. + * @param path Path to test against filters. + * @return true if any of the filters matches, false otherwise. + */ + bool Match(const QString &path) const; + private: QFileInfoList mFileList; + QStringList mIgnoredPaths; }; #endif // FILELIST_H diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 2239568a8..1901b0a08 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -191,6 +191,8 @@ void MainWindow::DoCheckFiles(const QStringList &files) FileList pathList; pathList.AddPathList(files); + if (mProject) + pathList.AddIngoreList(mProject->GetProjectFile()->GetIgnoredPaths()); QStringList fileNames = pathList.GetFileList(); mUI.mResults->Clear(); diff --git a/gui/projectfile.cpp b/gui/projectfile.cpp index 9ff0d79a3..cba444092 100644 --- a/gui/projectfile.cpp +++ b/gui/projectfile.cpp @@ -37,7 +37,7 @@ static const char PathName[] = "dir"; static const char PathNameAttrib[] = "name"; static const char RootPathName[] = "root"; static const char RootPathNameAttrib[] = "name"; -static const char IgnoreElementName[] = "defines"; +static const char IgnoreElementName[] = "ignore"; static const char IgnorePathName[] = "path"; static const char IgnorePathNameAttrib[] = "name"; From bd405c454a2d2dde4bebf58976c23ea93e3353b2 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 28 Feb 2011 15:58:44 +0200 Subject: [PATCH 05/10] GUI: Add GUI for ignored paths in project files. Add similar GUI than include paths has. Currently there is only possibly select directories directly from the GUI. But filename can be added to the path by editing it. --- gui/project.cpp | 6 ++++ gui/projectfile.ui | 61 ++++++++++++++++++++++++++++++++++++++- gui/projectfiledialog.cpp | 58 +++++++++++++++++++++++++++++++++++++ gui/projectfiledialog.h | 33 +++++++++++++++++++++ 4 files changed, 157 insertions(+), 1 deletion(-) diff --git a/gui/project.cpp b/gui/project.cpp index 963fcfeee..3467da289 100644 --- a/gui/project.cpp +++ b/gui/project.cpp @@ -85,6 +85,9 @@ void Project::Edit() dlg.SetDefines(defines); QStringList paths = mPFile->GetCheckPaths(); dlg.SetPaths(paths); + QStringList ignorepaths = mPFile->GetIgnoredPaths(); + dlg.SetIgnorePaths(ignorepaths); + int rv = dlg.exec(); if (rv == QDialog::Accepted) { @@ -96,6 +99,9 @@ void Project::Edit() mPFile->SetDefines(defines); QStringList paths = dlg.GetPaths(); mPFile->SetCheckPaths(paths); + QStringList ignorepaths = dlg.GetIgnorePaths(); + mPFile->SetIgnoredPaths(ignorepaths); + bool writeSuccess = mPFile->Write(); if (!writeSuccess) { diff --git a/gui/projectfile.ui b/gui/projectfile.ui index 7a978159a..9afb0f83e 100644 --- a/gui/projectfile.ui +++ b/gui/projectfile.ui @@ -17,7 +17,7 @@ - 1 + 2 @@ -196,6 +196,65 @@ + + + Ignore + + + + + + Paths: + + + + + + + + + + + + + + Add... + + + + + + + Edit + + + + + + + Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + diff --git a/gui/projectfiledialog.cpp b/gui/projectfiledialog.cpp index f8a0d1241..11fdf8334 100644 --- a/gui/projectfiledialog.cpp +++ b/gui/projectfiledialog.cpp @@ -43,6 +43,9 @@ ProjectFileDialog::ProjectFileDialog(const QString &path, QWidget *parent) connect(mUI.mBtnRemoveInclude, SIGNAL(clicked()), this, SLOT(RemoveIncludeDir())); connect(mUI.mBtnEditPath, SIGNAL(clicked()), this, SLOT(EditPath())); connect(mUI.mBtnRemovePath, SIGNAL(clicked()), this, SLOT(RemovePath())); + connect(mUI.mBtnAddIgnorePath, SIGNAL(clicked()), this, SLOT(AddIgnorePath())); + connect(mUI.mBtnEditIgnorePath, SIGNAL(clicked()), this, SLOT(EditIgnorePath())); + connect(mUI.mBtnRemoveIgnorePath, SIGNAL(clicked()), this, SLOT(RemoveIgnorePath())); } void ProjectFileDialog::AddIncludeDir(const QString &dir) @@ -65,6 +68,16 @@ void ProjectFileDialog::AddPath(const QString &path) mUI.mListPaths->addItem(item); } +void ProjectFileDialog::AddIgnorePath(const QString &path) +{ + if (path.isNull() || path.isEmpty()) + return; + + QListWidgetItem *item = new QListWidgetItem(path); + item->setFlags(item->flags() | Qt::ItemIsEditable); + mUI.mListIgnoredPaths->addItem(item); +} + QString ProjectFileDialog::GetRootPath() const { QString root = mUI.mEditProjectRoot->text(); @@ -111,6 +124,18 @@ QStringList ProjectFileDialog::GetPaths() const return paths; } +QStringList ProjectFileDialog::GetIgnorePaths() const +{ + const int count = mUI.mListIncludeDirs->count(); + QStringList paths; + for (int i = 0; i < count; i++) + { + QListWidgetItem *item = mUI.mListIncludeDirs->item(i); + paths << item->text(); + } + return paths; +} + void ProjectFileDialog::SetRootPath(const QString &root) { mUI.mEditProjectRoot->setText(root); @@ -147,6 +172,14 @@ void ProjectFileDialog::SetPaths(const QStringList &paths) } } +void ProjectFileDialog::SetIgnorePaths(const QStringList &paths) +{ + foreach(QString path, paths) + { + AddIgnorePath(path); + } +} + void ProjectFileDialog::AddIncludeDir() { QString selectedDir = QFileDialog::getExistingDirectory(this, @@ -196,3 +229,28 @@ void ProjectFileDialog::RemovePath() QListWidgetItem *item = mUI.mListPaths->takeItem(row); delete item; } + +void ProjectFileDialog::AddIgnorePath() +{ + QString selectedDir = QFileDialog::getExistingDirectory(this, + tr("Select directory to ignore"), + QString()); + + if (!selectedDir.isEmpty()) + { + AddIgnorePath(selectedDir); + } +} + +void ProjectFileDialog::EditIgnorePath() +{ + QListWidgetItem *item = mUI.mListIgnoredPaths->currentItem(); + mUI.mListIgnoredPaths->editItem(item); +} + +void ProjectFileDialog::RemoveIgnorePath() +{ + const int row = mUI.mListIgnoredPaths->currentRow(); + QListWidgetItem *item = mUI.mListIgnoredPaths->takeItem(row); + delete item; +} diff --git a/gui/projectfiledialog.h b/gui/projectfiledialog.h index 9256d31c0..0d904ab38 100644 --- a/gui/projectfiledialog.h +++ b/gui/projectfiledialog.h @@ -66,6 +66,12 @@ public: */ QStringList GetPaths() const; + /** + * @brief Return ignored paths from the dialog control. + * @return List of ignored paths. + */ + QStringList GetIgnorePaths() const; + /** * @brief Set project root path to dialog control. * @param root Project root path to set to dialog control. @@ -90,6 +96,12 @@ public: */ void SetPaths(const QStringList &paths); + /** + * @brief Set ignored paths to dialog control. + * @param paths List of path names to set to dialog control. + */ + void SetIgnorePaths(const QStringList &paths); + protected slots: /** * @brief Browse for include directory. @@ -122,6 +134,21 @@ protected slots: */ void RemovePath(); + /** + * @brief Add new path to ignore. + */ + void AddIgnorePath(); + + /** + * @brief Edit ignored path in the list. + */ + void EditIgnorePath(); + + /** + * @brief Remove ignored path from the list. + */ + void RemoveIgnorePath(); + protected: /** @@ -136,6 +163,12 @@ protected: */ void AddPath(const QString &path); + /** + * @brief Add new path to ignore list. + * @param path Path to add. + */ + void AddIgnorePath(const QString &path); + private: Ui::ProjectFile mUI; }; From 6fc90d1f18ecc5696896388b6ea42f00d7833d39 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 28 Feb 2011 16:08:14 +0200 Subject: [PATCH 06/10] GUI: Write ignore paths to project file. --- gui/projectfile.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gui/projectfile.cpp b/gui/projectfile.cpp index cba444092..8d5310d16 100644 --- a/gui/projectfile.cpp +++ b/gui/projectfile.cpp @@ -397,6 +397,19 @@ bool ProjectFile::Write(const QString &filename) xmlWriter.writeEndElement(); } + if (!mIgnoredPaths.isEmpty()) + { + xmlWriter.writeStartElement(IgnoreElementName); + QString path; + foreach(path, mIgnoredPaths) + { + xmlWriter.writeStartElement(IgnorePathName); + xmlWriter.writeAttribute(IgnorePathNameAttrib, path); + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndDocument(); file.close(); return true; From fb74da7fbfbf6d7b4b8ab8c3ecdfa657f1c9e2bb Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 28 Feb 2011 16:18:16 +0200 Subject: [PATCH 07/10] GUI: Fix bug mixing include and ignore dirs in GUI. --- gui/projectfiledialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/projectfiledialog.cpp b/gui/projectfiledialog.cpp index 11fdf8334..abea159e5 100644 --- a/gui/projectfiledialog.cpp +++ b/gui/projectfiledialog.cpp @@ -126,11 +126,11 @@ QStringList ProjectFileDialog::GetPaths() const QStringList ProjectFileDialog::GetIgnorePaths() const { - const int count = mUI.mListIncludeDirs->count(); + const int count = mUI.mListIgnoredPaths->count(); QStringList paths; for (int i = 0; i < count; i++) { - QListWidgetItem *item = mUI.mListIncludeDirs->item(i); + QListWidgetItem *item = mUI.mListIgnoredPaths->item(i); paths << item->text(); } return paths; From ae11b064c8f29589cb5f347c8fc9f1e43d2b52ef Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 28 Feb 2011 16:21:03 +0200 Subject: [PATCH 08/10] GUI: Small cleanup for projectfile code. --- gui/projectfile.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gui/projectfile.cpp b/gui/projectfile.cpp index 8d5310d16..71a7180ed 100644 --- a/gui/projectfile.cpp +++ b/gui/projectfile.cpp @@ -361,8 +361,7 @@ bool ProjectFile::Write(const QString &filename) if (!mIncludeDirs.isEmpty()) { xmlWriter.writeStartElement(IncludDirElementName); - QString incdir; - foreach(incdir, mIncludeDirs) + foreach(QString incdir, mIncludeDirs) { xmlWriter.writeStartElement(DirElementName); xmlWriter.writeAttribute(DirNameAttrib, incdir); @@ -374,8 +373,7 @@ bool ProjectFile::Write(const QString &filename) if (!mDefines.isEmpty()) { xmlWriter.writeStartElement(DefinesElementName); - QString define; - foreach(define, mDefines) + foreach(QString define, mDefines) { xmlWriter.writeStartElement(DefineName); xmlWriter.writeAttribute(DefineNameAttrib, define); @@ -387,8 +385,7 @@ bool ProjectFile::Write(const QString &filename) if (!mPaths.isEmpty()) { xmlWriter.writeStartElement(PathsElementName); - QString path; - foreach(path, mPaths) + foreach(QString path, mPaths) { xmlWriter.writeStartElement(PathName); xmlWriter.writeAttribute(PathNameAttrib, path); @@ -400,8 +397,7 @@ bool ProjectFile::Write(const QString &filename) if (!mIgnoredPaths.isEmpty()) { xmlWriter.writeStartElement(IgnoreElementName); - QString path; - foreach(path, mIgnoredPaths) + foreach(QString path, mIgnoredPaths) { xmlWriter.writeStartElement(IgnorePathName); xmlWriter.writeAttribute(IgnorePathNameAttrib, path); From 819dddf570542b145531ffdc20e5c742c5863a9a Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 28 Feb 2011 16:24:18 +0200 Subject: [PATCH 09/10] GUI: Add path separator for ignore dirs. --- gui/projectfiledialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gui/projectfiledialog.cpp b/gui/projectfiledialog.cpp index abea159e5..3b2195221 100644 --- a/gui/projectfiledialog.cpp +++ b/gui/projectfiledialog.cpp @@ -238,6 +238,8 @@ void ProjectFileDialog::AddIgnorePath() if (!selectedDir.isEmpty()) { + if (!selectedDir.endsWith('/')) + selectedDir += '/'; AddIgnorePath(selectedDir); } } From b1db29278d8d540bc71ca3337cb3ddba5e00f364 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 28 Feb 2011 16:31:46 +0200 Subject: [PATCH 10/10] GUI: Update project file description file. --- gui/projectfile.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gui/projectfile.txt b/gui/projectfile.txt index 2724e1eba..eed96379b 100644 --- a/gui/projectfile.txt +++ b/gui/projectfile.txt @@ -27,6 +27,9 @@ program. The format is: + + + where: @@ -42,5 +45,7 @@ where: recommended that relative paths are used for paths inside the project root folder for better portability. - defines element contains a list of C/C++ preprocessor defines. +- ignore element contains list of paths to ignore. The path can be a + directory (must end with path separator) or file. See also gui.cppcheck file in gui-directory of cppcheck sources.