2018-06-28 19:46:45 +02:00
|
|
|
#include "singletons/Settings.hpp"
|
2018-04-27 22:11:19 +02:00
|
|
|
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "Application.hpp"
|
2018-06-28 19:46:45 +02:00
|
|
|
#include "singletons/Paths.hpp"
|
|
|
|
#include "singletons/Resources.hpp"
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "singletons/WindowManager.hpp"
|
2019-07-23 23:56:14 +02:00
|
|
|
#include "util/WindowsHelper.hpp"
|
2017-04-12 17:46:44 +02:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
2017-04-12 17:46:44 +02:00
|
|
|
|
2019-10-07 22:42:34 +02:00
|
|
|
Settings *Settings::instance_ = nullptr;
|
2018-08-02 14:23:27 +02:00
|
|
|
|
2018-11-25 15:02:48 +01:00
|
|
|
Settings::Settings(const QString &settingsDirectory)
|
|
|
|
: ABSettings(settingsDirectory)
|
2018-06-28 19:38:57 +02:00
|
|
|
{
|
2019-10-07 22:42:34 +02:00
|
|
|
instance_ = this;
|
2019-07-23 23:56:14 +02:00
|
|
|
|
|
|
|
#ifdef USEWINSDK
|
|
|
|
this->autorun = isRegisteredForStartup();
|
|
|
|
this->autorun.connect(
|
|
|
|
[](bool autorun) { setRegisteredForStartup(autorun); }, false);
|
|
|
|
#endif
|
2017-04-12 17:46:44 +02:00
|
|
|
}
|
|
|
|
|
2019-10-07 22:42:34 +02:00
|
|
|
Settings &Settings::instance()
|
2018-01-04 01:52:37 +01:00
|
|
|
{
|
2019-10-07 22:42:34 +02:00
|
|
|
return *instance_;
|
2018-01-04 01:52:37 +01:00
|
|
|
}
|
|
|
|
|
2018-06-28 19:51:07 +02:00
|
|
|
Settings *getSettings()
|
2018-01-17 14:14:31 +01:00
|
|
|
{
|
2019-10-07 22:42:34 +02:00
|
|
|
return &Settings::instance();
|
2018-01-17 14:14:31 +01:00
|
|
|
}
|
2018-01-23 21:33:49 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
} // namespace chatterino
|