[pim/trojita] src/Plugins/AbookAddressbook: Add method for getting configfile name

Espen Sandøy Hustad <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit d557255be753ed3fc96078c1a5118f21edbd10e4 by Espen Sandøy Hustad.
Committed on 03/08/2026 at 18:42.
Pushed by ehustad into branch 'master'.

Add method for getting configfile name

M  +6    -1    src/Plugins/AbookAddressbook/AbookAddressbook.cpp
M  +1    -0    src/Plugins/AbookAddressbook/AbookAddressbook.h

https://invent.kde.org/pim/trojita/-/commit/d557255be753ed3fc96078c1a5118f21edbd10e4

diff --git a/src/Plugins/AbookAddressbook/AbookAddressbook.cpp b/src/Plugins/AbookAddressbook/AbookAddressbook.cpp
index 9e808a48a..9de13f0b1 100644
--- a/src/Plugins/AbookAddressbook/AbookAddressbook.cpp
+++ b/src/Plugins/AbookAddressbook/AbookAddressbook.cpp
@@ -177,6 +177,11 @@ QString AbookAddressbook::abookDirPath() const
     return QDir::homePath() + QStringLiteral("/.abook");
 }
 
+QString AbookAddressbook::configFileName() const
+{
+    return abookDirPath() + QStringLiteral("/abookrc");
+}
+
 void AbookAddressbook::createAbookDir()
 {
     QDir dir(abookDirPath());
@@ -189,7 +194,7 @@ void AbookAddressbook::createAbookDir()
 
 void AbookAddressbook::updateConfigFile() const
 {
-    QFile file(QDir::homePath() + QLatin1String("/.abook/abookrc"));
+    QFile file(configFileName());
     QStringList abookrc;
     if (!file.exists()) {
         abookrc << QStringLiteral("field photo = Photo") << QStringLiteral("set preserve_fields=all");
diff --git a/src/Plugins/AbookAddressbook/AbookAddressbook.h b/src/Plugins/AbookAddressbook/AbookAddressbook.h
index fa00aaa65..448ba41b6 100644
--- a/src/Plugins/AbookAddressbook/AbookAddressbook.h
+++ b/src/Plugins/AbookAddressbook/AbookAddressbook.h
@@ -78,6 +78,7 @@ private:
     void remonitorAdressbook();
 
     [[nodiscard]] QString abookDirPath() const;
+    [[nodiscard]] QString configFileName() const;
 
     QFileSystemWatcher *m_filesystemWatcher;
     QTimer *m_updateTimer;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.