1 /* ============================================================
2 * QuiteRSS is a open-source cross-platform RSS/Atom news feeds reader
3 * Copyright (C) 2011-2020 QuiteRSS Team <quiterssteam@gmail.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17 * ============================================================ */
18 #include "globals.h"
19 #include "mainapplication.h"
20 #include "logfile.h"
21 #if defined(Q_OS_WIN)
22 #include <windows.h>
23 #endif
24 
main(int argc,char ** argv)25 int main(int argc, char **argv)
26 {
27   if (globals.logFileOutput_) {
28 #if defined(HAVE_QT5)
29     qInstallMessageHandler(LogFile::msgHandler);
30 #else
31     qInstallMsgHandler(LogFile::msgHandler);
32 #endif
33   }
34 
35 #ifdef Q_OS_WIN
36 #if _WIN32_WINNT >= 0x0600
37   SetProcessDPIAware();
38 #endif
39 #endif
40 #if QT_VERSION >= 0x050600
41   QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
42 #elif QT_VERSION >= 0x050400
43   QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
44   qputenv("QT_DEVICE_PIXEL_RATIO", "auto");
45 #endif
46 
47   MainApplication app(argc, argv);
48 
49   if (app.isClosing())
50     return 0;
51 
52   return app.exec();
53 }
54