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
|
||||
if (parser->isSet(QStringLiteral("apply-settings"))) {
|
||||
Settings::self()->applyConfiguration();
|
||||
Settings::self().applyConfiguration();
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class Settings : public QObject
|
|||
|
||||
public:
|
||||
Settings(QObject *parent = nullptr);
|
||||
static Settings *self();
|
||||
static Settings &self();
|
||||
|
||||
// apply the configuration
|
||||
void applyConfiguration();
|
||||
|
|
|
|||
Loading…
Reference in a new issue