From cdb86c894a919c847b87999d729c94956ef58a63 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 21 Aug 2015 08:19:10 -0400 Subject: Add a bit more text output for the single instance framework. This makes it really clear what is happening if anything *does* go wrong. --- libLumina/LuminaSingleApplication.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libLumina/LuminaSingleApplication.cpp') diff --git a/libLumina/LuminaSingleApplication.cpp b/libLumina/LuminaSingleApplication.cpp index 2ecbc276..900e7f23 100644 --- a/libLumina/LuminaSingleApplication.cpp +++ b/libLumina/LuminaSingleApplication.cpp @@ -96,13 +96,17 @@ void LSingleApplication::PerformLockChecks(){ }else{ //forward the current inputs to the locked process for processing and exit //Check the connection to the local server first + qDebug() << "Single-instance lock found"; QLocalSocket socket(this); socket.connectToServer(cfile); socket.waitForConnected(); - if(!socket.isValid()){ exit(1); } //error - could not forward info + if(!socket.isValid() || socket.state()!=QLocalSocket::ConnectedState){ + //error - could not forward info for some reason + qDebug() << " - Could not connect to locking process: exiting..."; + exit(1); + } - qDebug() << "Single-instance lock found"; - qDebug() << " - Forwarding inputs to locking process and exiting..."; + qDebug() << " - Forwarding inputs to locking process and closing down this instance..."; socket.write( inputlist.join("::::").toLocal8Bit() ); socket.waitForDisconnected(500); //max out at 1/2 second (only hits this if no inputs) } -- cgit