From 4a9bbff4cb157538106b588bc84f39dd7fd38289 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 13 Aug 2026 11:46:16 +0200 Subject: feat(rules): a folder dropdown, so the path suffix is never typed --- src/mainwindow.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 331354f..f622036 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1313,6 +1313,17 @@ void MainWindow::showTagRulesDialog() auto *dialog = new TagRulesDialog(this); dialog->setAttribute(Qt::WA_DeleteOnClose); + + // The Folder row's dropdown. Config holds the account subdirectories and + // the dialog holds no Config, so they are handed over here. Account::maildir + // is the subtree name the Folder term compiles a path: against; the account + // key is a config section name and would match nothing. + QStringList folders; + for (const Account &account : m_config.accounts()) { + if (!account.maildir.isEmpty() && !folders.contains(account.maildir)) + folders.append(account.maildir); + } + dialog->setFolders(folders); m_tagRulesDialog = dialog; connect(dialog, &TagRulesDialog::countsRequested, this, [this, dialog]() { -- cgit v1.2.3