[qet] [3581] Fix FTBS on OS2, thank Elbert for tests

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 3581
Author:   scorpio810
Date:     2014-12-31 13:04:54 +0100 (Wed, 31 Dec 2014)
Log Message:
-----------
Fix FTBS on OS2, thank Elbert for tests

Modified Paths:
--------------
    trunk/sources/qetsingleapplication.cpp
    trunk/sources/qetsingleapplication.h

Modified: trunk/sources/qetsingleapplication.cpp
===================================================================
--- trunk/sources/qetsingleapplication.cpp	2014-12-29 23:18:00 UTC (rev 3580)
+++ trunk/sources/qetsingleapplication.cpp	2014-12-31 12:04:54 UTC (rev 3581)
@@ -31,6 +31,10 @@
 	unique_key_(unique_key)
 {
 	// 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_);
 	if (shared_memory_.attach()) {
 		// oui : l'application est deja en cours d'execution
@@ -44,7 +48,7 @@
 			qDebug() << "QETSingleApplication::QETSingleApplication() : Impossible de cr\351er l'instance unique" << qPrintable(unique_key_);
 			return;
 		}
-		
+#endif
 		// initialisation d'un serveur local pour recevoir les messages des autres instances
 		local_server_ = new QLocalServer(this);
 		connect(local_server_, SIGNAL(newConnection()), this, SLOT(receiveMessage()));

Modified: trunk/sources/qetsingleapplication.h
===================================================================
--- trunk/sources/qetsingleapplication.h	2014-12-29 23:18:00 UTC (rev 3580)
+++ trunk/sources/qetsingleapplication.h	2014-12-31 12:04:54 UTC (rev 3581)
@@ -49,7 +49,11 @@
 	private:
 	bool is_running_;
 	QString unique_key_;
+	#if defined (Q_OS_OS2)
+	#define QT_NO_SHAREDMEMORY
+	#else
 	QSharedMemory shared_memory_;
+	#endif
 	QLocalServer *local_server_;
 	static const int timeout_;
 };


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/