[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/sdk/kdevelop/app
From:       Niko Sams <niko.sams () gmail ! com>
Date:       2010-02-16 9:48:14
Message-ID: 1266313694.853496.6886.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1090865 by nsams:

Allow starting kdevelop without any arguments that would load the previous session
and that one is already running in a different process.
A new one is created in that case now.

 M  +12 -0     main.cpp  


--- trunk/extragear/sdk/kdevelop/app/main.cpp #1090864:1090865
@@ -116,11 +116,23 @@
             qerr << endl << i18n("Cannot open unknown session %1. See --sessions \
switch for available sessions or use -cs to create a new one.", session) << endl;  \
return 1;  }
+        if ( !KDevelop::SessionController::tryLockSession(KDevelop::SessionController::defaultSessionId(session)) \
) { +            QTextStream qerr(stderr);
+            qerr << endl << i18n("Session %1 is already running.", session) << endl;
+            return 1;            
+        }
     }
 
     ///Manage sessions: There always needs a KDEV_SESSION to be set, so the duchain \
can be stored in the session-specific directory  session = \
KDevelop::SessionController::defaultSessionId(session);  
+    //if session is already running create a new one
+    //if the user explicitely picked a already running session using the -s switch \
he already +    //gets got an error
+    if(!KDevelop::SessionController::tryLockSession(session)) {
+        session = QUuid::createUuid();
+    }
+
     ///@TODO Eventually show a session-picking dialog
     QFileInfo fi(QFileInfo(QApplication::applicationFilePath()).path() + \
"/kdevelop.bin");  if( !fi.exists() ) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic