1
- // Copyright 2021 <github.com/razaqq>
2
-
3
- #include " Client/AppDirectories.hpp"
4
- #include " Client/Config.hpp"
5
- #include " Client/DatabaseManager.hpp"
6
- #include " Client/Updater.hpp"
7
- #include " Client/FontLoader.hpp"
8
- #include " Client/Log.hpp"
9
- #include " Client/ReplayAnalyzer.hpp"
10
- #include " Client/ServiceProvider.hpp"
1
+ // Copyright 2025 <github.com/razaqq>
11
2
12
3
#include " Core/ApplicationGuard.hpp"
13
4
#include " Core/Directory.hpp"
14
5
#include " Core/Process.hpp"
15
6
#include " Core/StandardPaths.hpp"
16
7
#include " Core/Sqlite.hpp"
17
8
9
+ #include " Client/AppDirectories.hpp"
10
+ #include " Client/Config.hpp"
11
+ #include " Client/DatabaseManager.hpp"
12
+ #include " Client/FontLoader.hpp"
13
+ #include " Client/Log.hpp"
14
+ #include " Client/PotatoClient.hpp"
15
+ #include " Client/Updater.hpp"
16
+
17
+ #include " Gui/Palette.hpp"
18
+ #include " Gui/NativeWindow.hpp"
18
19
#include " Gui/Events.hpp"
19
20
#include " Gui/MainWindow.hpp"
20
- #include " Gui/NativeWindow.hpp"
21
- #include " Gui/Palette.hpp"
22
21
23
22
#include " VersionInfo.hpp"
24
23
25
- #include " win32.h"
26
-
27
24
#include < QApplication>
28
25
#include < QEvent>
29
26
#include < QFile>
30
27
28
+ #ifdef WIN32
29
+ #include " win32.h"
30
+ #endif
31
+
31
32
32
33
using PotatoAlert::Client::AppDirectories;
33
34
using PotatoAlert::Client::Config;
@@ -42,13 +43,15 @@ using PotatoAlert::Client::Updater;
42
43
using PotatoAlert::Core::ApplicationGuard;
43
44
using PotatoAlert::Core::ExitCurrentProcess;
44
45
using PotatoAlert::Core::ExitCurrentProcessWithError;
46
+ using PotatoAlert::Core::Log;
45
47
using PotatoAlert::Core::SQLite;
46
48
using PotatoAlert::Gui::DarkPalette;
47
49
using PotatoAlert::Gui::FontScalingChangeEvent;
48
50
using PotatoAlert::Gui::LanguageChangeEvent;
49
51
using PotatoAlert::Gui::MainWindow;
50
52
using PotatoAlert::Gui::NativeWindow;
51
53
54
+
52
55
static int RunMain (int argc, char * argv[])
53
56
{
54
57
const ApplicationGuard guard (" PotatoAlert" );
@@ -67,7 +70,7 @@ static int RunMain(int argc, char* argv[])
67
70
AppDirectories appDirs (" PotatoAlert" );
68
71
serviceProvider.Add (appDirs);
69
72
70
- PotatoAlert::Core:: Log::Init (appDirs.LogFile );
73
+ Log::Init (appDirs.LogFile );
71
74
qInstallMessageHandler (LogQtMessage);
72
75
73
76
Config config (appDirs.ConfigFile );
@@ -81,7 +84,8 @@ static int RunMain(int argc, char* argv[])
81
84
.SubmitUrl = PA_SUBMIT_URL,
82
85
.LookupUrl = PA_LOOKUP_URL,
83
86
.TransferTimeout = 10000 ,
84
- }, serviceProvider);
87
+ },
88
+ serviceProvider);
85
89
serviceProvider.Add (client);
86
90
87
91
SQLite db = SQLite::Open (appDirs.DatabaseFile , SQLite::Flags::ReadWrite | SQLite::Flags::Create);
@@ -95,7 +99,7 @@ static int RunMain(int argc, char* argv[])
95
99
serviceProvider.Add (dbm);
96
100
97
101
QApplication::setQuitOnLastWindowClosed (false );
98
-
102
+
99
103
QApplication::setOrganizationName (PRODUCT_COMPANY_NAME);
100
104
QApplication::setApplicationVersion (PRODUCT_VERSION_FULL_STR);
101
105
@@ -125,6 +129,7 @@ static int RunMain(int argc, char* argv[])
125
129
FontScalingChangeEvent fontScalingChangeEvent ((float )serviceProvider.Get <Config>().Get <ConfigKey::FontScaling>() / 100 .0f );
126
130
QApplication::sendEvent (mainWindow, &fontScalingChangeEvent);
127
131
132
+ #ifdef WIN32
128
133
// check if there is a new version available
129
134
if (serviceProvider.Get <Config>().Get <ConfigKey::UpdateNotifications>())
130
135
if (Updater::UpdateAvailable ())
@@ -134,11 +139,12 @@ static int RunMain(int argc, char* argv[])
134
139
135
140
if (QApplication::arguments ().contains (" --changelog" ))
136
141
; // TODO: add changelog
142
+ #endif
137
143
138
144
return QApplication::exec ();
139
145
}
140
146
141
- #ifndef NDEBUG
147
+ #if !defined( NDEBUG) || !defined(WIN32)
142
148
int main (int argc, char * argv[])
143
149
{
144
150
return RunMain (argc, argv);
0 commit comments