diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-13 11:46:16 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-13 11:46:16 +0200 |
| commit | 4a9bbff4cb157538106b588bc84f39dd7fd38289 (patch) | |
| tree | 8de3507237e53d369338c7c1d4ee9bf1f8f57dd9 /src/mainwindow.cpp | |
| parent | 8913a1190c48ff2672f8783af8594ca11e49ccf7 (diff) | |
| download | qtmaildir-4a9bbff4cb157538106b588bc84f39dd7fd38289.tar.gz qtmaildir-4a9bbff4cb157538106b588bc84f39dd7fd38289.zip | |
feat(rules): a folder dropdown, so the path suffix is never typed
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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]() { |
