mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 06:20:53 +01:00
Fix FTBS on OS2, thank Elbert for tests
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3581 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -31,6 +31,10 @@ QETSingleApplication::QETSingleApplication(int &argc, char **argv, const QString
|
|||||||
unique_key_(unique_key)
|
unique_key_(unique_key)
|
||||||
{
|
{
|
||||||
// verifie s'il y a un segment de memoire partage correspondant a la cle unique
|
// verifie s'il y a un segment de memoire partage correspondant a la cle unique
|
||||||
|
#if defined (Q_OS_OS2)
|
||||||
|
#define QT_NO_SHAREDMEMORY
|
||||||
|
{
|
||||||
|
#else
|
||||||
shared_memory_.setKey(unique_key_);
|
shared_memory_.setKey(unique_key_);
|
||||||
if (shared_memory_.attach()) {
|
if (shared_memory_.attach()) {
|
||||||
// oui : l'application est deja en cours d'execution
|
// oui : l'application est deja en cours d'execution
|
||||||
@@ -44,7 +48,7 @@ QETSingleApplication::QETSingleApplication(int &argc, char **argv, const QString
|
|||||||
qDebug() << "QETSingleApplication::QETSingleApplication() : Impossible de cr\351er l'instance unique" << qPrintable(unique_key_);
|
qDebug() << "QETSingleApplication::QETSingleApplication() : Impossible de cr\351er l'instance unique" << qPrintable(unique_key_);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
// initialisation d'un serveur local pour recevoir les messages des autres instances
|
// initialisation d'un serveur local pour recevoir les messages des autres instances
|
||||||
local_server_ = new QLocalServer(this);
|
local_server_ = new QLocalServer(this);
|
||||||
connect(local_server_, SIGNAL(newConnection()), this, SLOT(receiveMessage()));
|
connect(local_server_, SIGNAL(newConnection()), this, SLOT(receiveMessage()));
|
||||||
|
|||||||
@@ -49,7 +49,11 @@ class QETSingleApplication : public QApplication {
|
|||||||
private:
|
private:
|
||||||
bool is_running_;
|
bool is_running_;
|
||||||
QString unique_key_;
|
QString unique_key_;
|
||||||
|
#if defined (Q_OS_OS2)
|
||||||
|
#define QT_NO_SHAREDMEMORY
|
||||||
|
#else
|
||||||
QSharedMemory shared_memory_;
|
QSharedMemory shared_memory_;
|
||||||
|
#endif
|
||||||
QLocalServer *local_server_;
|
QLocalServer *local_server_;
|
||||||
static const int timeout_;
|
static const int timeout_;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user