summaryrefslogtreecommitdiff
path: root/kde-unstable/kactivities
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-11-25 23:14:55 +0000
committerroot <root@rshg054.dnsready.net>2011-11-25 23:14:55 +0000
commit6a642c093f29814cdd0fdefeee3ab9400eae490f (patch)
treef2edeb17bda6dbc9e784455f1b38f3fcc7e5b64a /kde-unstable/kactivities
parent5894dd675f4bd3ba296d262fae99b3b87a0f87fd (diff)
Fri Nov 25 23:14:55 UTC 2011
Diffstat (limited to 'kde-unstable/kactivities')
-rw-r--r--kde-unstable/kactivities/PKGBUILD34
-rw-r--r--kde-unstable/kactivities/fix-activities.patch156
2 files changed, 190 insertions, 0 deletions
diff --git a/kde-unstable/kactivities/PKGBUILD b/kde-unstable/kactivities/PKGBUILD
new file mode 100644
index 000000000..e60a143e9
--- /dev/null
+++ b/kde-unstable/kactivities/PKGBUILD
@@ -0,0 +1,34 @@
+# $Id: PKGBUILD 143306 2011-11-24 16:13:52Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+
+pkgname=kactivities
+pkgver=4.7.80
+pkgrel=2
+arch=('i686' 'x86_64')
+pkgdesc='API for using and interacting with Activities'
+url='http://kde.org/'
+license=('GPL' 'FDL')
+depends=('kdelibs')
+makedepends=('cmake' 'automoc4')
+source=("http://download.kde.org/unstable/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2"
+ 'fix-activities.patch')
+sha1sums=('c619c5d6e3e2ef79d0cebf52bf18d1b467dc24f9'
+ '6eb890958726856cf4ddb172acd46ba08f7a5088')
+
+build() {
+ cd "${srcdir}"/${pkgname}-${pkgver}
+ patch -p1 -i "${srcdir}"/fix-activities.patch
+
+ cd "${srcdir}"
+ mkdir build
+ cd build
+ cmake ../${pkgname}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package() {
+ cd $srcdir/build
+ make DESTDIR=$pkgdir install
+}
diff --git a/kde-unstable/kactivities/fix-activities.patch b/kde-unstable/kactivities/fix-activities.patch
new file mode 100644
index 000000000..5cf62c48c
--- /dev/null
+++ b/kde-unstable/kactivities/fix-activities.patch
@@ -0,0 +1,156 @@
+--- kactivities-4.7.80/service/ActivityManager.cpp~ 2011-11-24 16:05:52.777981854 +0000
++++ kactivities-4.7.80/service/ActivityManager.cpp 2011-11-24 16:06:32.721637122 +0000
+@@ -75,14 +75,14 @@
+ QHash < WId, SharedInfo::WindowData > & _windows,
+ QHash < KUrl, SharedInfo::ResourceData > & _resources
+ )
+- : haveSessions(false),
+- config("activitymanagerrc"),
+- windows(_windows),
+- resources(_resources),
++ : config("activitymanagerrc"),
++ windows(_windows),
++ resources(_resources),
+ #ifdef HAVE_NEPOMUK
+- m_nepomukInitCalled(false),
++ m_nepomukInitCalled(false),
+ #endif
+- q(parent)
++ q(parent),
++ ksmserverInterface(0)
+ {
+ // Initializing config
+ connect(&configSyncTimer, SIGNAL(timeout()),
+@@ -116,20 +116,26 @@
+ this, SLOT(activeWindowChanged(WId)));
+
+ //listen to ksmserver for starting/stopping
++ QDBusServiceWatcher *watcher = new QDBusServiceWatcher("org.kde.ksmserver",
++ QDBusConnection::sessionBus(),
++ QDBusServiceWatcher::WatchForRegistration);
++ connect(watcher, SIGNAL(serviceRegistered(QString)), this, SLOT(sessionServiceRegistered()));
++ sessionServiceRegistered();
++}
++
++void ActivityManagerPrivate::sessionServiceRegistered()
++{
++ delete ksmserverInterface;
+ ksmserverInterface = new QDBusInterface("org.kde.ksmserver", "/KSMServer", "org.kde.KSMServerInterface");
+ if (ksmserverInterface->isValid()) {
+ ksmserverInterface->setParent(this);
+ connect(ksmserverInterface, SIGNAL(subSessionOpened()), this, SLOT(startCompleted()));
+ connect(ksmserverInterface, SIGNAL(subSessionClosed()), this, SLOT(stopCompleted()));
+ connect(ksmserverInterface, SIGNAL(subSessionCloseCanceled()), this, SLOT(stopCancelled())); //spelling fail :)
+- haveSessions = true;
+ } else {
+- kDebug() << "couldn't connect to ksmserver! session stuff won't work";
+- //note: in theory it's nice to try again later
+- //but in practice, ksmserver is either there or it isn't (killing it logs you out)
+- //so in this case there's no point. :)
+- ksmserverInterface->deleteLater();
++ delete ksmserverInterface;
+ ksmserverInterface = 0;
++ kDebug() << "couldn't connect to ksmserver! session stuff won't work";
+ }
+ }
+
+@@ -519,26 +525,24 @@
+ {
+ bool called = false;
+ // start the starting :)
+- if (haveSessions) {
+- QDBusInterface kwin("org.kde.kwin", "/KWin", "org.kde.KWin");
+- if (kwin.isValid()) {
+- QDBusMessage reply = kwin.call("startActivity", id);
+- if (reply.type() == QDBusMessage::ErrorMessage) {
+- kDebug() << "dbus error:" << reply.errorMessage();
++ QDBusInterface kwin("org.kde.kwin", "/KWin", "org.kde.KWin");
++ if (kwin.isValid()) {
++ QDBusMessage reply = kwin.call("startActivity", id);
++ if (reply.type() == QDBusMessage::ErrorMessage) {
++ kDebug() << "dbus error:" << reply.errorMessage();
++ } else {
++ QList<QVariant> ret = reply.arguments();
++ if (ret.length() == 1 && ret.first().toBool()) {
++ called = true;
+ } else {
+- QList<QVariant> ret = reply.arguments();
+- if (ret.length() == 1 && ret.first().toBool()) {
+- called = true;
+- } else {
+- kDebug() << "call returned false; probably ksmserver is busy";
+- setActivityState(transitioningActivity, ActivityManager::Stopped);
+- transitioningActivity.clear();
+- return; //assume we're mid-logout and just don't touch anything
+- }
++ kDebug() << "call returned false; probably ksmserver is busy";
++ setActivityState(transitioningActivity, ActivityManager::Stopped);
++ transitioningActivity.clear();
++ return; //assume we're mid-logout and just don't touch anything
+ }
+- } else {
+- kDebug() << "couldn't get kwin interface";
+ }
++ } else {
++ kDebug() << "couldn't get kwin interface";
+ }
+
+ if (!called) {
+@@ -585,25 +589,23 @@
+ {
+ bool called = false;
+ // start the stopping :)
+- if (haveSessions) {
+- QDBusInterface kwin("org.kde.kwin", "/KWin", "org.kde.KWin");
+- if (kwin.isValid()) {
+- QDBusMessage reply = kwin.call("stopActivity", id);
+- if (reply.type() == QDBusMessage::ErrorMessage) {
+- kDebug() << "dbus error:" << reply.errorMessage();
++ QDBusInterface kwin("org.kde.kwin", "/KWin", "org.kde.KWin");
++ if (kwin.isValid()) {
++ QDBusMessage reply = kwin.call("stopActivity", id);
++ if (reply.type() == QDBusMessage::ErrorMessage) {
++ kDebug() << "dbus error:" << reply.errorMessage();
++ } else {
++ QList<QVariant> ret = reply.arguments();
++ if (ret.length() == 1 && ret.first().toBool()) {
++ called = true;
+ } else {
+- QList<QVariant> ret = reply.arguments();
+- if (ret.length() == 1 && ret.first().toBool()) {
+- called = true;
+- } else {
+- kDebug() << "call returned false; probably ksmserver is busy";
+- stopCancelled();
+- return; //assume we're mid-logout and just don't touch anything
+- }
++ kDebug() << "call returned false; probably ksmserver is busy";
++ stopCancelled();
++ return; //assume we're mid-logout and just don't touch anything
+ }
+- } else {
+- kDebug() << "couldn't get kwin interface";
+ }
++ } else {
++ kDebug() << "couldn't get kwin interface";
+ }
+
+ if (!called) {
+--- kactivities-4.7.80/service/ActivityManager_p.h~ 2011-11-24 16:06:01.618054620 +0000
++++ kactivities-4.7.80/service/ActivityManager_p.h 2011-11-24 16:06:32.721637122 +0000
+@@ -68,7 +68,6 @@
+
+ //opening/closing activity (ksmserver can only handle one at a time)
+ QString transitioningActivity;
+- bool haveSessions; //whether ksmserver's available
+
+ // Configuration
+ QTimer configSyncTimer;
+@@ -106,6 +105,7 @@
+
+ void backstoreAvailable();
+ void syncActivitiesWithNepomuk();
++ void sessionServiceRegistered();
+
+ private:
+ ActivityManager * const q;