[arch-commits] Commit in bluedevil/repos (10 files)
Andrea Scarpino
andrea at archlinux.org
Sun Dec 14 16:32:40 UTC 2014
Date: Sunday, December 14, 2014 @ 17:32:40
Author: andrea
Revision: 227609
archrelease: copy trunk to extra-i686, extra-x86_64
Added:
bluedevil/repos/extra-i686/KDEBUG-337193.patch
(from rev 227608, bluedevil/trunk/KDEBUG-337193.patch)
bluedevil/repos/extra-i686/PKGBUILD
(from rev 227608, bluedevil/trunk/PKGBUILD)
bluedevil/repos/extra-i686/bluedevil.install
(from rev 227608, bluedevil/trunk/bluedevil.install)
bluedevil/repos/extra-x86_64/KDEBUG-337193.patch
(from rev 227608, bluedevil/trunk/KDEBUG-337193.patch)
bluedevil/repos/extra-x86_64/PKGBUILD
(from rev 227608, bluedevil/trunk/PKGBUILD)
bluedevil/repos/extra-x86_64/bluedevil.install
(from rev 227608, bluedevil/trunk/bluedevil.install)
Deleted:
bluedevil/repos/extra-i686/PKGBUILD
bluedevil/repos/extra-i686/bluedevil.install
bluedevil/repos/extra-x86_64/PKGBUILD
bluedevil/repos/extra-x86_64/bluedevil.install
----------------------------------+
/PKGBUILD | 78 +++++++++++++++++++
/bluedevil.install | 24 +++++
extra-i686/KDEBUG-337193.patch | 151 +++++++++++++++++++++++++++++++++++++
extra-i686/PKGBUILD | 34 --------
extra-i686/bluedevil.install | 12 --
extra-x86_64/KDEBUG-337193.patch | 151 +++++++++++++++++++++++++++++++++++++
extra-x86_64/PKGBUILD | 34 --------
extra-x86_64/bluedevil.install | 12 --
8 files changed, 404 insertions(+), 92 deletions(-)
Copied: bluedevil/repos/extra-i686/KDEBUG-337193.patch (from rev 227608, bluedevil/trunk/KDEBUG-337193.patch)
===================================================================
--- extra-i686/KDEBUG-337193.patch (rev 0)
+++ extra-i686/KDEBUG-337193.patch 2014-12-14 16:32:40 UTC (rev 227609)
@@ -0,0 +1,151 @@
+From: David Rosca <nowrep at gmail.com>
+Date: Sat, 13 Dec 2014 12:20:24 +0000
+Subject: Bluedevil daemon: Save and restore adapters state
+X-Git-Url: http://quickgit.kde.org/?p=bluedevil.git&a=commitdiff&h=ff6ae6022286e118e98efd69ba1833f2be2e4842
+---
+Bluedevil daemon: Save and restore adapters state
+
+Fixes issue that some adapters were always powered off
+on startup.
+
+BUG: 337193
+---
+
+
+--- a/src/daemon/kded/BlueDevilDaemon.cpp
++++ b/src/daemon/kded/BlueDevilDaemon.cpp
+@@ -36,6 +36,7 @@
+ #include <KPluginFactory>
+ #include <kfileplacesmodel.h>
+ #include <kdirnotify.h>
++#include <ksharedconfig.h>
+
+ #include <bluedevil/bluedevilmanager.h>
+ #include <bluedevil/bluedeviladapter.h>
+@@ -66,6 +67,7 @@
+ QTimer m_timer;
+ KComponentData m_componentData;
+ QHash<QString, bool> m_adapterPoweredHash;
++ KSharedConfig::Ptr m_config;
+ };
+
+ BlueDevilDaemon::BlueDevilDaemon(QObject *parent, const QList<QVariant>&)
+@@ -83,6 +85,7 @@
+ , QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForUnregistration, this);
+ d->m_timer.setInterval(20000);
+ d->m_timer.setSingleShot(true);
++ d->m_config = KSharedConfig::openConfig("bluedevilglobalrc");
+
+ KAboutData aboutData(
+ "bluedevildaemon",
+@@ -106,6 +109,8 @@
+
+ connect(Manager::self(), SIGNAL(usableAdapterChanged(Adapter*)),
+ this, SLOT(usableAdapterChanged(Adapter*)));
++ connect(Manager::self(), SIGNAL(adapterAdded(Adapter*)),
++ this, SLOT(adapterAdded(Adapter*)));
+
+ // Catch suspend/resume events
+ QDBusConnection::systemBus().connect("org.freedesktop.login1",
+@@ -117,6 +122,8 @@
+ );
+
+ d->m_status = Private::Offline;
++
++ restoreAdaptersState();
+ usableAdapterChanged(Manager::self()->usableAdapter());
+
+ if (!Manager::self()->adapters().isEmpty()) {
+@@ -126,6 +133,8 @@
+
+ BlueDevilDaemon::~BlueDevilDaemon()
+ {
++ saveAdaptersState();
++
+ if (d->m_status == Private::Online) {
+ offlineMode();
+ }
+@@ -344,6 +353,11 @@
+ }
+ }
+
++void BlueDevilDaemon::adapterAdded(Adapter *adapter)
++{
++ restoreAdapterState(adapter);
++}
++
+ void BlueDevilDaemon::deviceFound(Device *device)
+ {
+ kDebug(dblue()) << "DeviceFound: " << device->name();
+@@ -359,6 +373,47 @@
+ qDebug() << "Error response: " << reply.error().message();
+ killMonolithic();
+ }
++}
++
++void BlueDevilDaemon::saveAdaptersState()
++{
++ Manager *manager = Manager::self();
++ if (!manager) {
++ return;
++ }
++
++ KConfigGroup adaptersGroup = d->m_config->group("Adapters");
++
++ Q_FOREACH (Adapter *adapter, manager->adapters()) {
++ const QString key = QString("%1_powered").arg(adapter->address());
++ adaptersGroup.writeEntry<bool>(key, adapter->isPowered());
++ }
++
++ d->m_config->sync();
++}
++
++// New adapters are automatically powered on
++void BlueDevilDaemon::restoreAdaptersState()
++{
++ Manager *manager = Manager::self();
++ if (!manager) {
++ return;
++ }
++
++ KConfigGroup adaptersGroup = d->m_config->group("Adapters");
++
++ Q_FOREACH (Adapter *adapter, manager->adapters()) {
++ const QString key = QString("%1_powered").arg(adapter->address());
++ adapter->setPowered(adaptersGroup.readEntry<bool>(key, true));
++ }
++}
++
++void BlueDevilDaemon::restoreAdapterState(Adapter *adapter)
++{
++ KConfigGroup adaptersGroup = d->m_config->group("Adapters");
++
++ const QString key = QString("%1_powered").arg(adapter->address());
++ adapter->setPowered(adaptersGroup.readEntry<bool>(key, true));
+ }
+
+ DeviceInfo BlueDevilDaemon::deviceToInfo(Device *const device) const
+
+--- a/src/daemon/kded/BlueDevilDaemon.h
++++ b/src/daemon/kded/BlueDevilDaemon.h
+@@ -82,6 +82,8 @@
+ */
+ void usableAdapterChanged(Adapter *adapter);
+
++ void adapterAdded(Adapter *adapter);
++
+ /**
+ * When the agent is released this is called to unload it
+ */
+@@ -97,6 +99,10 @@
+ void executeMonolithic();
+ void killMonolithic();
+
++ void saveAdaptersState();
++ void restoreAdaptersState();
++ void restoreAdapterState(Adapter *adapter);
++
+ DeviceInfo deviceToInfo (Device *const device) const;
+
+ private:
+
Deleted: extra-i686/PKGBUILD
===================================================================
--- extra-i686/PKGBUILD 2014-12-14 16:32:29 UTC (rev 227608)
+++ extra-i686/PKGBUILD 2014-12-14 16:32:40 UTC (rev 227609)
@@ -1,34 +0,0 @@
-# $Id$
-# Maintainer: Andrea Scarpino <andrea at archlinux.org>
-
-pkgname=bluedevil
-pkgver=2.0
-pkgrel=1
-epoch=1
-pkgdesc='KDE bluetooth framework'
-arch=('i686' 'x86_64')
-url="https://projects.kde.org/projects/extragear/base/bluedevil"
-license=('GPL')
-depends=('kdebase-runtime' 'libbluedevil')
-makedepends=('cmake' 'automoc4')
-optdepends=('kdebase-workspace: to run the plasmoid')
-install="${pkgname}.install"
-source=("http://download.kde.org/stable/${pkgname}/${pkgver}/src/${pkgname}-${pkgver}.tar.xz")
-md5sums=('c318b94d6de3d516598208e32cbccad6')
-
-prepare() {
- mkdir build
-}
-
-build(){
- cd build
- cmake ../${pkgname}-${pkgver} \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_INSTALL_PREFIX=/usr
- make
-}
-
-package() {
- cd build
- make DESTDIR="${pkgdir}" install
-}
Copied: bluedevil/repos/extra-i686/PKGBUILD (from rev 227608, bluedevil/trunk/PKGBUILD)
===================================================================
--- extra-i686/PKGBUILD (rev 0)
+++ extra-i686/PKGBUILD 2014-12-14 16:32:40 UTC (rev 227609)
@@ -0,0 +1,39 @@
+# $Id$
+# Maintainer: Andrea Scarpino <andrea at archlinux.org>
+
+pkgname=bluedevil
+pkgver=2.0
+pkgrel=2
+epoch=1
+pkgdesc='KDE bluetooth framework'
+arch=('i686' 'x86_64')
+url="https://projects.kde.org/projects/extragear/base/bluedevil"
+license=('GPL')
+depends=('kdebase-runtime' 'libbluedevil')
+makedepends=('cmake' 'automoc4')
+optdepends=('kdebase-workspace: to run the plasmoid')
+install="${pkgname}.install"
+source=("http://download.kde.org/stable/${pkgname}/${pkgver}/src/${pkgname}-${pkgver}.tar.xz"
+ 'KDEBUG-337193.patch')
+md5sums=('c318b94d6de3d516598208e32cbccad6'
+ '9b89d5741c951b3d940faa4cfda0a738')
+
+prepare() {
+ mkdir build
+
+ cd ${pkgname}-${pkgver}
+ patch -p1 -i "${srcdir}"/KDEBUG-337193.patch
+}
+
+build(){
+ cd build
+ cmake ../${pkgname}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package() {
+ cd build
+ make DESTDIR="${pkgdir}" install
+}
Deleted: extra-i686/bluedevil.install
===================================================================
--- extra-i686/bluedevil.install 2014-12-14 16:32:29 UTC (rev 227608)
+++ extra-i686/bluedevil.install 2014-12-14 16:32:40 UTC (rev 227609)
@@ -1,12 +0,0 @@
-post_install() {
- update-mime-database usr/share/mime &> /dev/null
- update-desktop-database -q
-}
-
-post_upgrade() {
- post_install
-}
-
-post_remove() {
- post_install
-}
Copied: bluedevil/repos/extra-i686/bluedevil.install (from rev 227608, bluedevil/trunk/bluedevil.install)
===================================================================
--- extra-i686/bluedevil.install (rev 0)
+++ extra-i686/bluedevil.install 2014-12-14 16:32:40 UTC (rev 227609)
@@ -0,0 +1,12 @@
+post_install() {
+ update-mime-database usr/share/mime &> /dev/null
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
Copied: bluedevil/repos/extra-x86_64/KDEBUG-337193.patch (from rev 227608, bluedevil/trunk/KDEBUG-337193.patch)
===================================================================
--- extra-x86_64/KDEBUG-337193.patch (rev 0)
+++ extra-x86_64/KDEBUG-337193.patch 2014-12-14 16:32:40 UTC (rev 227609)
@@ -0,0 +1,151 @@
+From: David Rosca <nowrep at gmail.com>
+Date: Sat, 13 Dec 2014 12:20:24 +0000
+Subject: Bluedevil daemon: Save and restore adapters state
+X-Git-Url: http://quickgit.kde.org/?p=bluedevil.git&a=commitdiff&h=ff6ae6022286e118e98efd69ba1833f2be2e4842
+---
+Bluedevil daemon: Save and restore adapters state
+
+Fixes issue that some adapters were always powered off
+on startup.
+
+BUG: 337193
+---
+
+
+--- a/src/daemon/kded/BlueDevilDaemon.cpp
++++ b/src/daemon/kded/BlueDevilDaemon.cpp
+@@ -36,6 +36,7 @@
+ #include <KPluginFactory>
+ #include <kfileplacesmodel.h>
+ #include <kdirnotify.h>
++#include <ksharedconfig.h>
+
+ #include <bluedevil/bluedevilmanager.h>
+ #include <bluedevil/bluedeviladapter.h>
+@@ -66,6 +67,7 @@
+ QTimer m_timer;
+ KComponentData m_componentData;
+ QHash<QString, bool> m_adapterPoweredHash;
++ KSharedConfig::Ptr m_config;
+ };
+
+ BlueDevilDaemon::BlueDevilDaemon(QObject *parent, const QList<QVariant>&)
+@@ -83,6 +85,7 @@
+ , QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForUnregistration, this);
+ d->m_timer.setInterval(20000);
+ d->m_timer.setSingleShot(true);
++ d->m_config = KSharedConfig::openConfig("bluedevilglobalrc");
+
+ KAboutData aboutData(
+ "bluedevildaemon",
+@@ -106,6 +109,8 @@
+
+ connect(Manager::self(), SIGNAL(usableAdapterChanged(Adapter*)),
+ this, SLOT(usableAdapterChanged(Adapter*)));
++ connect(Manager::self(), SIGNAL(adapterAdded(Adapter*)),
++ this, SLOT(adapterAdded(Adapter*)));
+
+ // Catch suspend/resume events
+ QDBusConnection::systemBus().connect("org.freedesktop.login1",
+@@ -117,6 +122,8 @@
+ );
+
+ d->m_status = Private::Offline;
++
++ restoreAdaptersState();
+ usableAdapterChanged(Manager::self()->usableAdapter());
+
+ if (!Manager::self()->adapters().isEmpty()) {
+@@ -126,6 +133,8 @@
+
+ BlueDevilDaemon::~BlueDevilDaemon()
+ {
++ saveAdaptersState();
++
+ if (d->m_status == Private::Online) {
+ offlineMode();
+ }
+@@ -344,6 +353,11 @@
+ }
+ }
+
++void BlueDevilDaemon::adapterAdded(Adapter *adapter)
++{
++ restoreAdapterState(adapter);
++}
++
+ void BlueDevilDaemon::deviceFound(Device *device)
+ {
+ kDebug(dblue()) << "DeviceFound: " << device->name();
+@@ -359,6 +373,47 @@
+ qDebug() << "Error response: " << reply.error().message();
+ killMonolithic();
+ }
++}
++
++void BlueDevilDaemon::saveAdaptersState()
++{
++ Manager *manager = Manager::self();
++ if (!manager) {
++ return;
++ }
++
++ KConfigGroup adaptersGroup = d->m_config->group("Adapters");
++
++ Q_FOREACH (Adapter *adapter, manager->adapters()) {
++ const QString key = QString("%1_powered").arg(adapter->address());
++ adaptersGroup.writeEntry<bool>(key, adapter->isPowered());
++ }
++
++ d->m_config->sync();
++}
++
++// New adapters are automatically powered on
++void BlueDevilDaemon::restoreAdaptersState()
++{
++ Manager *manager = Manager::self();
++ if (!manager) {
++ return;
++ }
++
++ KConfigGroup adaptersGroup = d->m_config->group("Adapters");
++
++ Q_FOREACH (Adapter *adapter, manager->adapters()) {
++ const QString key = QString("%1_powered").arg(adapter->address());
++ adapter->setPowered(adaptersGroup.readEntry<bool>(key, true));
++ }
++}
++
++void BlueDevilDaemon::restoreAdapterState(Adapter *adapter)
++{
++ KConfigGroup adaptersGroup = d->m_config->group("Adapters");
++
++ const QString key = QString("%1_powered").arg(adapter->address());
++ adapter->setPowered(adaptersGroup.readEntry<bool>(key, true));
+ }
+
+ DeviceInfo BlueDevilDaemon::deviceToInfo(Device *const device) const
+
+--- a/src/daemon/kded/BlueDevilDaemon.h
++++ b/src/daemon/kded/BlueDevilDaemon.h
+@@ -82,6 +82,8 @@
+ */
+ void usableAdapterChanged(Adapter *adapter);
+
++ void adapterAdded(Adapter *adapter);
++
+ /**
+ * When the agent is released this is called to unload it
+ */
+@@ -97,6 +99,10 @@
+ void executeMonolithic();
+ void killMonolithic();
+
++ void saveAdaptersState();
++ void restoreAdaptersState();
++ void restoreAdapterState(Adapter *adapter);
++
+ DeviceInfo deviceToInfo (Device *const device) const;
+
+ private:
+
Deleted: extra-x86_64/PKGBUILD
===================================================================
--- extra-x86_64/PKGBUILD 2014-12-14 16:32:29 UTC (rev 227608)
+++ extra-x86_64/PKGBUILD 2014-12-14 16:32:40 UTC (rev 227609)
@@ -1,34 +0,0 @@
-# $Id$
-# Maintainer: Andrea Scarpino <andrea at archlinux.org>
-
-pkgname=bluedevil
-pkgver=2.0
-pkgrel=1
-epoch=1
-pkgdesc='KDE bluetooth framework'
-arch=('i686' 'x86_64')
-url="https://projects.kde.org/projects/extragear/base/bluedevil"
-license=('GPL')
-depends=('kdebase-runtime' 'libbluedevil')
-makedepends=('cmake' 'automoc4')
-optdepends=('kdebase-workspace: to run the plasmoid')
-install="${pkgname}.install"
-source=("http://download.kde.org/stable/${pkgname}/${pkgver}/src/${pkgname}-${pkgver}.tar.xz")
-md5sums=('c318b94d6de3d516598208e32cbccad6')
-
-prepare() {
- mkdir build
-}
-
-build(){
- cd build
- cmake ../${pkgname}-${pkgver} \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_INSTALL_PREFIX=/usr
- make
-}
-
-package() {
- cd build
- make DESTDIR="${pkgdir}" install
-}
Copied: bluedevil/repos/extra-x86_64/PKGBUILD (from rev 227608, bluedevil/trunk/PKGBUILD)
===================================================================
--- extra-x86_64/PKGBUILD (rev 0)
+++ extra-x86_64/PKGBUILD 2014-12-14 16:32:40 UTC (rev 227609)
@@ -0,0 +1,39 @@
+# $Id$
+# Maintainer: Andrea Scarpino <andrea at archlinux.org>
+
+pkgname=bluedevil
+pkgver=2.0
+pkgrel=2
+epoch=1
+pkgdesc='KDE bluetooth framework'
+arch=('i686' 'x86_64')
+url="https://projects.kde.org/projects/extragear/base/bluedevil"
+license=('GPL')
+depends=('kdebase-runtime' 'libbluedevil')
+makedepends=('cmake' 'automoc4')
+optdepends=('kdebase-workspace: to run the plasmoid')
+install="${pkgname}.install"
+source=("http://download.kde.org/stable/${pkgname}/${pkgver}/src/${pkgname}-${pkgver}.tar.xz"
+ 'KDEBUG-337193.patch')
+md5sums=('c318b94d6de3d516598208e32cbccad6'
+ '9b89d5741c951b3d940faa4cfda0a738')
+
+prepare() {
+ mkdir build
+
+ cd ${pkgname}-${pkgver}
+ patch -p1 -i "${srcdir}"/KDEBUG-337193.patch
+}
+
+build(){
+ cd build
+ cmake ../${pkgname}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package() {
+ cd build
+ make DESTDIR="${pkgdir}" install
+}
Deleted: extra-x86_64/bluedevil.install
===================================================================
--- extra-x86_64/bluedevil.install 2014-12-14 16:32:29 UTC (rev 227608)
+++ extra-x86_64/bluedevil.install 2014-12-14 16:32:40 UTC (rev 227609)
@@ -1,12 +0,0 @@
-post_install() {
- update-mime-database usr/share/mime &> /dev/null
- update-desktop-database -q
-}
-
-post_upgrade() {
- post_install
-}
-
-post_remove() {
- post_install
-}
Copied: bluedevil/repos/extra-x86_64/bluedevil.install (from rev 227608, bluedevil/trunk/bluedevil.install)
===================================================================
--- extra-x86_64/bluedevil.install (rev 0)
+++ extra-x86_64/bluedevil.install 2014-12-14 16:32:40 UTC (rev 227609)
@@ -0,0 +1,12 @@
+post_install() {
+ update-mime-database usr/share/mime &> /dev/null
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
More information about the arch-commits
mailing list