Various smaller stuff, some parts of the new identity settingspage, plus Quassel
[quassel.git] / src / common / main.cpp
index f6da8f5..9f6f066 100644 (file)
@@ -65,6 +65,7 @@ int main(int argc, char **argv) {
   qRegisterMetaTypeStreamOperators<Message>("Message");
   qRegisterMetaTypeStreamOperators<BufferInfo>("BufferInfo");
 
+
 #if defined BUILD_CORE
   Global::runMode = Global::CoreOnly;
   QCoreApplication app(argc, argv);
@@ -86,6 +87,16 @@ int main(int argc, char **argv) {
   QCoreApplication::setApplicationName("Quassel IRC");
   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
 #endif