aboutsummaryrefslogtreecommitdiff
path: root/lib/settings.h
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-08-30 12:33:56 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-08-30 12:36:14 +0200
commitf005f3b69651bd6d6f58879804e1281f6c08177a (patch)
treed4e48739a9d8e32f15f34922b00f0b2ec69417f5 /lib/settings.h
parent6d55a2c27852f9285aa1b435a1fd56ba08aa83e5 (diff)
downloadlibquotient-f005f3b69651bd6d6f58879804e1281f6c08177a.tar.gz
libquotient-f005f3b69651bd6d6f58879804e1281f6c08177a.zip
SettingsGroup, AccountSettings: simplify constructors
The parameter packs intended to pass organisation/application names to QSettings never worked that way since Quotient::Settings didn't have that parameter pack in its constructor. On the other hand, setting organisation/application name using static methods before constructing the first settings object has been working just fine so far. If someone needs to create a settings object with customised org/app name for some reason (sneaking settings from other apps?), those can be brought back in a working manner and without breaking API/ABI even.
Diffstat (limited to 'lib/settings.h')
-rw-r--r--lib/settings.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/settings.h b/lib/settings.h
index 3f4dc123..efd0d714 100644
--- a/lib/settings.h
+++ b/lib/settings.h
@@ -78,9 +78,8 @@ protected:
class SettingsGroup : public Settings {
public:
- template <typename... ArgTs>
- explicit SettingsGroup(QString path, ArgTs&&... qsettingsArgs)
- : Settings(std::forward<ArgTs>(qsettingsArgs)...)
+ explicit SettingsGroup(QString path, QObject* parent = nullptr)
+ : Settings(parent)
, groupPath(std::move(path))
{}
@@ -134,10 +133,8 @@ class AccountSettings : public SettingsGroup {
Q_PROPERTY(QByteArray encryptionAccountPickle READ encryptionAccountPickle
WRITE setEncryptionAccountPickle)
public:
- template <typename... ArgTs>
- explicit AccountSettings(const QString& accountId, ArgTs&&... qsettingsArgs)
- : SettingsGroup("Accounts/" + accountId,
- std::forward<ArgTs>(qsettingsArgs)...)
+ explicit AccountSettings(const QString& accountId, QObject* parent = nullptr)
+ : SettingsGroup("Accounts/" + accountId, parent)
{}
QString userId() const;