mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Use a reference for the singleton
This is a bit nicer to work with than a pointer and doesn't require a heap allocation.
This commit is contained in:
parent
6fc90ca25e
commit
b070f6e3f7
3 changed files with 4 additions and 4 deletions
|
|
@ -39,7 +39,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// apply configuration
|
// apply configuration
|
||||||
if (parser->isSet(QStringLiteral("apply-settings"))) {
|
if (parser->isSet(QStringLiteral("apply-settings"))) {
|
||||||
Settings::self()->applyConfiguration();
|
Settings::self().applyConfiguration();
|
||||||
} else {
|
} else {
|
||||||
parser->showHelp();
|
parser->showHelp();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@ Settings::Settings(QObject *parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings *Settings::self()
|
Settings &Settings::self()
|
||||||
{
|
{
|
||||||
static Settings *settings = new Settings;
|
static Settings settings;
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ class Settings : public QObject
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Settings(QObject *parent = nullptr);
|
Settings(QObject *parent = nullptr);
|
||||||
static Settings *self();
|
static Settings &self();
|
||||||
|
|
||||||
// apply the configuration
|
// apply the configuration
|
||||||
void applyConfiguration();
|
void applyConfiguration();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue