aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/main.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2020-01-11 22:04:07 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2020-01-11 22:57:01 +0800
commit12ad6495fa332ea499485082272f796c4b08c83c (patch)
tree644607f6523185050a069fcf6eb6255c45060181 /qmidiplayer-desktop/main.cpp
parent06496661120f7858f26a29f76631e6f0a0ebae7f (diff)
downloadQMidiPlayer-12ad6495fa332ea499485082272f796c4b08c83c.tar.xz
Bring back i18n support.
Address compiler warnings in QDialSkualptureStyle. Introduced build BUILD_PORTABLE, replacing QMP_BUILD_MODE in the QMake project. The QMake project is now fully covered by the CMake project and officially deprecated.
Diffstat (limited to 'qmidiplayer-desktop/main.cpp')
-rw-r--r--qmidiplayer-desktop/main.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/qmidiplayer-desktop/main.cpp b/qmidiplayer-desktop/main.cpp
index b1c9149..9f1d593 100644
--- a/qmidiplayer-desktop/main.cpp
+++ b/qmidiplayer-desktop/main.cpp
@@ -44,11 +44,19 @@ int main(int argc,char **argv)
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
a.installTranslator(&qtTranslator);
QTranslator qmpTranslator;
- qmpTranslator.load("qmp_"+QLocale::system().name());
+#ifndef NON_PORTABLE
+ qmpTranslator.load("qmp_"+QLocale::system().name(),
+ QCoreApplication::applicationDirPath()+"/translations/");
+#else
+#define strify(s) #s
+ qmpTranslator.load("qmp_"+QLocale::system().name(),
+ QString(strify(INSTALL_PREFIX))+"/share/qmidiplayer/translations");
+#undef strify
+#endif
a.installTranslator(&qmpTranslator);
QCommandLineParser clp;
- clp.setApplicationDescription("A cross-platform MIDI player.");
+ clp.setApplicationDescription(QCoreApplication::translate("main","A cross-platform MIDI player."));
clp.addHelpOption();
clp.addVersionOption();
clp.addPositionalArgument("file",QCoreApplication::translate("main","midi files to play (optional)."),"[files...]");