mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2024-11-15 12:15:43 +08:00
Removed extra qDebug statements
This commit is contained in:
parent
e4282f2476
commit
fb9c0bd2ef
@ -5,5 +5,7 @@ int main(int argc, char *argv[])
|
||||
// Allow secondary instances
|
||||
SingleApplication app( argc, argv );
|
||||
|
||||
qWarning() << "Started a new instance";
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
@ -79,7 +79,6 @@ SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSeconda
|
||||
abortSafely();
|
||||
}
|
||||
d->initializeMemoryBlock();
|
||||
qDebug() << "SingleApplication: Created and initialized new memory block.";
|
||||
} else {
|
||||
if( d->memory->error() == QSharedMemory::AlreadyExists ){
|
||||
// Attempt to attach to the memory segment
|
||||
@ -91,7 +90,6 @@ SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSeconda
|
||||
qCritical() << "SingleApplication: Unable to lock memory block after attach.";
|
||||
abortSafely();
|
||||
}
|
||||
qDebug() << "SingleApplication: Attached to new memory block.";
|
||||
} else {
|
||||
qCritical() << "SingleApplication: Unable create block.";
|
||||
abortSafely();
|
||||
@ -104,13 +102,9 @@ SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSeconda
|
||||
|
||||
// Make sure the shared memory block is initialised and in consistent state
|
||||
while( true ){
|
||||
qDebug() << "SingleApplication: Verifying block checksum.";
|
||||
|
||||
// If the shared memory block's checksum is valid continue
|
||||
if( d->blockChecksum() == inst->checksum ) break;
|
||||
|
||||
qDebug() << "SingleApplication: Invalid block checksum. Waiting.";
|
||||
|
||||
// If more than 5s have elapsed, assume the primary instance crashed and
|
||||
// assume it's position
|
||||
if( time.elapsed() > 5000 ){
|
||||
|
@ -169,9 +169,6 @@ void SingleApplicationPrivate::startPrimary()
|
||||
qstrncpy( inst->primaryUser, getUsername().toUtf8().data(), sizeof(inst->primaryUser) );
|
||||
inst->checksum = blockChecksum();
|
||||
instanceNumber = 0;
|
||||
|
||||
qDebug() << "SingleApplication: Started as a primary instance.";
|
||||
|
||||
// Successful creation means that no main process exists
|
||||
// So we start a QLocalServer to listen for connections
|
||||
QLocalServer::removeServer( blockServerName );
|
||||
@ -201,8 +198,6 @@ void SingleApplicationPrivate::startSecondary()
|
||||
inst->secondary += 1;
|
||||
inst->checksum = blockChecksum();
|
||||
instanceNumber = inst->secondary;
|
||||
|
||||
qDebug() << "SingleApplication: Started as a secondary instance.";
|
||||
}
|
||||
|
||||
void SingleApplicationPrivate::connectToPrimary( int msecs, ConnectionType connectionType )
|
||||
|
Loading…
Reference in New Issue
Block a user