Hello community, here is the log from the commit of package kdebase3 for openSUSE:12.1:Update:Test checked in at 2012-02-27 16:46:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:12.1:Update:Test/kdebase3 (Old) and /work/SRC/openSUSE:12.1:Update:Test/.kdebase3.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kdebase3", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:12.1:Update:Test/kdebase3/kdebase3.changes 2011-12-12 21:40:19.000000000 +0100 +++ /work/SRC/openSUSE:12.1:Update:Test/.kdebase3.new/kdebase3.changes 2012-02-27 16:46:54.000000000 +0100 @@ -1,0 +2,36 @@ +Fri Feb 24 10:47:50 UTC 2012 - [email protected] + +- use upower instead of hal for hibernate and suspend, + thanks to Sergei Amelian (gentoo/trinity) (bnc#749028) + +------------------------------------------------------------------- +Wed Feb 8 16:45:34 UTC 2012 - [email protected] + +- add a konq patch from KDE3 svn + +------------------------------------------------------------------- +Wed Feb 8 12:48:59 UTC 2012 - [email protected] + +- remove qt3-devel-doc dependency + +------------------------------------------------------------------- +Tue Feb 7 22:37:05 UTC 2012 - [email protected] + +- remove openmotif dependency + +------------------------------------------------------------------- +Tue Jan 31 21:26:38 UTC 2012 - [email protected] + +- do not provide sysguardd for kde4 + +------------------------------------------------------------------- +Mon Jan 23 14:19:07 UTC 2012 - [email protected] + +- build fileshareset with PIE option + +------------------------------------------------------------------- +Wed Jan 11 18:02:45 UTC 2012 - [email protected] + +- add small patch from Slackware + +------------------------------------------------------------------- New: ---- kdebase-slackware-kicker.diff kdebase-svn-konq-move.patch kickoff-shutdown-upower.patch ksmserver-shutdown-upower.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdebase3.spec ++++++ --- /var/tmp/diff_new_pack.UnzXk9/_old 2012-02-27 16:46:55.000000000 +0100 +++ /var/tmp/diff_new_pack.UnzXk9/_new 2012-02-27 16:46:55.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package kdebase3 # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + %if %{suse_version} < 1210 %define with_hal 1 %else @@ -22,9 +23,28 @@ %endif Name: kdebase3 -BuildRequires: OpenEXR-devel cups-devel db-devel doxygen graphviz kdelibs3-devel krb5-devel libsmbclient-devel mDNSResponder-devel openldap2 openldap2-devel openmotif openmotif-devel openslp-devel openssh pam-devel pcsc-lite-devel qt3-devel-doc samba-client utempter xorg-x11 -BuildRequires: unsermake xorg-x11-libfontenc-devel +BuildRequires: OpenEXR-devel +BuildRequires: cups-devel +BuildRequires: db-devel +BuildRequires: doxygen +BuildRequires: graphviz +BuildRequires: kdelibs3-devel +BuildRequires: krb5-devel BuildRequires: liblazy-devel +BuildRequires: libsmbclient-devel +BuildRequires: mDNSResponder-devel +BuildRequires: openldap2 +BuildRequires: openldap2-devel +BuildRequires: openslp-devel +BuildRequires: openssh +BuildRequires: pam-devel +BuildRequires: pcsc-lite-devel +BuildRequires: samba-client +BuildRequires: unsermake +BuildRequires: utempter +BuildRequires: xorg-x11 +BuildRequires: xorg-x11-libfontenc-devel +BuildRequires: libdbus-1-qt3-0-devel %if %suse_version >= 1130 BuildRequires: libusb-compat-devel %endif @@ -32,7 +52,8 @@ BuildRequires: hal-devel Provides: kdebase3-with-hal-enabled %endif -BuildRequires: fdupes libbz2-devel +BuildRequires: fdupes +BuildRequires: libbz2-devel %ifnarch s390 s390x BuildRequires: libsensors4-devel %endif @@ -58,13 +79,13 @@ Provides: kdebase3-beagle = 3.5.10 Obsoletes: kdebase3-beagle <= 3.5.10 %endif +Summary: The KDE Core Components License: GPL-2.0+ Group: System/GUI/KDE -Summary: The KDE Core Components BuildRoot: %{_tmppath}/%{name}-%{version}-build Url: http://www.kde.org/ Version: 3.5.10.1 -Release: 18 +Release: 0 %define kde_version 3.5.10 Requires: kdebase3-runtime == %{version} Source0: kdebase-%{kde_version}.tar.bz2 @@ -252,6 +273,10 @@ Patch266: further-desktop-icons-adjustment.patch Patch267: kdebase-pardus-fix-autosuspend.patch Patch268: systemd-shutdown.patch +Patch269: kdebase-slackware-kicker.diff +Patch270: kdebase-svn-konq-move.patch +Patch271: ksmserver-shutdown-upower.patch +Patch272: kickoff-shutdown-upower.patch %description This package contains kdebase, one of the basic packages of the K @@ -262,22 +287,14 @@ This package is needed if you want to use the KDE Desktop. It is not needed if you only want to start some KDE applications. - - -Authors: --------- - The KDE Team <[email protected]> - %package -n misc-console-font -License: GPL-2.0+ -Group: System/GUI/KDE Summary: A font for terminal usage +Group: System/GUI/KDE %description -n misc-console-font This package contains the Misc Console font as shipped with KDE. %package runtime -License: GPL-2.0+ Summary: Runtime Dependencies of KDE3 Applications Group: System/GUI/KDE Provides: kio_fish @@ -289,7 +306,6 @@ KIO-slaves. %package workspace -License: GPL-2.0+ Summary: Workspace Components of KDE3 Desktop Group: System/GUI/KDE Requires: kdebase3 == %{version} @@ -303,13 +319,7 @@ This package contains the wrkspace components of kdebase3 like kdesktop, kicker and kwin. - -Authors: --------- - The KDE Team <[email protected]> - %package apps -License: GPL-2.0+ Summary: Major Applications KDE3 Desktop Group: System/GUI/KDE Requires: kdebase3 == %{version} @@ -319,14 +329,8 @@ This package contains the major applications kdebase3 like Kate, Konqueror and KWrite. - -Authors: --------- - The KDE Team <[email protected]> - %package devel -License: GPL-2.0+ -Requires: kdelibs3-devel kdebase3 = %version kdebase3-apps = %version kdebase3-runtime = %version kdebase3-workspace = %version +Requires: kdelibs3-devel libdbus-1-qt3-0-devel kdebase3 = %version kdebase3-apps = %version kdebase3-runtime = %version kdebase3-workspace = %version Summary: KDE Base Package: Base, Build Environment Group: System/GUI/KDE @@ -339,35 +343,21 @@ This package is not needed if you do not want to compile high level KDE applications. - - -Authors: --------- - The KDE Team <[email protected]> - %package kdm -License: GPL-2.0+ # usesubdirs kdm Summary: The KDE login and display manager +Group: System/GUI/KDE Provides: kdebase3:/opt/kde3/bin/kdm Provides: kdebase:/opt/kde2/bin/kdm Provides: kdebase3-kdm-SLD:/opt/kde3/bin/kdm Requires: xorg-x11 Requires: kdebase3-runtime >= %version -Group: System/GUI/KDE PreReq: %fillup_prereq /bin/grep %description kdm This package contains kdm, the login and session manager for KDE. - - -Authors: --------- - The KDE Team <[email protected]> - %package samba -License: GPL-2.0+ # usesubdirs kioslave/smb kcontrol/samba Summary: KDE Base package: Windows Connection Module Group: System/GUI/KDE @@ -376,14 +366,7 @@ This package provides the "smb://" protocol, to connect to and from Windows and Samba shares. - - -Authors: --------- - The KDE Team <[email protected]> - %package extra -License: GPL-2.0+ # usesubdirs kpersonalizer kcontrol/thememgr Summary: KDE Base package: Extra Applications Group: System/GUI/KDE @@ -396,14 +379,7 @@ - khotkeys aRts support - for voice triggered shortcuts - - -Authors: --------- - The KDE Team <[email protected]> - %package nsplugin -License: GPL-2.0+ %ifarch x86_64 ppc64 s390x ia64 Requires: nspluginwrapper %endif @@ -417,18 +393,10 @@ have to enable JavaScript for this. - -Authors: --------- - The KDE Team <[email protected]> - - %package ksysguardd -License: GPL-2.0+ PreReq: %insserv_prereq %fillup_prereq aaa_base Summary: KDE base package: ksysguard daemon Group: System/GUI/KDE -Provides: kdebase4-workspace-ksysguardd %description ksysguardd This package contains the ksysguard daemon. It is needed for ksysguard. @@ -436,15 +404,7 @@ This package can be installed on servers without any other KDE packages to guard the system from remote computers. - - -Authors: --------- - The KDE Team <[email protected]> - - %package session -License: GPL-2.0+ Summary: The KDE Session Group: System/GUI/KDE Provides: kdebase3:/usr/bin/kde @@ -454,16 +414,9 @@ This package contains the startup scripts necessary to start a KDE session from kdm. - - -Authors: --------- - The KDE Team <[email protected]> - %if %suse_version < 1140 %package beagle -License: GPL-2.0+ Summary: Beagle dependent plugins for KDE desktop Group: System/GUI/KDE Requires: beagle >= 0.3.0 @@ -475,32 +428,19 @@ This package contains kdebase plugins which provide additional search functionality via Beagle. - - -Authors: --------- - The KDE Team <[email protected]> - %endif %package -n fileshareset -License: GPL-2.0+ Summary: Set and list fileshares Group: System/Management Version: 2.0 -Release: 579 +Release: 0 %description -n fileshareset This package contains the the fileshareset utility to allow users to add or remove file shares. It's also possible to list currently shared locations. /etc/security/fileshare.conf is the main configuration file. - - -Authors: --------- - Uwe Gansert <uwe.gansert at SuSE dot de> - %define sysconfdir /etc %prep @@ -677,6 +617,10 @@ %patch266 -p1 %patch267 -p1 %patch268 -p1 +%patch269 -p4 +%patch270 -p4 +%patch271 -p1 +%patch272 -p1 rm -rf kappfinder rm pics/crystalsvg/cr??-*emacs.png @@ -697,30 +641,27 @@ %ifnarch s390 PARANOIA="--with-cdparanoia" %endif - LDAP="--with-ldap" -%if %suse_version > 1010 - MOTIF_INCLUDE="/usr/include" +LDAP="--with-ldap" X_SERVER=/usr/bin/X RUN_KAPPFINDER=no \ -%else - MOTIF_INCLUDE="/usr/X11R6/include" -X_SERVER=/usr/X11R6/bin/X RUN_KAPPFINDER=no \ -%endif +export LIBS="$LIBS -ldbus-1-qt3" ./configure \ $configkde \ $PARANOIA \ $LDAP \ $FLAGS \ $XINERAMA \ - --with-motif-libraries=/usr/%{_lib}/ \ - --with-motif-includes=$MOTIF_INCLUDE \ --with-samba-libs \ --with-pam=xdm \ --with-kdm-xconsole \ --with-kdm-pam=xdm \ --with-kcp-pam=kcheckpass \ + --with-extra-includes=/usr/include/dbus-1.0/qt3 \ --with-kss-pam=kcheckpass do_make %{?_smp_mflags} cd ../fileshareset2 +export CXXFLAGS="$CXXFLAGS -fPIE" +export CFLAGS="$CXXFLAGS -fPIE" +export LDFLAGS="$LDFLAGS -pie" ./configure --prefix=%{fileshare_prefix} make %{?_smp_mflags} @@ -748,12 +689,8 @@ mkdir -p ${RPM_BUILD_ROOT}/usr/bin \ ${RPM_BUILD_ROOT}/usr/sbin \ ${RPM_BUILD_ROOT}/var/run/xdmctl -%if %suse_version > 1010 - ln -fs /opt/kde3/bin/startkde $RPM_BUILD_ROOT/usr/bin/kde - ln -fs /opt/kde3/bin/startkde $RPM_BUILD_ROOT/usr/bin/startkde3 -%else - ln -fs /opt/kde3/bin/startkde $RPM_BUILD_ROOT/usr/X11R6/bin/kde -%endif +ln -fs /opt/kde3/bin/startkde $RPM_BUILD_ROOT/usr/bin/kde +ln -fs /opt/kde3/bin/startkde $RPM_BUILD_ROOT/usr/bin/startkde3 ln -sf rcxdm ${RPM_BUILD_ROOT}/usr/sbin/rckdm mv ${RPM_BUILD_ROOT}/opt/kde3/bin/ksysguardd ${RPM_BUILD_ROOT}/usr/bin/ksysguardd ln -sf /usr/bin/ksysguardd ${RPM_BUILD_ROOT}/opt/kde3/bin/ksysguardd @@ -891,9 +828,7 @@ rm $RPM_BUILD_ROOT/%_mandir/man1/kbookmarkmerger.* rm $RPM_BUILD_ROOT/%_mandir/man1/kfind.* kde_post_install -%if %suse_version > 1020 %fdupes $RPM_BUILD_ROOT/opt/kde3/share -%endif # move konqueror.desktop back to old position (#281572) mv $RPM_BUILD_ROOT/opt/kde3/share/applications/kde/konqueror.desktop $RPM_BUILD_ROOT/opt/kde3/share/applnk/konqueror.desktop @@ -952,23 +887,6 @@ %postun %insserv_cleanup /sbin/ldconfig -%if %suse_version < 1031 - -%post ksysguardd -%{fillup_and_insserv -sn kdebase3-ksysguardd ksysguardd RUN_KSYSGUARDD} -%verifyscript -%verify_permissions -e /opt/kde3/bin/kcheckpass -%verify_permissions -e /opt/kde3/bin/kdesud -%verify_permissions -e /opt/kde3/bin/khc_indexbuilder - -%postun ksysguardd -%restart_on_update ksysguardd -%insserv_cleanup - -%preun ksysguardd -%stop_on_removal ksysguardd -%endif - %post runtime -p /sbin/ldconfig %postun runtime -p /sbin/ldconfig @@ -984,9 +902,6 @@ %postun apps -p /sbin/ldconfig -%clean -rm -rf $RPM_BUILD_ROOT - %files -n misc-console-font %defattr(-,root,root) %doc COPYING @@ -1044,9 +959,7 @@ /opt/kde3/bin/khc_htsearch.pl /opt/kde3/bin/kapplymousetheme /opt/kde3/bin/kio_system_documenthelper -%if %suse_version > 1010 /opt/kde3/bin/runupdater -%endif /opt/kde3/bin/kstart /opt/kde3/bin/ksystraycmd /opt/kde3/%_lib/kde3/cursorthumbnail.* @@ -1092,10 +1005,8 @@ /opt/kde3/%_lib/kde3/kstyle_keramik_config.* /opt/kde3/%_lib/kde3/libkmanpart.* /opt/kde3/%_lib/kde3/liblocaldomainurifilter.* -%if %suse_version > 1010 /opt/kde3/%_lib/kde3/runupdater.* /opt/kde3/%_lib/libkdeinit_runupdater.so -%endif /opt/kde3/%_lib/libkdeinit_kaccess.so /opt/kde3/%_lib/libkdeinit_kcminit.so /opt/kde3/%_lib/libkdeinit_kcminit_startup.so @@ -1399,11 +1310,6 @@ /opt/kde3/share/services/kfile_font.desktop /opt/kde3/share/services/kfontviewpart.desktop %_mandir/man1/* -%if %suse_version < 1001 -%config(noreplace) /etc/security/fileshare.conf -/opt/kde3/bin/filesharelist -%verify(not mode) /opt/kde3/bin/fileshareset -%endif %{_mandir}/man8/kcheckpass.8.gz %doc %lang(en) /opt/kde3/share/doc/HTML/en/kcontrol %doc %lang(en) /opt/kde3/share/doc/HTML/en/kdcop @@ -1441,15 +1347,6 @@ %dir /opt/kde3/share/config/kdm %config(noreplace) /opt/kde3/share/config/kdm/kdmrc %config(noreplace) /opt/kde3/share/config/kdm/backgroundrc -%if %suse_version < 1010 -%config /opt/kde3/share/config/kdm/Xaccess -%config /opt/kde3/share/config/kdm/Xreset -%config /opt/kde3/share/config/kdm/Xresources -%config /opt/kde3/share/config/kdm/Xsession -%config /opt/kde3/share/config/kdm/Xsetup -%config /opt/kde3/share/config/kdm/Xstartup -%config /opt/kde3/share/config/kdm/Xwilling -%endif %ghost /var/run/xdmctl /usr/sbin/rckdm /opt/kde3/share/applications/kde/kdm.desktop @@ -1459,15 +1356,8 @@ %files session %defattr(-,root,root) -%if %suse_version > 1010 /usr/bin/kde /usr/bin/startkde3 -%else -/usr/X11R6/bin/kde -%endif -%if %suse_version < 1030 -%dir /usr/share/xsessions -%endif /usr/share/xsessions/kde.desktop %files extra ++++++ kdebase-pardus-fix-fish.patch ++++++ --- /var/tmp/diff_new_pack.UnzXk9/_old 2012-02-27 16:46:56.000000000 +0100 +++ /var/tmp/diff_new_pack.UnzXk9/_new 2012-02-27 16:46:56.000000000 +0100 @@ -11,15 +11,6 @@ index 4b7ea26..3967bcd 100644 --- a/kioslave/fish/fish.cpp +++ b/kioslave/fish/fish.cpp -@@ -2,7 +2,7 @@ - fish.cpp - a FISH kioslave - ------------------- - begin : Thu Oct 4 17:09:14 CEST 2001 -- copyright : (C) 2001-2003 by J�rg Walter -+ copyright : (C) 2001-2003 by J�rg Walter - email : [email protected] - ***************************************************************************/ - @@ -1430,7 +1430,7 @@ void fishProtocol::run() { sent(); } ++++++ kdebase-slackware-kicker.diff ++++++ --- branches/KDE/3.5/kdebase/kicker/taskbar/taskbar.cpp 2008/08/28 23:10:18854164 +++ branches/KDE/3.5/kdebase/kicker/taskbar/taskbar.cpp 2008/11/19 00:45:13886334 @@ -304,6 +304,7 @@ Panner::resizeEvent(e); reLayoutEventually(); + setViewportBackground(); } void TaskBar::add(Task::Ptr task) ++++++ kdebase-svn-konq-move.patch ++++++ --- branches/KDE/3.5/kdebase/libkonq/konq_operations.cc 2007/05/14 10:09:27 664555 +++ branches/KDE/3.5/kdebase/libkonq/konq_operations.cc 2010/10/15 20:04:22 1186318 @@ -562,12 +562,26 @@ return; } + bool enableLinking = true; // for now, but see below + + // We don't want to offer "move" for temp files. They might come from + // kmail using a tempfile for attachments, or ark using a tempdir for + // extracting an archive -- in all cases, we can't implement a real move, + // it's just a copy of the tempfile [and the source app will delete it later]. + // https://www.intevation.de/roundup/kolab/issue2026 + if (url.isLocalFile() && url.path().startsWith(locateLocal("tmp", QString::null))) { + sMoving = false; + sDeleting = false; + enableLinking = false; + } + QPopupMenu popup; if (!mlst.isEmpty() && (sMoving || (sReading && sDeleting)) && !linkOnly ) popup.insertItem(SmallIconSet("goto"), i18n( "&Move Here" ) + "\t" + KKey::modFlagLabel( KKey::SHIFT ), 2 ); if ( sReading && !linkOnly) popup.insertItem(SmallIconSet("editcopy"), i18n( "&Copy Here" ) + "\t" + KKey::modFlagLabel( KKey::CTRL ), 1 ); - popup.insertItem(SmallIconSet("www"), i18n( "&Link Here" ) + "\t" + KKey::modFlagLabel( (KKey::ModFlag)( KKey::CTRL|KKey::SHIFT ) ), 3 ); + if (enableLinking) + popup.insertItem(SmallIconSet("www"), i18n( "&Link Here" ) + "\t" + KKey::modFlagLabel( (KKey::ModFlag)( KKey::CTRL|KKey::SHIFT ) ), 3 ); if (bSetWallpaper) popup.insertItem(SmallIconSet("background"), i18n( "Set as &Wallpaper" ), 4 ); popup.insertSeparator(); ++++++ kickoff-shutdown-upower.patch ++++++ diff -wruN kdebase-3.5.10.orig/kicker/kicker/ui/k_new_mnu.cpp kdebase-3.5.10/kicker/kicker/ui/k_new_mnu.cpp --- kdebase-3.5.10.orig/kicker/kicker/ui/k_new_mnu.cpp 2012-02-24 14:00:03.000000000 +0400 +++ kdebase-3.5.10/kicker/kicker/ui/k_new_mnu.cpp 2012-02-26 09:16:18.726727042 +0400 @@ -3685,54 +3685,41 @@ return 5; } -#define DBUS_HAL_INTERFACE "org.freedesktop.Hal" -#define DBUS_HAL_SYSTEM_POWER_INTERFACE "org.freedesktop.Hal.Device.SystemPowerManagement" -#define HAL_UDI_COMPUTER "/org/freedesktop/Hal/devices/computer" - #ifdef KDELIBS_SUSE -#include <liblazy.h> #include <X11/Xlib.h> #include <fixx11h.h> + +#include <dbus/qdbusdata.h> +#include <dbus/qdbusmessage.h> +#include <dbus/qdbusproxy.h> +#include <dbus/qdbusvariant.h> #endif void KMenu::insertSuspendOption( int &nId, int &index ) { #ifdef KDELIBS_SUSE - int supported = -1; + bool suspend_ram, suspend_disk, standby; - DCOPRef kpowersave( "kpowersave", "KPowersaveIface" ); - DCOPReply reply = kpowersave.call( "allowed_sleepingStates" ); - if( reply.isValid()) { - QStringList supported = reply; - suspend_ram = supported.contains( "suspendToRAM" ); - suspend_disk = supported.contains( "suspendToDisk" ); - standby = supported.contains( "standBy" ); - } else { - liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_suspend", &supported); - if (supported == 1) - suspend_ram = true; - else - suspend_ram = false; - liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_standby", &supported); - if (supported == 1) - standby = true; - else - standby = false; - liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_hibernate", &supported); - if (supported == 1) - suspend_disk = true; - else - suspend_disk = false; + m_dbusConn = QDBusConnection::addConnection(QDBusConnection::SystemBus); + + QDBusProxy upowerProperties("org.freedesktop.UPower", "/org/freedesktop/UPower", "org.freedesktop.DBus.Properties", m_dbusConn); + // can suspend? + QValueList<QDBusData> params; + params << QDBusData::fromString(upowerProperties.interface()) << QDBusData::fromString("CanSuspend"); + QDBusMessage reply = upowerProperties.sendWithReply("Get", params); + if(reply.type() == QDBusMessage::ReplyMessage && reply.count() == 1) + suspend_ram = reply[0].toVariant().value.toBool(); + + // can hibernate? + params.clear(); + params << QDBusData::fromString(upowerProperties.interface()) << QDBusData::fromString("CanHibernate"); + reply = upowerProperties.sendWithReply("Get", params); + if(reply.type() == QDBusMessage::ReplyMessage && reply.count() == 1) + suspend_disk = reply[0].toVariant().value.toBool(); - if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.hibernate") != 1) - suspend_disk = false; - if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.suspend") != 1) - suspend_ram = false; - if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.standby") != 1) standby = false; - } if ( ! ( standby + suspend_ram + suspend_disk ) ) return; @@ -3756,59 +3743,29 @@ void KMenu::slotSuspend(int id) { #ifdef KDELIBS_SUSE - int error = 0; - - DCOPRef kpowersave( "kpowersave", "KPowersaveIface" ); - DCOPReply reply = kpowersave.call( "allowed_sleepingStates" ); - if( reply.isValid()) { - bool ok; - extern Time qt_x_time; - XUngrabKeyboard( qt_xdisplay(), qt_x_time ); - XUngrabPointer( qt_xdisplay(), qt_x_time ); - XSync( qt_xdisplay(), False ); - if( id == 1 ) - ok = kpowersave.call( "do_suspendToDisk" ); - else if( id == 2 ) - ok = kpowersave.call( "do_suspendToRAM" ); - else if( id == 3 ) - ok = kpowersave.call( "do_standBy" ); - else - return; - error = ok ? 0 : 1; - } else { - int wake = 0; - DBusMessage *reply = 0; if (id == 1) { - error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, - HAL_UDI_COMPUTER, - DBUS_HAL_SYSTEM_POWER_INTERFACE, - "Hibernate", - &reply, - DBUS_TYPE_INVALID); + if( m_dbusConn.isConnected() ) { + QDBusMessage msg = QDBusMessage::methodCall( + "org.freedesktop.UPower", + "/org/freedesktop/UPower", + "org.freedesktop.UPower", + "Hibernate"); + m_dbusConn.sendWithReply(msg); + } } else if (id == 2) - error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, - HAL_UDI_COMPUTER, - DBUS_HAL_SYSTEM_POWER_INTERFACE, - "Suspend", - &reply, - DBUS_TYPE_INT32, - &wake, - DBUS_TYPE_INVALID); - else if (id == 3) - error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, - HAL_UDI_COMPUTER, - DBUS_HAL_SYSTEM_POWER_INTERFACE, - "Standby", - &reply, - DBUS_TYPE_INVALID); + if( m_dbusConn.isConnected() ) { + QDBusMessage msg = QDBusMessage::methodCall( + "org.freedesktop.UPower", + "/org/freedesktop/UPower", + "org.freedesktop.UPower", + "Suspend"); + m_dbusConn.sendWithReply(msg); + } else return; - } - if (error) #endif - KMessageBox::error(this, i18n("Suspend failed")); } diff -wruN kdebase-3.5.10.orig/kicker/kicker/ui/k_new_mnu.h kdebase-3.5.10/kicker/kicker/ui/k_new_mnu.h --- kdebase-3.5.10.orig/kicker/kicker/ui/k_new_mnu.h 2012-02-24 14:28:32.000000000 +0400 +++ kdebase-3.5.10/kicker/kicker/ui/k_new_mnu.h 2012-02-26 09:14:15.733728378 +0400 @@ -41,6 +41,7 @@ #include "kmenubase.h" #include "service_mnu.h" #include "query.h" +#include <dbus/qdbusconnection.h> class KickerClientMenu; class KickoffTabBar; @@ -228,6 +229,7 @@ FlipScrollView * m_exitView; QVBox * m_searchWidget; QLabel * m_resizeHandle; + QDBusConnection m_dbusConn; bool m_isresizing; // timer for search without pressing enter feature ++++++ ksmserver-shutdown-upower.patch ++++++ diff -wruN kdebase-3.5.10.orig/ksmserver/shutdowndlg.cpp kdebase-3.5.10/ksmserver/shutdowndlg.cpp --- kdebase-3.5.10.orig/ksmserver/shutdowndlg.cpp 2012-02-22 08:17:40.342199124 +0400 +++ kdebase-3.5.10/ksmserver/shutdowndlg.cpp 2012-02-26 05:57:11.235726994 +0400 @@ -47,15 +47,15 @@ #include <unistd.h> #include <stdlib.h> #include <dmctl.h> -#include <liblazy.h> #include <X11/Xlib.h> #include "shutdowndlg.moc" -#define DBUS_HAL_INTERFACE "org.freedesktop.Hal" -#define DBUS_HAL_SYSTEM_POWER_INTERFACE "org.freedesktop.Hal.Device.SystemPowerManagement" -#define HAL_UDI_COMPUTER "/org/freedesktop/Hal/devices/computer" +#include <dbus/qdbusdata.h> +#include <dbus/qdbusmessage.h> +#include <dbus/qdbusproxy.h> +#include <dbus/qdbusvariant.h> static const int max_faded = 2300; static const int slice = 20; @@ -265,43 +265,29 @@ } else QToolTip::add( btnReboot, i18n( "<qt><h3>Restart Computer</h3><p>Log out of the current session and restart the computer</p></qt>" ) ); - DCOPRef kpowersave( "kpowersave", "KPowersaveIface" ); - DCOPReply reply = kpowersave.call( "allowed_sleepingStates" ); - if( reply.isValid()) { - QStringList supported = reply; - suspend_ram = supported.contains( "suspendToRAM" ); - suspend_disk = supported.contains( "suspendToDisk" ); - standby = supported.contains( "standBy" ); - } else { - int supported = -1; - liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_suspend", &supported); - if (supported == 1) - suspend_ram = true; - else - suspend_ram = false; - liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_standby", &supported); - if (supported == 1) - standby = true; - else - standby = false; - liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_hibernate", &supported); - if (supported == 1) - suspend_disk = true; - else - suspend_disk = false; + m_dbusConn = QDBusConnection::addConnection(QDBusConnection::SystemBus); + + QDBusProxy upowerProperties("org.freedesktop.UPower", "/org/freedesktop/UPower", "org.freedesktop.DBus.Properties", m_dbusConn); - if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.hibernate") != 1) - suspend_disk = false; - if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.suspend") != 1) - suspend_ram = false; - if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.standby") != 1) + // can suspend? + QValueList<QDBusData> params; + params << QDBusData::fromString(upowerProperties.interface()) << QDBusData::fromString("CanSuspend"); + QDBusMessage reply = upowerProperties.sendWithReply("Get", params); + if(reply.type() == QDBusMessage::ReplyMessage && reply.count() == 1) + suspend_ram = reply[0].toVariant().value.toBool(); + + // can hibernate? + params.clear(); + params << QDBusData::fromString(upowerProperties.interface()) << QDBusData::fromString("CanHibernate"); + reply = upowerProperties.sendWithReply("Get", params); + if(reply.type() == QDBusMessage::ReplyMessage && reply.count() == 1) + suspend_disk = reply[0].toVariant().value.toBool(); standby = false; - } int sum = standby + suspend_ram + suspend_disk; if ( sum ) { QButton *btnSuspend; - if (sum > 1) { + if (sum >= 1) { btnSuspend = new KSMDelayedPushButton( KGuiItem( i18n("&Suspend Computer"), "player_pause"), frame ); QPopupMenu *suspends = new QPopupMenu(frame); if (suspend_disk) @@ -312,8 +298,6 @@ suspends->insertItem(i18n("Standby"), 3); connect(suspends, SIGNAL(activated(int)), SLOT(slotSuspend(int))); static_cast<KSMDelayedPushButton*>(btnSuspend)->setPopup(suspends); - } else { - btnSuspend = new KPushButton( KGuiItem( i18n("&Suspend Computer"), "player_pause"), frame ); } btnSuspend->setFont( btnFont ); buttonlay->addWidget( btnSuspend ); @@ -334,55 +318,25 @@ void KSMShutdownDlg::slotSuspend() { - int error = 0; - DCOPRef kpowersave( "kpowersave", "KPowersaveIface" ); - DCOPReply reply = kpowersave.call( "allowed_sleepingStates" ); - if( reply.isValid()) { - bool ok; - // so that screen locking can take place - extern Time qt_x_time; - XUngrabKeyboard( qt_xdisplay(), qt_x_time ); - XUngrabPointer( qt_xdisplay(), qt_x_time ); - XSync( qt_xdisplay(), False ); - if( suspend_disk ) - ok = kpowersave.call( "do_suspendToDisk" ); - else if( suspend_ram ) - ok = kpowersave.call( "do_suspendToRAM" ); - else - ok = kpowersave.call( "do_standBy" ); - error = ok ? 0 : 1; - } else { - - int wake = 0; - DBusMessage *reply; - if (suspend_disk) - error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, - HAL_UDI_COMPUTER, - DBUS_HAL_SYSTEM_POWER_INTERFACE, - "Hibernate", - &reply, - DBUS_TYPE_INVALID); - else if (suspend_ram) - error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, - HAL_UDI_COMPUTER, - DBUS_HAL_SYSTEM_POWER_INTERFACE, - "Suspend", - &reply, - DBUS_TYPE_INT32, - &wake, - DBUS_TYPE_INVALID); - else - error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, - HAL_UDI_COMPUTER, - DBUS_HAL_SYSTEM_POWER_INTERFACE, - "Standby", - &reply, - DBUS_TYPE_INVALID); + if (suspend_disk) { + if( m_dbusConn.isConnected() ) { + QDBusMessage msg = QDBusMessage::methodCall( + "org.freedesktop.UPower", + "/org/freedesktop/UPower", + "org.freedesktop.UPower", + "Hibernate"); + m_dbusConn.sendWithReply(msg); + } + } else + if( m_dbusConn.isConnected() ) { + QDBusMessage msg = QDBusMessage::methodCall( + "org.freedesktop.UPower", + "/org/freedesktop/UPower", + "org.freedesktop.UPower", + "Suspend"); + m_dbusConn.sendWithReply(msg); } - - if (error) - KMessageBox::error(this, i18n("Suspend failed")); // possibly after resume :) reject(); @@ -390,60 +344,27 @@ void KSMShutdownDlg::slotSuspend(int id) { - int error = 0; - - DCOPRef kpowersave( "kpowersave", "KPowersaveIface" ); - DCOPReply reply = kpowersave.call( "allowed_sleepingStates" ); - if( reply.isValid()) { - bool ok; - extern Time qt_x_time; - XUngrabKeyboard( qt_xdisplay(), qt_x_time ); - XUngrabPointer( qt_xdisplay(), qt_x_time ); - XSync( qt_xdisplay(), False ); - if( suspend_disk && id == 1 ) - ok = kpowersave.call( "do_suspendToDisk" ); - else if( suspend_ram && id == 2 ) - ok = kpowersave.call( "do_suspendToRAM" ); - else if( standby && id == 3 ) - ok = kpowersave.call( "do_standBy" ); - else - return; - error = ok ? 0 : 1; - } else { - - - int wake = 0; - DBusMessage *reply; if (suspend_disk && id == 1) { - error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, - HAL_UDI_COMPUTER, - DBUS_HAL_SYSTEM_POWER_INTERFACE, - "Hibernate", - &reply, - DBUS_TYPE_INVALID); + if( m_dbusConn.isConnected() ) { + QDBusMessage msg = QDBusMessage::methodCall( + "org.freedesktop.UPower", + "/org/freedesktop/UPower", + "org.freedesktop.UPower", + "Hibernate"); + m_dbusConn.sendWithReply(msg); + } } else if (suspend_ram && id == 2) - error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, - HAL_UDI_COMPUTER, - DBUS_HAL_SYSTEM_POWER_INTERFACE, - "Suspend", - &reply, - DBUS_TYPE_INT32, - &wake, - DBUS_TYPE_INVALID); - else if (standby && id == 3) - error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, - HAL_UDI_COMPUTER, - DBUS_HAL_SYSTEM_POWER_INTERFACE, - "Standby", - &reply, - DBUS_TYPE_INVALID); - else - return; + if( m_dbusConn.isConnected() ) { + QDBusMessage msg = QDBusMessage::methodCall( + "org.freedesktop.UPower", + "/org/freedesktop/UPower", + "org.freedesktop.UPower", + "Suspend"); + m_dbusConn.sendWithReply(msg); } - - if (error) - KMessageBox::error(this, i18n("Suspend failed")); + else + KSMShutdownDlg::slotSuspend(); return; // possibly after resume :) reject(); diff -wruN kdebase-3.5.10.orig/ksmserver/shutdowndlg.h kdebase-3.5.10/ksmserver/shutdowndlg.h --- kdebase-3.5.10.orig/ksmserver/shutdowndlg.h 2012-02-20 01:01:49.084200000 +0400 +++ kdebase-3.5.10/ksmserver/shutdowndlg.h 2012-02-25 16:45:19.519737644 +0400 @@ -12,6 +12,7 @@ #include <qdatetime.h> #include <kpushbutton.h> #include <qimage.h> +#include <dbus/qdbusconnection.h> class QPushButton; class QVButtonGroup; class QPopupMenu; @@ -74,6 +75,7 @@ QPopupMenu *targets; QStringList rebootOptions; bool suspend_disk, suspend_ram, standby; + QDBusConnection m_dbusConn; }; class KSMDelayedPushButton : public KPushButton -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
