GUI: Rename functions related to excluding.

This commit is contained in:
Kimmo Varis 2011-09-25 20:59:47 +03:00
parent a04d6b82f5
commit ef6a14dbaf
4 changed files with 35 additions and 35 deletions

View File

@ -96,7 +96,7 @@ void Project::Edit()
QStringList paths = mPFile->GetCheckPaths();
dlg.SetPaths(paths);
QStringList ignorepaths = mPFile->GetExcludedPaths();
dlg.SetIgnorePaths(ignorepaths);
dlg.SetExcludedPaths(ignorepaths);
int rv = dlg.exec();
if (rv == QDialog::Accepted)
@ -109,8 +109,8 @@ void Project::Edit()
mPFile->SetDefines(defines);
QStringList paths = dlg.GetPaths();
mPFile->SetCheckPaths(paths);
QStringList ignorepaths = dlg.GetIgnorePaths();
mPFile->SetExcludedPaths(ignorepaths);
QStringList excludedpaths = dlg.GetExcludedPaths();
mPFile->SetExcludedPaths(excludedpaths);
bool writeSuccess = mPFile->Write();
if (!writeSuccess)

View File

@ -225,7 +225,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QListWidget" name="mListIgnoredPaths"/>
<widget class="QListWidget" name="mListExcludedPaths"/>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
@ -298,7 +298,7 @@
<tabstop>mBtnRemoveInclude</tabstop>
<tabstop>mBtnIncludeUp</tabstop>
<tabstop>mBtnIncludeDown</tabstop>
<tabstop>mListIgnoredPaths</tabstop>
<tabstop>mListExcludedPaths</tabstop>
<tabstop>mBtnAddIgnorePath</tabstop>
<tabstop>mBtnEditIgnorePath</tabstop>
<tabstop>mBtnRemoveIgnorePath</tabstop>

View File

@ -47,9 +47,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()));
connect(mUI.mBtnAddIgnorePath, SIGNAL(clicked()), this, SLOT(AddExcludePath()));
connect(mUI.mBtnEditIgnorePath, SIGNAL(clicked()), this, SLOT(EditExcludePath()));
connect(mUI.mBtnRemoveIgnorePath, SIGNAL(clicked()), this, SLOT(RemoveExcludePath()));
connect(mUI.mBtnIncludeUp, SIGNAL(clicked()), this, SLOT(MoveIncludePathUp()));
connect(mUI.mBtnIncludeDown, SIGNAL(clicked()), this, SLOT(MoveIncludePathDown()));
}
@ -95,7 +95,7 @@ void ProjectFileDialog::AddPath(const QString &path)
mUI.mListPaths->addItem(item);
}
void ProjectFileDialog::AddIgnorePath(const QString &path)
void ProjectFileDialog::AddExcludePath(const QString &path)
{
if (path.isNull() || path.isEmpty())
return;
@ -103,7 +103,7 @@ void ProjectFileDialog::AddIgnorePath(const QString &path)
const QString newpath = QDir::toNativeSeparators(path);
QListWidgetItem *item = new QListWidgetItem(newpath);
item->setFlags(item->flags() | Qt::ItemIsEditable);
mUI.mListIgnoredPaths->addItem(item);
mUI.mListExcludedPaths->addItem(item);
}
QString ProjectFileDialog::GetRootPath() const
@ -153,13 +153,13 @@ QStringList ProjectFileDialog::GetPaths() const
return paths;
}
QStringList ProjectFileDialog::GetIgnorePaths() const
QStringList ProjectFileDialog::GetExcludedPaths() const
{
const int count = mUI.mListIgnoredPaths->count();
const int count = mUI.mListExcludedPaths->count();
QStringList paths;
for (int i = 0; i < count; i++)
{
QListWidgetItem *item = mUI.mListIgnoredPaths->item(i);
QListWidgetItem *item = mUI.mListExcludedPaths->item(i);
paths << QDir::fromNativeSeparators(item->text());
}
return paths;
@ -202,11 +202,11 @@ void ProjectFileDialog::SetPaths(const QStringList &paths)
}
}
void ProjectFileDialog::SetIgnorePaths(const QStringList &paths)
void ProjectFileDialog::SetExcludedPaths(const QStringList &paths)
{
foreach(QString path, paths)
{
AddIgnorePath(path);
AddExcludePath(path);
}
}
@ -264,7 +264,7 @@ void ProjectFileDialog::RemovePath()
delete item;
}
void ProjectFileDialog::AddIgnorePath()
void ProjectFileDialog::AddExcludePath()
{
QFileInfo inf(mFilePath);
const QString rootpath = inf.absolutePath();
@ -277,20 +277,20 @@ void ProjectFileDialog::AddIgnorePath()
{
if (!selectedDir.endsWith('/'))
selectedDir += '/';
AddIgnorePath(selectedDir);
AddExcludePath(selectedDir);
}
}
void ProjectFileDialog::EditIgnorePath()
void ProjectFileDialog::EditExcludePath()
{
QListWidgetItem *item = mUI.mListIgnoredPaths->currentItem();
mUI.mListIgnoredPaths->editItem(item);
QListWidgetItem *item = mUI.mListExcludedPaths->currentItem();
mUI.mListExcludedPaths->editItem(item);
}
void ProjectFileDialog::RemoveIgnorePath()
void ProjectFileDialog::RemoveExcludePath()
{
const int row = mUI.mListIgnoredPaths->currentRow();
QListWidgetItem *item = mUI.mListIgnoredPaths->takeItem(row);
const int row = mUI.mListExcludedPaths->currentRow();
QListWidgetItem *item = mUI.mListExcludedPaths->takeItem(row);
delete item;
}

View File

@ -68,10 +68,10 @@ public:
QStringList GetPaths() const;
/**
* @brief Return ignored paths from the dialog control.
* @return List of ignored paths.
* @brief Return excluded paths from the dialog control.
* @return List of excluded paths.
*/
QStringList GetIgnorePaths() const;
QStringList GetExcludedPaths() const;
/**
* @brief Set project root path to dialog control.
@ -98,10 +98,10 @@ public:
void SetPaths(const QStringList &paths);
/**
* @brief Set ignored paths to dialog control.
* @brief Set excluded paths to dialog control.
* @param paths List of path names to set to dialog control.
*/
void SetIgnorePaths(const QStringList &paths);
void SetExcludedPaths(const QStringList &paths);
protected slots:
/**
@ -136,19 +136,19 @@ protected slots:
void RemovePath();
/**
* @brief Add new path to ignore.
* @brief Add new path to exclude.
*/
void AddIgnorePath();
void AddExcludePath();
/**
* @brief Edit ignored path in the list.
* @brief Edit excluded path in the list.
*/
void EditIgnorePath();
void EditExcludePath();
/**
* @brief Remove ignored path from the list.
* @brief Remove excluded path from the list.
*/
void RemoveIgnorePath();
void RemoveExcludePath();
/**
* @brief Move include path up in the list.
@ -188,7 +188,7 @@ protected:
* @brief Add new path to ignore list.
* @param path Path to add.
*/
void AddIgnorePath(const QString &path);
void AddExcludePath(const QString &path);
private:
Ui::ProjectFile mUI;