From 1d31dc38583d3017ea3e1c8d40545c7fa81019fc Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 28 Sep 2026 09:31:18 +0200 Subject: vectorimagetest: Update settings when switching directory Quality of life: When we switch the current directory using the combo box instead of the file dialog, we did not push it to the top of the recent directories list and thus when we started the application the next time, we would revert to the previously selected directory. This small improvement saves some time having to reselect the same directory every time you run. Pick-to: 6.12 Change-Id: I8e32218af48f29b8b7f22744364c77d658d73b21 Reviewed-by: Eirik Aavitsland --- tests/manual/vectorimagetest/mainwindow.cpp | 1 + tests/manual/vectorimagetest/mainwindow.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/manual/vectorimagetest/mainwindow.cpp b/tests/manual/vectorimagetest/mainwindow.cpp index c79e701677..ef32591a64 100644 --- a/tests/manual/vectorimagetest/mainwindow.cpp +++ b/tests/manual/vectorimagetest/mainwindow.cpp @@ -59,6 +59,7 @@ MainWindow::MainWindow(QWidget *parent) m_settings = new QSettings(QStringLiteral("org.qtproject"), QStringLiteral("svg-test"), this); connect(ui->cbCurrentDir, &QComboBox::currentTextChanged, this, &MainWindow::loadDirectory); + connect(ui->cbCurrentDir, &QComboBox::textActivated, this, &MainWindow::updateCurrentDir); QStringList list = m_settings->value(QStringLiteral("directories")).toString().split(QLatin1Char(',')); setDirList(list); diff --git a/tests/manual/vectorimagetest/mainwindow.h b/tests/manual/vectorimagetest/mainwindow.h index 8206402e2d..8e65e0e850 100644 --- a/tests/manual/vectorimagetest/mainwindow.h +++ b/tests/manual/vectorimagetest/mainwindow.h @@ -39,9 +39,9 @@ private slots: void vectorImageSizeUpdated(); void updatePlayButton(); void togglePlaying(); + void updateCurrentDir(const QString &newDir); private: - void updateCurrentDir(const QString &newDir); void setDirList(const QStringList &list); void setScale(const int scale); -- cgit v1.2.3