GUI: Renamed functions

This commit is contained in:
Daniel Marjamäki 2016-11-19 23:00:59 +01:00
parent ad1b3361db
commit c2069c4b76
2 changed files with 47 additions and 47 deletions

View File

@ -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);

View File

@ -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.