forked from pbek/QOwnNotes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
675 lines (575 loc) · 23.7 KB
/
main.cpp
File metadata and controls
675 lines (575 loc) · 23.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
#include <services/databaseservice.h>
#include <services/metricsservice.h>
#include <utils/gui.h>
#include <utils/misc.h>
#include <utils/schema.h>
#include <QApplication>
#include <QFileDialog>
#include <QMessageBox>
#include <QSettings>
#include <QStyleFactory>
#include <QTranslator>
#include <QtGui>
#include "dialogs/welcomedialog.h"
#include "entities/notefolder.h"
#include "libraries/singleapplication/singleapplication.h"
#include "mainwindow.h"
#include "release.h"
#include "version.h"
// define the base class for SingleApplication
#define QAPPLICATION_CLASS QApplication
/**
* Function for loading a translation with debug output
*/
void loadTranslation(QTranslator &translator, const QString &fileName,
const QString &directory = QString()) {
bool isLoaded = translator.load(fileName, directory);
bool isInstalled = QCoreApplication::installTranslator(&translator);
qDebug() << "Translation " << fileName << "in" << directory << "isLoaded:"
<< isLoaded << ", isInstalled:" << isInstalled;
}
/**
* Function for loading the translations
*/
void loadTranslations(QTranslator *translator, const QString &locale) {
// loadTranslation(translator[0], "qt_" + QLocale::system().name(),
// QLibraryInfo::location(QLibraryInfo::TranslationsPath));
loadTranslation(translator[1], "qt_" + locale,
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
QString appPath = QCoreApplication::applicationDirPath();
loadTranslation(translator[2], "qt_" + locale, appPath + "/translations");
loadTranslation(translator[3], appPath + "/../src/languages/QOwnNotes_" + locale);
loadTranslation(translator[4], appPath + "/../languages/QOwnNotes_" + locale);
loadTranslation(translator[5], appPath + "/languages/QOwnNotes_" + locale);
loadTranslation(translator[6], appPath + "/QOwnNotes_" + locale);
loadTranslation(translator[7], "../src/languages/QOwnNotes_" + locale);
loadTranslation(translator[8], "../share/qt5/translations/QOwnNotes_" + locale);
loadTranslation(translator[9], appPath + "/../share/qt5/translations/QOwnNotes_" +
locale);
loadTranslation(translator[10], "QOwnNotes_" + locale);
}
/**
* Function for loading the release translations
*/
inline void loadReleaseTranslations(QTranslator &translatorRelease,
const QString &locale) {
loadTranslation(translatorRelease,
"/usr/share/qt5/translations/"
"QOwnNotes_" +
locale);
}
/**
* Function for loading the translations on OS X
*/
inline void loadMacTranslations(QTranslator &translatorOSX,
QTranslator &translatorOSX2,
QTranslator &translatorOSX3,
QTranslator &translatorOSX4,
const QString &appPath,
const QString &locale) {
loadTranslation(translatorOSX, appPath + "/../Resources/QOwnNotes_" + locale);
loadTranslation(translatorOSX2, "../Resources/QOwnNotes_" + locale);
loadTranslation(translatorOSX3, appPath + "/../Resources/qtbase_" + locale);
loadTranslation(translatorOSX4, "../Resources/qtbase_" + locale);
}
/**
* Does the miscellaneous startup
* If false is returned the app is supposed to quit
*/
bool mainStartupMisc(const QStringList &arguments) {
QCommandLineParser parser;
parser.setApplicationDescription("QOwnNotes " + QString(VERSION));
const QCommandLineOption helpOption = parser.addHelpOption();
const QCommandLineOption portableOption(
QStringLiteral("portable"),
QCoreApplication::translate("main",
"Runs the "
"application in portable mode."));
parser.addOption(portableOption);
const QCommandLineOption dumpSettingsOption(
QStringLiteral("dump-settings"),
QCoreApplication::translate(
"main",
"Prints out "
"a dump of the settings and other information about the "
"application and environment in GitHub Markdown and exits "
"the application."));
parser.addOption(dumpSettingsOption);
const QCommandLineOption versionOption(
QStringLiteral("version"),
QCoreApplication::translate(
"main", "Prints out the version number."));
parser.addOption(versionOption);
const QCommandLineOption allowMultipleInstancesOption(
QStringLiteral("allow-multiple-instances"),
QCoreApplication::translate(
"main",
"Allows multiple instances of QOwnNotes to be started "
"even if disallowed in the settings."));
parser.addOption(allowMultipleInstancesOption);
const QCommandLineOption clearSettingsOption(
QStringLiteral("clear-settings"),
QCoreApplication::translate("main",
"Clears the "
"settings and runs the application."));
parser.addOption(clearSettingsOption);
const QCommandLineOption sessionOption(
QStringLiteral("session"),
QCoreApplication::translate(
"main",
"Runs the "
"application in a different context for settings and "
"internal files."),
"name");
parser.addOption(sessionOption);
const QCommandLineOption actionOption(
QStringLiteral("action"),
QCoreApplication::translate(
"main",
"Triggers a menu action after the application was started."),
"name");
parser.addOption(actionOption);
// just parse the arguments, we want no error handling
parser.parse(arguments);
// show the help page if the help parameter was provided
if (parser.isSet(helpOption)) {
parser.showHelp();
}
QSettings settings;
QString interfaceStyle =
settings.value(QStringLiteral("interfaceStyle")).toString();
// restore the interface style
if (!interfaceStyle.isEmpty()) {
QApplication::setStyle(interfaceStyle);
}
#ifdef Q_OS_WIN32
Utils::Gui::doWindowsDarkModeCheck();
#endif
#ifdef Q_OS_LINUX
Utils::Gui::doLinuxDarkModeCheck();
#endif
bool systemIconTheme =
settings.value(QStringLiteral("systemIconTheme")).toBool();
if (!systemIconTheme) {
bool internalIconTheme =
settings.value(QStringLiteral("internalIconTheme")).toBool();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
if (!internalIconTheme && QIcon::themeName().isEmpty()) {
QIcon::setThemeName(QIcon::fallbackThemeName());
}
#endif
if (QIcon::themeName().isEmpty() || internalIconTheme) {
QIcon::setThemeName(QStringLiteral("breeze-qownnotes"));
}
if (Utils::Misc::isDarkModeIconTheme()) {
QIcon::setThemeName(QStringLiteral("breeze-dark-qownnotes"));
}
}
MetricsService *metricsService = MetricsService::createInstance();
metricsService->sendVisitIfEnabled(QStringLiteral("app/start"),
QStringLiteral("App Start"));
metricsService->sendEventIfEnabled(
QStringLiteral("app/qt-version-build"), QStringLiteral("app"),
QStringLiteral("qt version build"), QStringLiteral(QT_VERSION_STR));
metricsService->sendEventIfEnabled(
QStringLiteral("app/qt-version-runtime"), QStringLiteral("app"),
QStringLiteral("qt version runtime"), qVersion());
metricsService->sendEventIfEnabled(
QStringLiteral("app/theme"), QStringLiteral("app"),
QStringLiteral("theme"), QIcon::themeName());
metricsService->sendEventIfEnabled(
QStringLiteral("app/release"), QStringLiteral("app"),
QStringLiteral("release"), qApp->property("release").toString());
metricsService->sendEventIfEnabled(
QStringLiteral("app/portable"), QStringLiteral("app"),
QStringLiteral("portable"),
Utils::Misc::isInPortableMode() ? QStringLiteral("yes")
: QStringLiteral("no"));
if (qApp->property("snap").toBool()) {
metricsService->sendEventIfEnabled(
QStringLiteral("app/styles"), QStringLiteral("app"),
QStringLiteral("styles"), QStyleFactory::keys().join(QChar(' ')));
}
QString productType;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
productType = QSysInfo::productType();
#else
productType += " Qt " + QString(QT_VERSION_STR);
#endif
metricsService->sendEventIfEnabled(
QStringLiteral("app/product-type"), QStringLiteral("app"),
QStringLiteral("product-type"), productType);
QString platform = QStringLiteral("other");
#ifdef Q_OS_LINUX
platform = QStringLiteral("linux");
#endif
#ifdef Q_OS_MAC
platform = QStringLiteral("mac");
#endif
#ifdef Q_OS_WIN
platform = QStringLiteral("windows");
#endif
// disable the automatic update dialog per default for repositories and
// self-builds if nothing is already set
Utils::Misc::presetDisableAutomaticUpdateDialog();
metricsService->sendEventIfEnabled(QStringLiteral("app/platform"),
QStringLiteral("app"),
QStringLiteral("platform"), platform);
// sends locale information
metricsService->sendLocaleEvent();
// check legacy setting
QString notesPath =
settings.value(QStringLiteral("General/notesPath")).toString();
// migration: remove old setting if we found one and store new one
if (!notesPath.isEmpty()) {
settings.setValue(QStringLiteral("notesPath"), notesPath);
settings.remove(QStringLiteral("General/notesPath"));
} else {
// load the notes path
notesPath = settings.value(QStringLiteral("notesPath")).toString();
}
if (!notesPath.isEmpty()) {
// prepend the portable data path if we are in portable mode
notesPath = Utils::Misc::prependPortableDataPathIfNeeded(notesPath);
}
QDir dir(notesPath);
// if this isn't the first run but the note folder doesn't exist any more
// let the user select another one
if (!notesPath.isEmpty() && !dir.exists()) {
if (QMessageBox::question(
nullptr, QObject::tr("Note folder not found!"),
QObject::tr("Your note folder was not found any more! Do you "
"want to select a new one?")) != QMessageBox::Yes) {
return false;
}
notesPath = QFileDialog::getExistingDirectory(
nullptr,
QObject::tr(
"Please select the folder where your notes will get stored to"),
notesPath, QFileDialog::ShowDirsOnly);
dir = QDir(notesPath);
if (notesPath.isEmpty() || !dir.exists()) {
return false;
}
settings.setValue(QStringLiteral("notesPath"), notesPath);
// prepend the portable data path if we are in portable mode
notesPath = Utils::Misc::prependPortableDataPathIfNeeded(notesPath);
dir = QDir(notesPath);
}
DatabaseService::createConnection();
DatabaseService::setupTables();
// if the notes path is empty or doesn't exist open the welcome dialog
if (notesPath.isEmpty() || !dir.exists()) {
WelcomeDialog welcomeDialog;
// exit QOwnNotes if the welcome dialog was canceled
if (welcomeDialog.exec() != QDialog::Accepted) {
settings.clear();
DatabaseService::removeDiskDatabase();
return false;
}
}
// try to create note folders if they are missing
NoteFolder::migrateToNoteFolders();
if (parser.isSet(dumpSettingsOption)) {
fprintf(
stdout, "%s\n",
Utils::Misc::generateDebugInformation().toLocal8Bit().constData());
exit(0);
}
return true;
}
/**
* Shows the command line help
*/
// void showHelp() {
// qWarning() << "\nQOwnNotes " << VERSION << "\n";
// qWarning() << QObject::tr("Application Options") << ":";
// qWarning() << " --portable " <<
// QObject::tr("Runs the application in portable mode");
// qWarning(" --clear-settings " +
// QObject::tr("Clears the settings and runs "
// "the application").toUtf8());
// qWarning() << QCoreApplication::translate("main", "Copy all source "
// "files into <directory>.");
//}
/**
* Temporary log output until LogWidget::logMessageOutput takes over
*/
void tempLogMessageOutput(QtMsgType type, const QMessageLogContext &context,
const QString &msg) {
QByteArray localMsg = msg.toLocal8Bit();
auto typeText = Utils::Misc::logMsgTypeText(type);
auto message = QStringLiteral("%1 (%2:%3, %4)").arg(
msg, context.file, QString::number(context.line), context.function);
auto messageWithType = QStringLiteral("%1: %2\n").arg(typeText, message);
switch (type) {
case QtDebugMsg:
if (QSettings().value(QStringLiteral("Debug/fileLogging")).toBool()) {
fprintf(stderr, "Debug: %s\n", localMsg.constData());
}
Utils::Misc::logToFileIfAllowed(type, msg);
break;
case QtInfoMsg:
fprintf(stderr, "%s", messageWithType.toLocal8Bit().constData());
Utils::Misc::logToFileIfAllowed(type, message);
break;
case QtWarningMsg:
case QtCriticalMsg:
case QtFatalMsg:
fprintf(stderr, "%s", messageWithType.toLocal8Bit().constData());
Utils::Misc::logToFileIfAllowed(type, message);
}
}
inline void setAppProperties(QCoreApplication &app, const QString &release,
const QStringList &arguments, bool singleApp,
bool snap, bool portable, const QString &action) {
app.setProperty("release", release);
app.setProperty("portable", portable);
if (singleApp) app.setProperty("singleApplication", true);
app.setProperty("snap", snap);
app.setProperty("arguments", arguments);
app.setProperty("startupAction", action);
}
int main(int argc, char *argv[]) {
// register NoteHistoryItem, so we can store it to the settings
// we need to do that before we are accessing QSettings or the
// NoteHistoryItem instances in the settings will get destroyed
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
qRegisterMetaTypeStreamOperators<NoteHistoryItem>("NoteHistoryItem");
#endif
qRegisterMetaType<NoteHistoryItem>("NoteHistoryItem");
// temporary log output until LogWidget::logMessageOutput takes over
qInstallMessageHandler(tempLogMessageOutput);
// enabled by default on Qt6
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
QString release = RELEASE;
bool portable = false;
bool clearSettings = false;
bool snap = false;
bool allowOnlyOneAppInstance = true;
QStringList arguments;
QString appNameAdd = QString();
QString session = QString();
QString action = QString();
#ifdef QT_DEBUG
appNameAdd = QStringLiteral("Debug");
#endif
for (int i = 0; i < argc; ++i) {
QString arg(argv[i]);
arguments << arg;
if (arg == QStringLiteral("--snap")) {
// override the release string for snaps
release = QStringLiteral("Snapcraft");
snap = true;
} else if (arg == QStringLiteral("--portable")) {
portable = true;
} else if (arg == QStringLiteral("--clear-settings")) {
clearSettings = true;
} else if (arg == QStringLiteral("--help") ||
arg == QStringLiteral("--dump-settings") ||
arg == QStringLiteral("-h") ||
arg == QStringLiteral("--allow-multiple-instances")) {
allowOnlyOneAppInstance = false;
} else if (arg == QStringLiteral("--after-update")) {
qWarning() << __func__ << " - 'arg': " << arg;
#if not defined(Q_OS_WIN)
// check if there is a 2nd parameter with the script path
if (argc > (i + 1)) {
QString scriptPath(argv[i + 1]);
// remove the updater script file
QFile file(scriptPath);
file.remove();
}
#endif
} else if (arg == QStringLiteral("--session")) {
// check if there is a 2nd parameter with the session name
if (argc > (i + 1)) {
session = QString(argv[i + 1]).trimmed();
appNameAdd += QStringLiteral("-") + session;
}
} else if (arg == QStringLiteral("--action")) {
// check if there is a 2nd parameter with the action name
if (argc > (i + 1)) {
action = QString(argv[i + 1]).trimmed();
}
} else if (arg == QStringLiteral("--version")) {
fprintf(stdout, "QOwnNotes %s\n", VERSION);
exit(0);
}
}
qDebug() << __func__ << " - 'arguments': " << arguments;
// TODO(pbek): remove
// portable = true;
// disable QML caching in portable mode because the QML cache path cannot be
// configured see: https://github.com/pbek/QOwnNotes/issues/1284
if (portable) {
qputenv("QML_DISABLE_DISK_CACHE", "true");
}
// don't log SSL warnings in releases on OS X
#if defined(QT_NO_DEBUG) && defined(Q_OS_MAC)
qputenv("QT_LOGGING_RULES", "qt.network.ssl.warning=false");
#endif
// fixing some troubles in Windows 8.1
#ifdef Q_OS_WIN32
QCoreApplication::addLibraryPath(QStringLiteral("./"));
#endif
QCoreApplication::setOrganizationDomain(QStringLiteral("PBE"));
QCoreApplication::setOrganizationName(QStringLiteral("PBE"));
QCoreApplication::setApplicationName(QStringLiteral("QOwnNotes") +
appNameAdd);
QString appVersion = QStringLiteral(VERSION);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
appVersion += QStringLiteral(" ") + QSysInfo::prettyProductName();
if (!appVersion.contains(QSysInfo::currentCpuArchitecture())) {
appVersion += QStringLiteral(" ") + QSysInfo::currentCpuArchitecture();
}
#else
appVersion += QStringLiteral(" Qt ") + QStringLiteral(QT_VERSION_STR);
#endif
appVersion += QStringLiteral(" ") + QString(release);
#ifdef QT_DEBUG
appVersion += QStringLiteral(" Debug");
#endif
QCoreApplication::setApplicationVersion(appVersion);
// set the settings format to ini format and the settings path inside the
// path of the application in portable mode
if (portable) {
QSettings::setDefaultFormat(QSettings::IniFormat);
QSettings::setPath(QSettings::IniFormat, QSettings::UserScope,
Utils::Misc::portableDataPath());
QSettings settings;
qDebug() << "settings fileName: " << settings.fileName();
}
// clear the settings if a --clear-settings parameter was provided
if (clearSettings) {
QSettings settings;
settings.clear();
if (!portable) {
DatabaseService::removeDiskDatabase();
}
qWarning("Your settings are now cleared!");
}
QSettings settings;
QString locale =
settings.value(QStringLiteral("interfaceLanguage")).toString();
if (locale.isEmpty()) {
locale = QLocale::system().name().section('_', 0, 0);
}
qDebug() << __func__ << " - 'locale': " << locale;
// setup default schema settings
Utils::Schema::schemaSettings = new Utils::Schema::Settings();
#ifndef QT_DEBUG
QTranslator translatorRelease;
#endif
QTranslator translators[11];
#ifdef Q_OS_MAC
QTranslator translatorOSX;
QTranslator translatorOSX2;
QTranslator translatorOSX3;
QTranslator translatorOSX4;
// we don't need this on macOS
allowOnlyOneAppInstance = false;
#else
// if allowOnlyOneAppInstance still has the default true let's ask the
// settings
if (allowOnlyOneAppInstance) {
allowOnlyOneAppInstance =
settings.value(QStringLiteral("allowOnlyOneAppInstance"), true)
.toBool();
}
#endif
if (allowOnlyOneAppInstance && !SingleApplication::isSupported()) {
allowOnlyOneAppInstance = false;
settings.setValue(QStringLiteral("allowOnlyOneAppInstance"), false);
qWarning() << QCoreApplication::translate(
"main",
"Single application mode is not supported on your "
"system!");
}
// if only one app instance is allowed use SingleApplication
if (allowOnlyOneAppInstance) {
SingleApplication app(argc, argv, true,
SingleApplication::Mode::User |
SingleApplication::Mode::SecondaryNotification);
// quit app if it was already started
if (app.isSecondary()) {
qWarning() << QCoreApplication::translate(
"main",
"Another instance of QOwnNotes was already started! "
"You can turn off the single instance mode in the settings"
" or use the parameter --allow-multiple-instances.");
// send message if an action was set
if (!action.isEmpty()) {
app.sendMessage(QString("startupAction:" + action).toUtf8());
}
app.exit(0);
return 0;
}
setAppProperties(app, release, arguments, true, snap, portable, action);
#ifndef QT_DEBUG
loadReleaseTranslations(translatorRelease, locale);
#endif
loadTranslations(translators, locale);
#ifdef Q_OS_MAC
loadMacTranslations(translatorOSX, translatorOSX2, translatorOSX3, translatorOSX4,
QCoreApplication::applicationDirPath(), locale);
#endif
const bool result = mainStartupMisc(arguments);
if (!result) {
return 0;
}
MainWindow w;
w.show();
// receive messages from the primary app
QObject::connect(&app, &SingleApplication::receivedMessage, [&](quint32 instanceId, QByteArray message) {
Q_UNUSED(instanceId)
qDebug() << __func__ << " - 'message': " << message;
// trigger the startup menu action
if (message.startsWith("startupAction:")) {
message.remove(0, 14);
app.setProperty("startupAction", message);
w.triggerStartupMenuAction();
}
});
// raise the main window if app was started a 2nd time in single
// application mode
QObject::connect(&app, &SingleApplication::instanceStarted, [&] {
qWarning() << QCoreApplication::translate(
"main",
"A second instance of QOwnNotes was attempted to be "
"started!");
w.show();
w.raise();
w.activateWindow();
// in case the window was minimized show it normal again
// (it didn't come up when it was minimized on KDE)
if (w.isMinimized()) {
w.showNormal();
}
});
return app.exec();
} else {
// use a normal QApplication if multiple instances of the app are
// allowed
QApplication app(argc, argv);
setAppProperties(app, release, arguments, false, snap, portable, action);
#ifndef QT_DEBUG
loadReleaseTranslations(translatorRelease, locale);
#endif
loadTranslations(translators, locale);
#ifdef Q_OS_MAC
loadMacTranslations(translatorOSX, translatorOSX2, translatorOSX3, translatorOSX4,
QCoreApplication::applicationDirPath(), locale);
#endif
const bool result = mainStartupMisc(arguments);
if (!result) {
return 0;
}
MainWindow w;
w.show();
return app.exec();
}
}