aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaSingleApplication.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-08-21 08:14:50 -0400
committerKen Moore <moorekou@gmail.com>2015-08-21 08:14:50 -0400
commitd388e9583f985ba1f09c26527605110e64066c45 (patch)
treee23dfdb1c58e2b61200e397d2d5e33eddf6d6743 /libLumina/LuminaSingleApplication.cpp
parentUpdate the single-application framework a big so that networking limitations ... (diff)
downloadlumina-d388e9583f985ba1f09c26527605110e64066c45.tar.gz
lumina-d388e9583f985ba1f09c26527605110e64066c45.tar.bz2
lumina-d388e9583f985ba1f09c26527605110e64066c45.zip
Another quick fix to the single-instance framework - add a manual existance check to teh lock file.
Diffstat (limited to 'libLumina/LuminaSingleApplication.cpp')
-rw-r--r--libLumina/LuminaSingleApplication.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/libLumina/LuminaSingleApplication.cpp b/libLumina/LuminaSingleApplication.cpp
index 2b1994e1..2ecbc276 100644
--- a/libLumina/LuminaSingleApplication.cpp
+++ b/libLumina/LuminaSingleApplication.cpp
@@ -75,7 +75,7 @@ void LSingleApplication::PerformLockChecks(){
//qDebug() << " - Try Lock Again:" << primary;
}
}
- if(primary){
+ if(primary || !QFile::exists(cfile) ){
//Create the server socket
//qDebug() << "Create Local Server";
if(QFile::exists(cfile)){ QLocalServer::removeServer(cfile); } //stale socket/server file
@@ -95,12 +95,14 @@ void LSingleApplication::PerformLockChecks(){
}else{
//forward the current inputs to the locked process for processing and exit
- qDebug() << "Single-instance lock found";
- qDebug() << " - Forwarding inputs to locking process and exiting...";
+ //Check the connection to the local server first
QLocalSocket socket(this);
socket.connectToServer(cfile);
socket.waitForConnected();
if(!socket.isValid()){ exit(1); } //error - could not forward info
+
+ qDebug() << "Single-instance lock found";
+ qDebug() << " - Forwarding inputs to locking process and exiting...";
socket.write( inputlist.join("::::").toLocal8Bit() );
socket.waitForDisconnected(500); //max out at 1/2 second (only hits this if no inputs)
}
bgstack15