Skip to content
Snippets Groups Projects
Commit 885581d4 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

initialize gApp in main, through same mechanism as gDoc

parent 0048c1e7
No related branches found
No related tags found
1 merge request!2446merge Dirs into AppConfig; split off WidgetSettings
......@@ -70,13 +70,13 @@ int main(int argc, char* argv[])
app.setWindowIcon(QIcon(":/images/BornAgain.ico"));
#endif
ApplicationSettings applicationSettings;
gDirs = std::make_unique<Dirs>();
gApp = std::make_unique<ApplicationSettings>();
QString dir = GUI::Path::appDataFolder();
if (!QDir().exists(dir))
QDir().mkpath(dir);
gDirs = std::make_unique<Dirs>();
gDoc = std::make_unique<ProjectDocument>();
MainWindow win;
......
......@@ -28,12 +28,10 @@ const QString S_SINGLE_SAMPLE_MODE = "SingleSampleMode";
} // namespace
BA_GUI_API_ ApplicationSettings* gApp; //!< global pointer to _the_ instance
BA_GUI_API_ std::unique_ptr<ApplicationSettings> gApp; //!< global pointer to _the_ instance
ApplicationSettings::ApplicationSettings()
{
gApp = this;
QFile base(":/styles/Base.stylesheet");
base.open(QFile::ReadOnly);
QString stylesheet = base.readAll();
......
......@@ -33,6 +33,6 @@ public:
QString xml_dir;
};
BA_GUI_API_ extern ApplicationSettings* gApp; //!< global pointer to the single instance
BA_GUI_API_ extern std::unique_ptr<ApplicationSettings> gApp; //!< global pointer to _the_ instance
#endif // BORNAGAIN_GUI_VIEW_LAYOUT_APPLICATIONSETTINGS_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment