mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Make Paths accessible from Application
This commit is contained in:
parent
ff87089f0e
commit
8d24a2bcaf
3 changed files with 16 additions and 3 deletions
|
@ -10,6 +10,11 @@ class EmptyApplication : public IApplication
|
|||
public:
|
||||
virtual ~EmptyApplication() = default;
|
||||
|
||||
const Paths &getPaths() override
|
||||
{
|
||||
return this->paths_;
|
||||
}
|
||||
|
||||
const Args &getArgs() override
|
||||
{
|
||||
return this->args_;
|
||||
|
@ -169,6 +174,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
Paths paths_;
|
||||
Args args_;
|
||||
};
|
||||
|
||||
|
|
|
@ -107,9 +107,10 @@ IApplication::IApplication()
|
|||
// It will create the instances of the major classes, and connect their signals
|
||||
// to each other
|
||||
|
||||
Application::Application(Settings &_settings, const Paths &_paths,
|
||||
Application::Application(Settings &_settings, const Paths &paths,
|
||||
const Args &_args)
|
||||
: args_(_args)
|
||||
: paths_(paths)
|
||||
, args_(_args)
|
||||
, themes(&this->emplace<Theme>())
|
||||
, fonts(&this->emplace<Fonts>())
|
||||
, emotes(&this->emplace<Emotes>())
|
||||
|
|
|
@ -55,6 +55,7 @@ public:
|
|||
|
||||
static IApplication *instance;
|
||||
|
||||
virtual const Paths &getPaths() = 0;
|
||||
virtual const Args &getArgs() = 0;
|
||||
virtual Theme *getThemes() = 0;
|
||||
virtual Fonts *getFonts() = 0;
|
||||
|
@ -82,6 +83,7 @@ public:
|
|||
|
||||
class Application : public IApplication
|
||||
{
|
||||
const Paths &paths_;
|
||||
const Args &args_;
|
||||
std::vector<std::unique_ptr<Singleton>> singletons_;
|
||||
int argc_{};
|
||||
|
@ -90,7 +92,7 @@ class Application : public IApplication
|
|||
public:
|
||||
static Application *instance;
|
||||
|
||||
Application(Settings &_settings, const Paths &_paths, const Args &_args);
|
||||
Application(Settings &_settings, const Paths &paths, const Args &_args);
|
||||
~Application() override;
|
||||
|
||||
Application(const Application &) = delete;
|
||||
|
@ -143,6 +145,10 @@ public:
|
|||
PluginController *const plugins{};
|
||||
#endif
|
||||
|
||||
const Paths &getPaths() override
|
||||
{
|
||||
return this->paths_;
|
||||
}
|
||||
const Args &getArgs() override
|
||||
{
|
||||
return this->args_;
|
||||
|
|
Loading…
Reference in a new issue