forked from qt-creator/qt-creator
Squish: Use history completer for suites base directory
Change-Id: I31fd69b7db0f4db38ad739b30234f0247f0b8fd2 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -43,8 +43,6 @@
|
|||||||
namespace Squish {
|
namespace Squish {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
static QString previousPath;
|
|
||||||
|
|
||||||
OpenSquishSuitesDialog::OpenSquishSuitesDialog(QWidget *parent)
|
OpenSquishSuitesDialog::OpenSquishSuitesDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
@@ -53,7 +51,7 @@ OpenSquishSuitesDialog::OpenSquishSuitesDialog(QWidget *parent)
|
|||||||
setModal(true);
|
setModal(true);
|
||||||
|
|
||||||
m_directoryLineEdit = new Utils::PathChooser;
|
m_directoryLineEdit = new Utils::PathChooser;
|
||||||
m_directoryLineEdit->setPath(previousPath);
|
m_directoryLineEdit->setHistoryCompleter("Squish.SuitesBase", true);
|
||||||
|
|
||||||
m_suitesListWidget = new QListWidget;
|
m_suitesListWidget = new QListWidget;
|
||||||
|
|
||||||
@@ -98,6 +96,8 @@ OpenSquishSuitesDialog::OpenSquishSuitesDialog(QWidget *parent)
|
|||||||
|
|
||||||
connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||||
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
|
|
||||||
|
onDirectoryChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenSquishSuitesDialog::~OpenSquishSuitesDialog() = default;
|
OpenSquishSuitesDialog::~OpenSquishSuitesDialog() = default;
|
||||||
@@ -156,8 +156,7 @@ void OpenSquishSuitesDialog::deselectAll()
|
|||||||
void OpenSquishSuitesDialog::setChosenSuites()
|
void OpenSquishSuitesDialog::setChosenSuites()
|
||||||
{
|
{
|
||||||
const int count = m_suitesListWidget->count();
|
const int count = m_suitesListWidget->count();
|
||||||
previousPath = m_directoryLineEdit->path();
|
const QDir baseDir(m_directoryLineEdit->path());
|
||||||
const QDir baseDir(previousPath);
|
|
||||||
for (int row = 0; row < count; ++row) {
|
for (int row = 0; row < count; ++row) {
|
||||||
QListWidgetItem *item = m_suitesListWidget->item(row);
|
QListWidgetItem *item = m_suitesListWidget->item(row);
|
||||||
if (item->checkState() == Qt::Checked)
|
if (item->checkState() == Qt::Checked)
|
||||||
|
Reference in New Issue
Block a user