mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
346950d7b7
Move all path/folder-related code from SettingManager to PathManager
57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
#include "application.hpp"
|
|
#include "singletons/pathmanager.hpp"
|
|
|
|
#include <QAbstractNativeEventFilter>
|
|
#include <QApplication>
|
|
#include <QLibrary>
|
|
|
|
#include "util/networkmanager.hpp"
|
|
|
|
#ifdef USEWINSDK
|
|
#include "util/nativeeventhelper.hpp"
|
|
#endif
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QApplication::setAttribute(Qt::AA_Use96Dpi, true);
|
|
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true);
|
|
QApplication::setAttribute(Qt::AA_UseSoftwareOpenGL, true);
|
|
QApplication a(argc, argv);
|
|
|
|
// Install native event handler for hidpi on windows
|
|
#ifdef USEWINSDK
|
|
a.installNativeEventFilter(new chatterino::util::DpiNativeEventFilter);
|
|
#endif
|
|
|
|
// Initialize settings
|
|
bool success = chatterino::singletons::PathManager::getInstance().init(argc, argv);
|
|
if (!success) {
|
|
printf("Error initializing paths\n");
|
|
return 1;
|
|
}
|
|
|
|
// Initialize NetworkManager
|
|
chatterino::util::NetworkManager::init();
|
|
|
|
int ret = 0;
|
|
|
|
{
|
|
// Initialize application
|
|
chatterino::Application app;
|
|
|
|
// Start the application
|
|
ret = app.run(a);
|
|
|
|
// Application will go out of scope here and deinitialize itself
|
|
}
|
|
|
|
// Save settings
|
|
pajlada::Settings::SettingManager::save();
|
|
|
|
// Deinitialize NetworkManager (stop thread and wait for finish, should be instant)
|
|
chatterino::util::NetworkManager::deinit();
|
|
|
|
exit(0);
|
|
return ret;
|
|
}
|