Changeset View
Changeset View
Standalone View
Standalone View
shell/main.cpp
Show All 21 Lines | |||||
22 | #include <KAboutData> | 22 | #include <KAboutData> | ||
23 | #include <KMessageBox> | 23 | #include <KMessageBox> | ||
24 | #include <QCommandLineParser> | 24 | #include <QCommandLineParser> | ||
25 | #include <QCommandLineOption> | 25 | #include <QCommandLineOption> | ||
26 | #include "aboutdata.h" | 26 | #include "aboutdata.h" | ||
27 | #include "okular_main.h" | 27 | #include "okular_main.h" | ||
28 | #include "shellutils.h" | 28 | #include "shellutils.h" | ||
29 | 29 | | |||
30 | #ifdef Q_OS_MACOS | ||||
31 | #include "macapplication.h" | ||||
32 | #endif | ||||
33 | | ||||
30 | int main(int argc, char** argv) | 34 | int main(int argc, char** argv) | ||
31 | { | 35 | { | ||
32 | QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); | 36 | QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); | ||
33 | 37 | | |||
38 | #ifdef Q_OS_MACOS | ||||
39 | MacApplication app(argc, argv); | ||||
40 | #else | ||||
34 | QApplication app(argc, argv); | 41 | QApplication app(argc, argv); | ||
42 | #endif | ||||
43 | | ||||
35 | KLocalizedString::setApplicationDomain("okular"); | 44 | KLocalizedString::setApplicationDomain("okular"); | ||
36 | 45 | | |||
37 | KAboutData aboutData = okularAboutData(); | 46 | KAboutData aboutData = okularAboutData(); | ||
38 | KAboutData::setApplicationData(aboutData); | 47 | KAboutData::setApplicationData(aboutData); | ||
39 | // set icon for shells which do not use desktop file metadata | 48 | // set icon for shells which do not use desktop file metadata | ||
40 | QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("okular"))); | 49 | QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("okular"))); | ||
41 | 50 | | |||
42 | QCommandLineParser parser; | 51 | QCommandLineParser parser; | ||
Show All 33 Lines | 82 | { | |||
76 | case Okular::AttachedOtherProcess: | 85 | case Okular::AttachedOtherProcess: | ||
77 | return 0; | 86 | return 0; | ||
78 | case Okular::Success: | 87 | case Okular::Success: | ||
79 | // Do nothing | 88 | // Do nothing | ||
80 | break; | 89 | break; | ||
81 | } | 90 | } | ||
82 | } | 91 | } | ||
83 | 92 | | |||
93 | #ifdef Q_OS_MACOS | ||||
94 | // Use the parsed command-line arguments while opening new files. | ||||
95 | app.setSerializedOptions(ShellUtils::serializeOptions(parser)); | ||||
96 | #endif | ||||
97 | | ||||
84 | return app.exec(); | 98 | return app.exec(); | ||
85 | } | 99 | } | ||
86 | 100 | | |||
87 | /* kate: replace-tabs on; indent-width 4; */ | 101 | /* kate: replace-tabs on; indent-width 4; */ |