summaryrefslogtreecommitdiffstats
path: root/src/config.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-18 15:09:09 +0200
committerDanilo M. <danix@danix.xyz>2026-09-18 15:09:09 +0200
commit729fd1465718ef1da5f61452bcb7eb23d02c9c9a (patch)
tree49df1e831e90d012685e829b8eb52c5d5fd1a3dc /src/config.h
parent3303c7855cb22a6bb4f36aa1a17707187320f5d2 (diff)
downloadqtmaildir-729fd1465718ef1da5f61452bcb7eb23d02c9c9a.tar.gz
qtmaildir-729fd1465718ef1da5f61452bcb7eb23d02c9c9a.zip
feat: add the contacts_dir config key
Adds Config::contactsDir(), the [general] key Task 5 will read to locate the ContactStore. Empty means the feature is off. The key is read WITHOUT the general/ prefix, like notmuch_config, because QSettings' INI backend strips a section literally named [general]. Absent or empty is silent; a set path that does not exist is reported through addProblem(). A leading ~ is expanded by a local helper, since config.cpp expands no other path and this is the first one to need it.
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/config.h b/src/config.h
index 5a43d8c..c6f1cae 100644
--- a/src/config.h
+++ b/src/config.h
@@ -404,6 +404,19 @@ public:
/// Optional alternate notmuch config file. Empty means "let notmuch decide".
QString notmuchConfig() const { return m_notmuchConfig; }
+ /// The vdirsyncer contacts directory (vCard 3.0 files), or empty to turn
+ /// contact completion off.
+ ///
+ /// A [general] key, read WITHOUT the "general/" prefix like notmuch_config
+ /// above. There is no default: guessing a vdir would make the application
+ /// read a directory the user never named, and a machine with no address
+ /// book is an ordinary machine. A leading "~" is expanded, because the
+ /// README documents the usual value in that form. A set path that does not
+ /// exist is reported through addProblem(), because the user asked for
+ /// something and is not getting it; an absent key is silent, because that
+ /// is simply the feature being off rather than a misconfiguration.
+ QString contactsDir() const { return m_contactsDir; }
+
/// Matches every configured account's sent mail, or empty when no account
/// configures one.
///
@@ -578,6 +591,7 @@ private:
QString m_syncStatus;
int m_toolbarIconSize = 24;
QString m_notmuchConfig;
+ QString m_contactsDir;
QString m_dateFormat;
QStringList m_forwardPrefixes;
QString m_language;