GUI: Rename functions related to excluding.
This commit is contained in:
parent
a04d6b82f5
commit
ef6a14dbaf
|
@ -96,7 +96,7 @@ void Project::Edit()
|
||||||
QStringList paths = mPFile->GetCheckPaths();
|
QStringList paths = mPFile->GetCheckPaths();
|
||||||
dlg.SetPaths(paths);
|
dlg.SetPaths(paths);
|
||||||
QStringList ignorepaths = mPFile->GetExcludedPaths();
|
QStringList ignorepaths = mPFile->GetExcludedPaths();
|
||||||
dlg.SetIgnorePaths(ignorepaths);
|
dlg.SetExcludedPaths(ignorepaths);
|
||||||
|
|
||||||
int rv = dlg.exec();
|
int rv = dlg.exec();
|
||||||
if (rv == QDialog::Accepted)
|
if (rv == QDialog::Accepted)
|
||||||
|
@ -109,8 +109,8 @@ void Project::Edit()
|
||||||
mPFile->SetDefines(defines);
|
mPFile->SetDefines(defines);
|
||||||
QStringList paths = dlg.GetPaths();
|
QStringList paths = dlg.GetPaths();
|
||||||
mPFile->SetCheckPaths(paths);
|
mPFile->SetCheckPaths(paths);
|
||||||
QStringList ignorepaths = dlg.GetIgnorePaths();
|
QStringList excludedpaths = dlg.GetExcludedPaths();
|
||||||
mPFile->SetExcludedPaths(ignorepaths);
|
mPFile->SetExcludedPaths(excludedpaths);
|
||||||
|
|
||||||
bool writeSuccess = mPFile->Write();
|
bool writeSuccess = mPFile->Write();
|
||||||
if (!writeSuccess)
|
if (!writeSuccess)
|
||||||
|
|
|
@ -225,7 +225,7 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QListWidget" name="mListIgnoredPaths"/>
|
<widget class="QListWidget" name="mListExcludedPaths"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||||
|
@ -298,7 +298,7 @@
|
||||||
<tabstop>mBtnRemoveInclude</tabstop>
|
<tabstop>mBtnRemoveInclude</tabstop>
|
||||||
<tabstop>mBtnIncludeUp</tabstop>
|
<tabstop>mBtnIncludeUp</tabstop>
|
||||||
<tabstop>mBtnIncludeDown</tabstop>
|
<tabstop>mBtnIncludeDown</tabstop>
|
||||||
<tabstop>mListIgnoredPaths</tabstop>
|
<tabstop>mListExcludedPaths</tabstop>
|
||||||
<tabstop>mBtnAddIgnorePath</tabstop>
|
<tabstop>mBtnAddIgnorePath</tabstop>
|
||||||
<tabstop>mBtnEditIgnorePath</tabstop>
|
<tabstop>mBtnEditIgnorePath</tabstop>
|
||||||
<tabstop>mBtnRemoveIgnorePath</tabstop>
|
<tabstop>mBtnRemoveIgnorePath</tabstop>
|
||||||
|
|
|
@ -47,9 +47,9 @@ ProjectFileDialog::ProjectFileDialog(const QString &path, QWidget *parent)
|
||||||
connect(mUI.mBtnRemoveInclude, SIGNAL(clicked()), this, SLOT(RemoveIncludeDir()));
|
connect(mUI.mBtnRemoveInclude, SIGNAL(clicked()), this, SLOT(RemoveIncludeDir()));
|
||||||
connect(mUI.mBtnEditPath, SIGNAL(clicked()), this, SLOT(EditPath()));
|
connect(mUI.mBtnEditPath, SIGNAL(clicked()), this, SLOT(EditPath()));
|
||||||
connect(mUI.mBtnRemovePath, SIGNAL(clicked()), this, SLOT(RemovePath()));
|
connect(mUI.mBtnRemovePath, SIGNAL(clicked()), this, SLOT(RemovePath()));
|
||||||
connect(mUI.mBtnAddIgnorePath, SIGNAL(clicked()), this, SLOT(AddIgnorePath()));
|
connect(mUI.mBtnAddIgnorePath, SIGNAL(clicked()), this, SLOT(AddExcludePath()));
|
||||||
connect(mUI.mBtnEditIgnorePath, SIGNAL(clicked()), this, SLOT(EditIgnorePath()));
|
connect(mUI.mBtnEditIgnorePath, SIGNAL(clicked()), this, SLOT(EditExcludePath()));
|
||||||
connect(mUI.mBtnRemoveIgnorePath, SIGNAL(clicked()), this, SLOT(RemoveIgnorePath()));
|
connect(mUI.mBtnRemoveIgnorePath, SIGNAL(clicked()), this, SLOT(RemoveExcludePath()));
|
||||||
connect(mUI.mBtnIncludeUp, SIGNAL(clicked()), this, SLOT(MoveIncludePathUp()));
|
connect(mUI.mBtnIncludeUp, SIGNAL(clicked()), this, SLOT(MoveIncludePathUp()));
|
||||||
connect(mUI.mBtnIncludeDown, SIGNAL(clicked()), this, SLOT(MoveIncludePathDown()));
|
connect(mUI.mBtnIncludeDown, SIGNAL(clicked()), this, SLOT(MoveIncludePathDown()));
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ void ProjectFileDialog::AddPath(const QString &path)
|
||||||
mUI.mListPaths->addItem(item);
|
mUI.mListPaths->addItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectFileDialog::AddIgnorePath(const QString &path)
|
void ProjectFileDialog::AddExcludePath(const QString &path)
|
||||||
{
|
{
|
||||||
if (path.isNull() || path.isEmpty())
|
if (path.isNull() || path.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
@ -103,7 +103,7 @@ void ProjectFileDialog::AddIgnorePath(const QString &path)
|
||||||
const QString newpath = QDir::toNativeSeparators(path);
|
const QString newpath = QDir::toNativeSeparators(path);
|
||||||
QListWidgetItem *item = new QListWidgetItem(newpath);
|
QListWidgetItem *item = new QListWidgetItem(newpath);
|
||||||
item->setFlags(item->flags() | Qt::ItemIsEditable);
|
item->setFlags(item->flags() | Qt::ItemIsEditable);
|
||||||
mUI.mListIgnoredPaths->addItem(item);
|
mUI.mListExcludedPaths->addItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ProjectFileDialog::GetRootPath() const
|
QString ProjectFileDialog::GetRootPath() const
|
||||||
|
@ -153,13 +153,13 @@ QStringList ProjectFileDialog::GetPaths() const
|
||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList ProjectFileDialog::GetIgnorePaths() const
|
QStringList ProjectFileDialog::GetExcludedPaths() const
|
||||||
{
|
{
|
||||||
const int count = mUI.mListIgnoredPaths->count();
|
const int count = mUI.mListExcludedPaths->count();
|
||||||
QStringList paths;
|
QStringList paths;
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
QListWidgetItem *item = mUI.mListIgnoredPaths->item(i);
|
QListWidgetItem *item = mUI.mListExcludedPaths->item(i);
|
||||||
paths << QDir::fromNativeSeparators(item->text());
|
paths << QDir::fromNativeSeparators(item->text());
|
||||||
}
|
}
|
||||||
return paths;
|
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)
|
foreach(QString path, paths)
|
||||||
{
|
{
|
||||||
AddIgnorePath(path);
|
AddExcludePath(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ void ProjectFileDialog::RemovePath()
|
||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectFileDialog::AddIgnorePath()
|
void ProjectFileDialog::AddExcludePath()
|
||||||
{
|
{
|
||||||
QFileInfo inf(mFilePath);
|
QFileInfo inf(mFilePath);
|
||||||
const QString rootpath = inf.absolutePath();
|
const QString rootpath = inf.absolutePath();
|
||||||
|
@ -277,20 +277,20 @@ void ProjectFileDialog::AddIgnorePath()
|
||||||
{
|
{
|
||||||
if (!selectedDir.endsWith('/'))
|
if (!selectedDir.endsWith('/'))
|
||||||
selectedDir += '/';
|
selectedDir += '/';
|
||||||
AddIgnorePath(selectedDir);
|
AddExcludePath(selectedDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectFileDialog::EditIgnorePath()
|
void ProjectFileDialog::EditExcludePath()
|
||||||
{
|
{
|
||||||
QListWidgetItem *item = mUI.mListIgnoredPaths->currentItem();
|
QListWidgetItem *item = mUI.mListExcludedPaths->currentItem();
|
||||||
mUI.mListIgnoredPaths->editItem(item);
|
mUI.mListExcludedPaths->editItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectFileDialog::RemoveIgnorePath()
|
void ProjectFileDialog::RemoveExcludePath()
|
||||||
{
|
{
|
||||||
const int row = mUI.mListIgnoredPaths->currentRow();
|
const int row = mUI.mListExcludedPaths->currentRow();
|
||||||
QListWidgetItem *item = mUI.mListIgnoredPaths->takeItem(row);
|
QListWidgetItem *item = mUI.mListExcludedPaths->takeItem(row);
|
||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,10 +68,10 @@ public:
|
||||||
QStringList GetPaths() const;
|
QStringList GetPaths() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return ignored paths from the dialog control.
|
* @brief Return excluded paths from the dialog control.
|
||||||
* @return List of ignored paths.
|
* @return List of excluded paths.
|
||||||
*/
|
*/
|
||||||
QStringList GetIgnorePaths() const;
|
QStringList GetExcludedPaths() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set project root path to dialog control.
|
* @brief Set project root path to dialog control.
|
||||||
|
@ -98,10 +98,10 @@ public:
|
||||||
void SetPaths(const QStringList &paths);
|
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.
|
* @param paths List of path names to set to dialog control.
|
||||||
*/
|
*/
|
||||||
void SetIgnorePaths(const QStringList &paths);
|
void SetExcludedPaths(const QStringList &paths);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
/**
|
/**
|
||||||
|
@ -136,19 +136,19 @@ protected slots:
|
||||||
void RemovePath();
|
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.
|
* @brief Move include path up in the list.
|
||||||
|
@ -188,7 +188,7 @@ protected:
|
||||||
* @brief Add new path to ignore list.
|
* @brief Add new path to ignore list.
|
||||||
* @param path Path to add.
|
* @param path Path to add.
|
||||||
*/
|
*/
|
||||||
void AddIgnorePath(const QString &path);
|
void AddExcludePath(const QString &path);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ProjectFile mUI;
|
Ui::ProjectFile mUI;
|
||||||
|
|
Loading…
Reference in New Issue