[qtsingleapplication/f13/master] * Wed Aug 11 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> 2.6.1-4 - Make the additional API
Orcan Ogetbil
oget at fedoraproject.org
Thu Aug 12 03:12:49 UTC 2010
commit 9e25003ad6be65263608dda3961abac94f7c8fa6
Author: Orcan Ogetbil <oget.fedora at gmail.com>
Date: Wed Aug 11 23:12:49 2010 -0400
* Wed Aug 11 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> 2.6.1-4
- Make the additional API patch backwards compatible
qtsingleapplication-add-api.patch | 63 +++++++++++++++++++++++++-----------
qtsingleapplication.spec | 5 ++-
2 files changed, 48 insertions(+), 20 deletions(-)
---
diff --git a/qtsingleapplication-add-api.patch b/qtsingleapplication-add-api.patch
index 069215b..30627f7 100644
--- a/qtsingleapplication-add-api.patch
+++ b/qtsingleapplication-add-api.patch
@@ -1,6 +1,6 @@
diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtlocalpeer.cpp qtsingleapplication-2.6_1-opensource/src/qtlocalpeer.cpp
--- qtsingleapplication-2.6_1-opensource.old/src/qtlocalpeer.cpp 2009-12-16 05:43:33.000000000 -0500
-+++ qtsingleapplication-2.6_1-opensource/src/qtlocalpeer.cpp 2010-07-16 21:52:15.000000000 -0400
++++ qtsingleapplication-2.6_1-opensource/src/qtlocalpeer.cpp 2010-08-09 20:10:25.000000000 -0400
@@ -48,6 +48,7 @@
#include "qtlocalpeer.h"
#include <QtCore/QCoreApplication>
@@ -9,19 +9,24 @@ diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtlocalpeer.cpp qtsingle
#if defined(Q_OS_WIN)
#include <QtCore/QLibrary>
-@@ -138,6 +139,11 @@ bool QtLocalPeer::isClient()
+@@ -138,6 +139,16 @@ bool QtLocalPeer::isClient()
bool QtLocalPeer::sendMessage(const QString &message, int timeout)
{
+ return sendMessage(message.toUtf8(), timeout);
+}
+
++bool QtLocalPeer::sendMessage(const char* message, int timeout)
++{
++ return sendMessage(QByteArray(message), timeout);
++}
++
+bool QtLocalPeer::sendMessage(const QByteArray &message, int timeout)
+{
if (!isClient())
return false;
-@@ -160,9 +166,8 @@ bool QtLocalPeer::sendMessage(const QStr
+@@ -160,9 +171,8 @@ bool QtLocalPeer::sendMessage(const QStr
if (!connOk)
return false;
@@ -32,7 +37,7 @@ diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtlocalpeer.cpp qtsingle
bool res = socket.waitForBytesWritten(timeout);
res &= socket.waitForReadyRead(timeout); // wait for ack
res &= (socket.read(qstrlen(ack)) == ack);
-@@ -195,9 +200,9 @@ void QtLocalPeer::receiveConnection()
+@@ -195,9 +205,9 @@ void QtLocalPeer::receiveConnection()
delete socket;
return;
}
@@ -46,24 +51,26 @@ diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtlocalpeer.cpp qtsingle
}
diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtlocalpeer.h qtsingleapplication-2.6_1-opensource/src/qtlocalpeer.h
--- qtsingleapplication-2.6_1-opensource.old/src/qtlocalpeer.h 2009-12-16 05:43:33.000000000 -0500
-+++ qtsingleapplication-2.6_1-opensource/src/qtlocalpeer.h 2010-07-16 21:52:15.000000000 -0400
-@@ -61,11 +61,13 @@ public:
++++ qtsingleapplication-2.6_1-opensource/src/qtlocalpeer.h 2010-08-09 20:10:44.000000000 -0400
+@@ -61,11 +61,15 @@ public:
QtLocalPeer(QObject *parent = 0, const QString &appId = QString());
bool isClient();
bool sendMessage(const QString &message, int timeout);
+ bool sendMessage(const QByteArray &message, int timeout);
++ bool sendMessage(const char* message, int timeout);
QString applicationId() const
{ return id; }
Q_SIGNALS:
void messageReceived(const QString &message);
+ void messageReceived(const QByteArray &message);
++ void messageReceived(const char* message);
protected Q_SLOTS:
void receiveConnection();
diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtlockedfile_win.cpp qtsingleapplication-2.6_1-opensource/src/qtlockedfile_win.cpp
--- qtsingleapplication-2.6_1-opensource.old/src/qtlockedfile_win.cpp 2009-12-16 05:43:33.000000000 -0500
-+++ qtsingleapplication-2.6_1-opensource/src/qtlockedfile_win.cpp 2010-07-16 21:52:15.000000000 -0400
++++ qtsingleapplication-2.6_1-opensource/src/qtlockedfile_win.cpp 2010-08-09 14:21:42.000000000 -0400
@@ -65,7 +65,7 @@ Qt::HANDLE QtLockedFile::getMutexHandle(
Qt::HANDLE mutex;
@@ -84,16 +91,17 @@ diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtlockedfile_win.cpp qts
if (GetLastError() != ERROR_FILE_NOT_FOUND)
diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtsingleapplication.cpp qtsingleapplication-2.6_1-opensource/src/qtsingleapplication.cpp
--- qtsingleapplication-2.6_1-opensource.old/src/qtsingleapplication.cpp 2009-12-16 05:43:33.000000000 -0500
-+++ qtsingleapplication-2.6_1-opensource/src/qtsingleapplication.cpp 2010-07-16 21:52:15.000000000 -0400
-@@ -144,6 +144,7 @@ void QtSingleApplication::sysInit(const
++++ qtsingleapplication-2.6_1-opensource/src/qtsingleapplication.cpp 2010-08-09 20:11:56.000000000 -0400
+@@ -144,6 +144,8 @@ void QtSingleApplication::sysInit(const
actWin = 0;
peer = new QtLocalPeer(this, appId);
connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
+ connect(peer, SIGNAL(messageReceived(const QByteArray&)), SIGNAL(messageReceived(const QByteArray&)));
++ connect(peer, SIGNAL(messageReceived(const char*)), SIGNAL(messageReceived(const char*)));
}
-@@ -265,6 +266,11 @@ bool QtSingleApplication::sendMessage(co
+@@ -265,6 +267,16 @@ bool QtSingleApplication::sendMessage(co
return peer->sendMessage(message, timeout);
}
@@ -102,10 +110,15 @@ diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtsingleapplication.cpp
+ return peer->sendMessage(message, timeout);
+}
+
++bool QtSingleApplication::sendMessage(const char* message, int timeout)
++{
++ return peer->sendMessage(message, timeout);
++}
++
/*!
Returns the application identifier. Two processes with the same
-@@ -291,10 +297,14 @@ QString QtSingleApplication::id() const
+@@ -291,10 +303,16 @@ QString QtSingleApplication::id() const
void QtSingleApplication::setActivationWindow(QWidget* aw, bool activateOnMessage)
{
actWin = aw;
@@ -114,51 +127,57 @@ diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtsingleapplication.cpp
connect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow()));
- else
+ connect(peer, SIGNAL(messageReceived(const QByteArray&)), this, SLOT(activateWindow()));
++ connect(peer, SIGNAL(messageReceived(const char*)), this, SLOT(activateWindow()));
+ }
+ else {
disconnect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow()));
+ disconnect(peer, SIGNAL(messageReceived(const QByteArray&)), this, SLOT(activateWindow()));
++ disconnect(peer, SIGNAL(messageReceived(const char*)), this, SLOT(activateWindow()));
+ }
}
diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtsingleapplication.h qtsingleapplication-2.6_1-opensource/src/qtsingleapplication.h
--- qtsingleapplication-2.6_1-opensource.old/src/qtsingleapplication.h 2009-12-16 05:43:33.000000000 -0500
-+++ qtsingleapplication-2.6_1-opensource/src/qtsingleapplication.h 2010-07-16 21:52:15.000000000 -0400
-@@ -91,11 +91,13 @@ public:
++++ qtsingleapplication-2.6_1-opensource/src/qtsingleapplication.h 2010-08-09 20:11:04.000000000 -0400
+@@ -91,11 +91,15 @@ public:
public Q_SLOTS:
bool sendMessage(const QString &message, int timeout = 5000);
+ bool sendMessage(const QByteArray &message, int timeout = 5000);
++ bool sendMessage(const char* message, int timeout = 5000);
void activateWindow();
Q_SIGNALS:
void messageReceived(const QString &message);
+ void messageReceived(const QByteArray &message);
++ void messageReceived(const char* message);
private:
diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtsinglecoreapplication.cpp qtsingleapplication-2.6_1-opensource/src/qtsinglecoreapplication.cpp
--- qtsingleapplication-2.6_1-opensource.old/src/qtsinglecoreapplication.cpp 2009-12-16 05:43:33.000000000 -0500
-+++ qtsingleapplication-2.6_1-opensource/src/qtsinglecoreapplication.cpp 2010-07-16 21:52:15.000000000 -0400
-@@ -81,6 +81,7 @@ QtSingleCoreApplication::QtSingleCoreApp
++++ qtsingleapplication-2.6_1-opensource/src/qtsinglecoreapplication.cpp 2010-08-09 20:12:45.000000000 -0400
+@@ -81,6 +81,8 @@ QtSingleCoreApplication::QtSingleCoreApp
{
peer = new QtLocalPeer(this);
connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
+ connect(peer, SIGNAL(messageReceived(const QByteArray&)), SIGNAL(messageReceived(const QByteArray&)));
++ connect(peer, SIGNAL(messageReceived(const char*)), SIGNAL(messageReceived(const char*)));
}
-@@ -94,6 +95,7 @@ QtSingleCoreApplication::QtSingleCoreApp
+@@ -94,6 +96,8 @@ QtSingleCoreApplication::QtSingleCoreApp
{
peer = new QtLocalPeer(this, appId);
connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
+ connect(peer, SIGNAL(messageReceived(const QByteArray&)), SIGNAL(messageReceived(const QByteArray&)));
++ connect(peer, SIGNAL(messageReceived(const char*)), SIGNAL(messageReceived(const char*)));
}
-@@ -133,6 +135,11 @@ bool QtSingleCoreApplication::sendMessag
+@@ -133,6 +137,15 @@ bool QtSingleCoreApplication::sendMessag
return peer->sendMessage(message, timeout);
}
@@ -167,22 +186,28 @@ diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtsinglecoreapplication.
+ return peer->sendMessage(message, timeout);
+}
+
++bool QtSingleCoreApplication::sendMessage(const char* message, int timeout)
++{
++ return peer->sendMessage(message, timeout);
++}
/*!
Returns the application identifier. Two processes with the same
diff -rupN qtsingleapplication-2.6_1-opensource.old/src/qtsinglecoreapplication.h qtsingleapplication-2.6_1-opensource/src/qtsinglecoreapplication.h
--- qtsingleapplication-2.6_1-opensource.old/src/qtsinglecoreapplication.h 2009-12-16 05:43:33.000000000 -0500
-+++ qtsingleapplication-2.6_1-opensource/src/qtsinglecoreapplication.h 2010-07-16 21:52:15.000000000 -0400
-@@ -62,10 +62,12 @@ public:
++++ qtsingleapplication-2.6_1-opensource/src/qtsinglecoreapplication.h 2010-08-09 20:12:24.000000000 -0400
+@@ -62,10 +62,14 @@ public:
public Q_SLOTS:
bool sendMessage(const QString &message, int timeout = 5000);
+ bool sendMessage(const QByteArray &message, int timeout = 5000);
++ bool sendMessage(const char* message, int timeout = 5000);
Q_SIGNALS:
void messageReceived(const QString &message);
+ void messageReceived(const QByteArray &message);
++ void messageReceived(const char* message);
private:
diff --git a/qtsingleapplication.spec b/qtsingleapplication.spec
index 696041e..072dce1 100644
--- a/qtsingleapplication.spec
+++ b/qtsingleapplication.spec
@@ -4,7 +4,7 @@
Summary: Qt library to start applications only once per user
Name: qtsingleapplication
Version: 2.6.1
-Release: 3%{?dist}
+Release: 4%{?dist}
Group: System Environment/Libraries
License: GPLv3 or LGPLv2 with exceptions
URL: http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Utilities/qtsingleapplication
@@ -149,6 +149,9 @@ rm -rf $RPM_BUILD_ROOT
%{_qt4_datadir}/mkspecs/features/qtsinglecoreapplication.prf
%changelog
+* Wed Aug 11 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> 2.6.1-4
+- Make the additional API patch backwards compatible
+
* Wed Jul 21 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> 2.6.1-3
- Split the qtsinglecoreapplication bits into their own subpackages
More information about the scm-commits
mailing list