aboutsummaryrefslogtreecommitdiff
path: root/singleapplication.cpp
diff options
context:
space:
mode:
authorItay Grudev <itay@grudev.com>2015-02-26 19:19:38 +0000
committerItay Grudev <itay@grudev.com>2015-02-26 19:19:38 +0000
commitff14d2b59dbb5bf0b32e0e055cdfde805c63552d (patch)
treec687d0be2dd1c9a15a4f3bc8af31d23cde3fde9d /singleapplication.cpp
parentAdded documentation (diff)
downloadsingleapplication-ff14d2b59dbb5bf0b32e0e055cdfde805c63552d.tar.xz
Fixed new line issue
Diffstat (limited to 'singleapplication.cpp')
-rw-r--r--singleapplication.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/singleapplication.cpp b/singleapplication.cpp
index 083ea30..7ae333d 100644
--- a/singleapplication.cpp
+++ b/singleapplication.cpp
@@ -2,8 +2,7 @@
#include <cstdlib>
/**
- * @brief Constructor. Checks and fires up LocalServer or closes the
-program
+ * @brief Constructor. Checks and fires up LocalServer or closes the program
* if another instance already exists
* @param argc
* @param argv
@@ -11,8 +10,7 @@ program
SingleApplication::SingleApplication(int argc, char *argv[])
: QApplication(argc, argv)
{
- QString serverName = QApplication::organizationName() +
-QApplication::applicationName();
+ QString serverName = QApplication::organizationName() + QApplication::applicationName();
serverName.replace(QRegExp("[^\\w\\-. ]"), "");
// Attempt to connect to the LocalServer
@@ -20,16 +18,14 @@ QApplication::applicationName();
socket->connectToServer(serverName);
if(socket->waitForConnected(1000)){
socket->close();
- ::exit(EXIT_SUCCESS); // Terminate the program using STDLib's
-exit function
+ ::exit(EXIT_SUCCESS); // Terminate the program using STDLib's exit function
} else {
// If the connection is insuccessful, this is the main process
// So we create a Local Server
server = new QLocalServer();
server->removeServer(serverName);
server->listen(serverName);
- QObject::connect(server, SIGNAL(newConnection()), this,
-SLOT(slotConnectionEstablished()));
+ QObject::connect(server, SIGNAL(newConnection()), this, SLOT(slotConnectionEstablished()));
}
}
@@ -49,4 +45,3 @@ void SingleApplication::slotConnectionEstablished()
server->nextPendingConnection();
emit showUp();
}
-