mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2025-01-15 17:02:06 +08:00
Code style improvements
This commit is contained in:
parent
fd8004c706
commit
5e67bf9751
@ -22,7 +22,7 @@ class SingleApplicationPrivate {
|
|||||||
public:
|
public:
|
||||||
Q_DECLARE_PUBLIC(SingleApplication)
|
Q_DECLARE_PUBLIC(SingleApplication)
|
||||||
|
|
||||||
SingleApplicationPrivate(SingleApplication *q_ptr) : q_ptr(q_ptr) {
|
SingleApplicationPrivate( SingleApplication *q_ptr ) : q_ptr( q_ptr ) {
|
||||||
server = NULL;
|
server = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ public:
|
|||||||
socket.connectToServer( memory->key() );
|
socket.connectToServer( memory->key() );
|
||||||
|
|
||||||
// Notify the parent that a new instance had been started;
|
// Notify the parent that a new instance had been started;
|
||||||
socket.waitForConnected(100);
|
socket.waitForConnected( 100 );
|
||||||
socket.close();
|
socket.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ public:
|
|||||||
signal( SIGXFSZ, SingleApplicationPrivate::terminate ); // 25
|
signal( SIGXFSZ, SingleApplicationPrivate::terminate ); // 25
|
||||||
}
|
}
|
||||||
|
|
||||||
static void terminate(int signum)
|
static void terminate( int signum )
|
||||||
{
|
{
|
||||||
while( ! sharedMem.empty() ) {
|
while( ! sharedMem.empty() ) {
|
||||||
delete sharedMem.back();
|
delete sharedMem.back();
|
||||||
@ -161,8 +161,8 @@ public:
|
|||||||
* @param argc
|
* @param argc
|
||||||
* @param argv
|
* @param argv
|
||||||
*/
|
*/
|
||||||
SingleApplication::SingleApplication(int &argc, char *argv[], uint8_t secondaryInstances)
|
SingleApplication::SingleApplication( int &argc, char *argv[], uint8_t secondaryInstances )
|
||||||
: app_t(argc, argv), d_ptr(new SingleApplicationPrivate(this))
|
: app_t( argc, argv ), d_ptr( new SingleApplicationPrivate( this ) )
|
||||||
{
|
{
|
||||||
Q_D(SingleApplication);
|
Q_D(SingleApplication);
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#ifndef SINGLE_APPLICATION_H
|
#ifndef SINGLE_APPLICATION_H
|
||||||
#define SINGLE_APPLICATION_H
|
#define SINGLE_APPLICATION_H
|
||||||
|
|
||||||
#include <QtCore/QtGlobal>
|
#include <QtCore/QtGlobal>
|
||||||
|
|
||||||
#ifndef QAPPLICATION_CLASS
|
#ifndef QAPPLICATION_CLASS
|
||||||
@ -22,7 +23,7 @@ class SingleApplication : public QAPPLICATION_CLASS
|
|||||||
typedef QAPPLICATION_CLASS app_t;
|
typedef QAPPLICATION_CLASS app_t;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SingleApplication(int &argc, char *argv[], uint8_t secondaryInstances = 0);
|
explicit SingleApplication( int &argc, char *argv[], uint8_t secondaryInstances = 0 );
|
||||||
~SingleApplication();
|
~SingleApplication();
|
||||||
|
|
||||||
bool isPrimary();
|
bool isPrimary();
|
||||||
@ -36,8 +37,6 @@ private Q_SLOTS:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
SingleApplicationPrivate *d_ptr;
|
SingleApplicationPrivate *d_ptr;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SINGLE_APPLICATION_H
|
#endif // SINGLE_APPLICATION_H
|
||||||
|
Loading…
Reference in New Issue
Block a user