Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit e333abf

Browse files
committed
add setup name to defaults
1 parent 66fbd57 commit e333abf

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/datasync/defaults.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ const QLoggingCategory &Defaults::loggingCategory() const
3333
return d->logCat;
3434
}
3535

36+
QString Defaults::setupName() const
37+
{
38+
return d->setupName;
39+
}
40+
3641
QDir Defaults::storageDir() const
3742
{
3843
return d->storageDir;
@@ -74,6 +79,7 @@ void Defaults::releaseDatabase()
7479

7580

7681
QtDataSync::DefaultsPrivate::DefaultsPrivate(const QString &setupName, const QDir &storageDir) :
82+
setupName(setupName),
7783
storageDir(storageDir),
7884
dbRefCounter(0),
7985
catName("qtdatasync." + setupName.toUtf8()),

src/datasync/defaults.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class Q_DATASYNC_EXPORT Defaults : public QObject
2929
//! A logging category for this setup
3030
const QLoggingCategory &loggingCategory() const;
3131

32+
//! Returns the name of the current setup
33+
QString setupName() const;
3234
//! Returns the storage directory
3335
QDir storageDir() const;
3436
//! Returns an instance of QSettings owned by defaults

src/datasync/defaults_p.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class Q_DATASYNC_EXPORT DefaultsPrivate
1515

1616
DefaultsPrivate(const QString &setupName, const QDir &storageDir);
1717

18+
QString setupName;
1819
QDir storageDir;
1920
quint64 dbRefCounter;
2021
QByteArray catName;

0 commit comments

Comments
 (0)