X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fmain.cpp;h=9f6f066b03b99efab6c39622af751cb684af915f;hp=cb935e72cb3b150b3cdae93b7a031ae06f0e07ce;hb=a86c3a08e57e0a23b3e57d0b9ee9d27cc5113d21;hpb=9ac6ae4ee26819874d8843ba09f38a24088d663d diff --git a/src/common/main.cpp b/src/common/main.cpp index cb935e72..9f6f066b 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -65,6 +65,7 @@ int main(int argc, char **argv) { qRegisterMetaTypeStreamOperators("Message"); qRegisterMetaTypeStreamOperators("BufferInfo"); + #if defined BUILD_CORE Global::runMode = Global::CoreOnly; QCoreApplication app(argc, argv); @@ -76,15 +77,25 @@ int main(int argc, char **argv) { QApplication app(argc, argv); #endif - //Just for testing - //QTranslator translator; - //translator.load(":i18n/quassel_de"); - //app.installTranslator(&translator); + // Set up i18n support + QLocale locale = QLocale::system(); + QTranslator translator; + translator.load(QString(":i18n/quassel_%1").arg(locale.name())); + app.installTranslator(&translator); - QCoreApplication::setOrganizationDomain("quassel-irc.org"); QCoreApplication::setApplicationName("Quassel IRC"); - QCoreApplication::setOrganizationName("Quassel IRC Development Team"); + QCoreApplication::setOrganizationName("Quassel IRC Development Team"); // FIXME + + // Check if a non-standard core port is requested + QStringList args = QCoreApplication::arguments(); + + Global::defaultPort = 4242; + int idx; + if((idx = args.indexOf("-p")) > 0 && idx < args.count() - 1) { + int port = args[idx+1].toInt(); + if(port >= 1024 && port < 65536) Global::defaultPort = port; + } #ifndef BUILD_QTUI Core::instance(); // create and init the core