From c2069c4b761e1caba59bacb4ff3457cf2a37c271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 19 Nov 2016 23:00:59 +0100 Subject: [PATCH] GUI: Renamed functions --- gui/projectfiledialog.cpp | 58 +++++++++++++++++++-------------------- gui/projectfiledialog.h | 36 ++++++++++++------------ 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/gui/projectfiledialog.cpp b/gui/projectfiledialog.cpp index 58a25f30e..4c10195ec 100644 --- a/gui/projectfiledialog.cpp +++ b/gui/projectfiledialog.cpp @@ -87,9 +87,9 @@ ProjectFileDialog::ProjectFileDialog(const QString &path, QWidget *parent) connect(mUI.mBtnBrowseBuildDir, SIGNAL(clicked()), this, SLOT(BrowseBuildDir())); connect(mUI.mBtnBrowseCompileDatabase, SIGNAL(clicked()), this, SLOT(BrowseCompileDatabase())); connect(mUI.mBtnBrowseVisualStudio, SIGNAL(clicked()), this, SLOT(BrowseVisualStudio())); - connect(mUI.mBtnAddCheckPath, SIGNAL(clicked()), this, SLOT(AddPath())); - connect(mUI.mBtnEditCheckPath, SIGNAL(clicked()), this, SLOT(EditPath())); - connect(mUI.mBtnRemoveCheckPath, SIGNAL(clicked()), this, SLOT(RemovePath())); + connect(mUI.mBtnAddCheckPath, SIGNAL(clicked()), this, SLOT(AddCheckPath())); + connect(mUI.mBtnEditCheckPath, SIGNAL(clicked()), this, SLOT(EditCheckPath())); + connect(mUI.mBtnRemoveCheckPath, SIGNAL(clicked()), this, SLOT(RemoveCheckPath())); connect(mUI.mBtnAddInclude, SIGNAL(clicked()), this, SLOT(AddIncludeDir())); connect(mUI.mBtnEditInclude, SIGNAL(clicked()), this, SLOT(EditIncludeDir())); connect(mUI.mBtnRemoveInclude, SIGNAL(clicked()), this, SLOT(RemoveIncludeDir())); @@ -126,7 +126,7 @@ void ProjectFileDialog::LoadFromProjectFile(const ProjectFile *projectFile) { SetBuildDir(projectFile->GetBuildDir()); SetIncludepaths(projectFile->GetIncludeDirs()); SetDefines(projectFile->GetDefines()); - SetPaths(projectFile->GetCheckPaths()); + SetCheckPaths(projectFile->GetCheckPaths()); SetImportProject(projectFile->GetImportProject()); SetExcludedPaths(projectFile->GetExcludedPaths()); SetLibraries(projectFile->GetLibraries()); @@ -139,7 +139,7 @@ void ProjectFileDialog::SaveToProjectFile(ProjectFile *projectFile) const { projectFile->SetImportProject(GetImportProject()); projectFile->SetIncludes(GetIncludePaths()); projectFile->SetDefines(GetDefines()); - projectFile->SetCheckPaths(GetPaths()); + projectFile->SetCheckPaths(GetCheckPaths()); projectFile->SetExcludedPaths(GetExcludedPaths()); projectFile->SetLibraries(GetLibraries()); projectFile->SetSuppressions(GetSuppressions()); @@ -208,7 +208,7 @@ void ProjectFileDialog::AddIncludeDir(const QString &dir) mUI.mListIncludeDirs->addItem(item); } -void ProjectFileDialog::AddPath(const QString &path) +void ProjectFileDialog::AddCheckPath(const QString &path) { if (path.isNull() || path.isEmpty()) return; @@ -273,7 +273,7 @@ QStringList ProjectFileDialog::GetDefines() const return defines; } -QStringList ProjectFileDialog::GetPaths() const +QStringList ProjectFileDialog::GetCheckPaths() const { const int count = mUI.mListCheckPaths->count(); QStringList paths; @@ -357,10 +357,10 @@ void ProjectFileDialog::SetDefines(const QStringList &defines) mUI.mEditDefines->setText(definestr); } -void ProjectFileDialog::SetPaths(const QStringList &paths) +void ProjectFileDialog::SetCheckPaths(const QStringList &paths) { foreach (QString path, paths) { - AddPath(path); + AddCheckPath(path); } } @@ -386,6 +386,26 @@ void ProjectFileDialog::SetSuppressions(const QStringList &suppressions) mUI.mListSuppressions->sortItems(); } +void ProjectFileDialog::AddCheckPath() +{ + QString dir = getExistingDirectory(tr("Select a directory to check"), false); + if (!dir.isEmpty()) + AddCheckPath(dir); +} + +void ProjectFileDialog::EditCheckPath() +{ + QListWidgetItem *item = mUI.mListCheckPaths->currentItem(); + mUI.mListCheckPaths->editItem(item); +} + +void ProjectFileDialog::RemoveCheckPath() +{ + const int row = mUI.mListCheckPaths->currentRow(); + QListWidgetItem *item = mUI.mListCheckPaths->takeItem(row); + delete item; +} + void ProjectFileDialog::AddIncludeDir() { const QString dir = getExistingDirectory(tr("Select include directory"), true); @@ -393,13 +413,6 @@ void ProjectFileDialog::AddIncludeDir() AddIncludeDir(dir); } -void ProjectFileDialog::AddPath() -{ - QString dir = getExistingDirectory(tr("Select a directory to check"), false); - if (!dir.isEmpty()) - AddPath(dir); -} - void ProjectFileDialog::RemoveIncludeDir() { const int row = mUI.mListIncludeDirs->currentRow(); @@ -413,19 +426,6 @@ void ProjectFileDialog::EditIncludeDir() mUI.mListIncludeDirs->editItem(item); } -void ProjectFileDialog::EditPath() -{ - QListWidgetItem *item = mUI.mListCheckPaths->currentItem(); - mUI.mListCheckPaths->editItem(item); -} - -void ProjectFileDialog::RemovePath() -{ - const int row = mUI.mListCheckPaths->currentRow(); - QListWidgetItem *item = mUI.mListCheckPaths->takeItem(row); - delete item; -} - void ProjectFileDialog::AddExcludePath() { QString dir = getExistingDirectory(tr("Select directory to ignore"), true); diff --git a/gui/projectfiledialog.h b/gui/projectfiledialog.h index 712e3c450..e1d09d707 100644 --- a/gui/projectfiledialog.h +++ b/gui/projectfiledialog.h @@ -73,7 +73,7 @@ public: * @brief Return check paths from the dialog control. * @return List of check paths. */ - QStringList GetPaths() const; + QStringList GetCheckPaths() const; /** * @brief Return excluded paths from the dialog control. @@ -120,7 +120,7 @@ public: * @brief Set check paths to dialog control. * @param paths List of path names to set to dialog control. */ - void SetPaths(const QStringList &paths); + void SetCheckPaths(const QStringList &paths); /** * @brief Set excluded paths to dialog control. @@ -157,17 +157,27 @@ protected slots: */ void BrowseCompileDatabase(); + /** + * @brief Add new path to check. + */ + void AddCheckPath(); + + /** + * @brief Edit path in the list. + */ + void EditCheckPath(); + + /** + * @brief Remove path from the list. + */ + void RemoveCheckPath(); + /** * @brief Browse for include directory. * Allow user to add new include directory to the list. */ void AddIncludeDir(); - /** - * @brief Add new path to check. - */ - void AddPath(); - /** * @brief Remove include directory from the list. */ @@ -178,16 +188,6 @@ protected slots: */ void EditIncludeDir(); - /** - * @brief Edit path in the list. - */ - void EditPath(); - - /** - * @brief Remove path from the list. - */ - void RemovePath(); - /** * @brief Add new path to exclude. */ @@ -245,7 +245,7 @@ protected: * @brief Add new path to check. * @param path Path to add. */ - void AddPath(const QString &path); + void AddCheckPath(const QString &path); /** * @brief Add new path to ignore list.