rpms/kdebase-workspace/devel kdebase-workspace-4.2.1-hotkey.patch, NONE, 1.1 kdebase-workspace.spec, 1.204, 1.205

Than Ngo than at fedoraproject.org
Wed Mar 18 11:36:21 UTC 2009


Author: than

Update of /cvs/extras/rpms/kdebase-workspace/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3084

Modified Files:
	kdebase-workspace.spec 
Added Files:
	kdebase-workspace-4.2.1-hotkey.patch 
Log Message:
upstream patch to fix MenuEntryActions created from khotkeys


kdebase-workspace-4.2.1-hotkey.patch:

--- NEW FILE kdebase-workspace-4.2.1-hotkey.patch ---
Index: workspace/khotkeys/kcm_hotkeys/actions/menuentry_action_widget.cpp
===================================================================
--- workspace/khotkeys/kcm_hotkeys/actions/menuentry_action_widget.cpp	(Revision 940678)
+++ workspace/khotkeys/kcm_hotkeys/actions/menuentry_action_widget.cpp	(Revision 940679)
@@ -26,6 +26,7 @@
 
 MenuentryActionWidget::MenuentryActionWidget( KHotKeys::MenuEntryAction *action, QWidget *parent )
         : ActionWidgetBase(action, parent )
+          ,storage_id()
     {
     ui.setupUi(this);
 
@@ -66,10 +67,12 @@
     if (service)
         {
         ui.application->setText( service->name() );
+        storage_id = service->storageId();
         }
     else
         {
-        ui.application->setText("");
+        ui.application->setText(QString());
+        storage_id = QString();
         }
     }
 
@@ -77,8 +80,8 @@
 void MenuentryActionWidget::doCopyToObject()
     {
     Q_ASSERT(action());
-
-    action()->set_service( KService::serviceByName( ui.application->text() ));
+    kDebug() << KService::serviceByName(ui.application->text());
+    action()->set_service( KService::serviceByStorageId(storage_id));
     }
 
 
@@ -113,6 +116,7 @@
     if (service)
         {
         ui.application->setText( service->name() );
+        storage_id = service->storageId();
         }
     }
 
Index: workspace/khotkeys/kcm_hotkeys/actions/menuentry_action_widget.h
===================================================================
--- workspace/khotkeys/kcm_hotkeys/actions/menuentry_action_widget.h	(Revision 940678)
+++ workspace/khotkeys/kcm_hotkeys/actions/menuentry_action_widget.h	(Revision 940679)
@@ -60,8 +60,11 @@
     virtual void doCopyFromObject();
     virtual void doCopyToObject();
 
+    QString storage_id;
+
     Ui::MenuentryActionWidget ui;
 
+
 };
 
 #endif /* #ifndef MENUENTRY_ACTION_WIDGET_H */
Index: workspace/khotkeys/libkhotkeysprivate/actions/menuentry_action.cpp
===================================================================
--- workspace/khotkeys/libkhotkeysprivate/actions/menuentry_action.cpp	(Revision 940678)
+++ workspace/khotkeys/libkhotkeysprivate/actions/menuentry_action.cpp	(Revision 940679)
@@ -18,9 +18,11 @@
 */
 
 #include "actions.h"
+#include "action_data/action_data.h"
 
 #include <KDE/KConfigGroup>
 #include <KDE/KDebug>
+#include <KDE/KMessageBox>
 #include <KDE/KUrl>
 #include <KDE/KRun>
 
@@ -57,19 +59,37 @@
 
 void MenuEntryAction::set_service( KService::Ptr service )
     {
-    if (!service) return;
     _service = service;
-    set_command_url(service->storageId());
+    if (service)
+        {
+        set_command_url(service->storageId());
+        }
+    else
+        {
+        set_command_url(QString());
+        }
     }
 
 
 void MenuEntryAction::execute()
     {
-    (void) service();
-    if (!_service)
+    if (!service())
+        {
+        KMessageBox::sorry(
+                NULL,
+                i18n("No service configured!"),
+                i18n("Input Action : %1", data->comment()));
         return;
-    kDebug() << "Starting service " << _service->desktopEntryName();
-    KRun::run( *_service, KUrl::List(), 0 );
+        }
+
+    if (!KRun::run( *service(), KUrl::List(), 0 ))
+        {
+        KMessageBox::sorry(
+                NULL,
+                i18n("Failed to start service '%1'!", service()->name()),
+                i18n("Input Action : %1", data->comment()));
+        return;
+        }
     timeout.setSingleShot( true );
     timeout.start( 1000 ); // 1sec timeout
     }
@@ -83,8 +103,7 @@
 
 const QString MenuEntryAction::description() const
     {
-    (void) service();
-    return i18n( "Menu entry: " ) + (_service ? _service->comment() : QString());
+    return i18n( "Menu entry: " ) + (service() ? service()->comment() : QString());
     }
 
 


Index: kdebase-workspace.spec
===================================================================
RCS file: /cvs/extras/rpms/kdebase-workspace/devel/kdebase-workspace.spec,v
retrieving revision 1.204
retrieving revision 1.205
diff -u -r1.204 -r1.205
--- kdebase-workspace.spec	16 Mar 2009 20:24:53 -0000	1.204
+++ kdebase-workspace.spec	18 Mar 2009 11:35:50 -0000	1.205
@@ -8,7 +8,7 @@
 Name: kdebase-workspace
 Version: 4.2.1
 
-Release: 9%{?dist}
+Release: 10%{?dist}
 Source0: ftp://ftp.kde.org/pub/kde/stable/%{version}/src/kdebase-workspace-%{version}.tar.bz2
 License: GPLv2
 Group: User Interface/Desktops
@@ -48,6 +48,8 @@
 Patch105: kdebase-workspace-4.3.0-desktopnumbers.patch
 # 4.2, http://bugs.kde.org/185585
 Patch106: kdebase-workspace-4.2.1-kde#185585.patch
+# 4.2, http://bugs.kde.org/186992
+Patch107: kdebase-workspace-4.2.1-hotkey.patch
 
 # FIXME: Should we restore this now that kdebase no longer depends on kdebase-workspace?
 %if 0%{?fedora} == 9
@@ -245,7 +247,7 @@
 %patch104 -p5 -b .kde#185736
 %patch105 -p0 -b .desktopnumbers
 %patch106 -p0 -b .kde#185585
-
+%patch107 -p1 -b .kde#186992
 
 %build
 
@@ -509,6 +511,9 @@
 
 
 %changelog
+* Wed Mar 18 2009 Than Ngo <than at redhat.com> - 4.2.1-10
+- upstream patch to fix MenuEntryActions created from khotkeys
+
 * Mon Mar 16 2009 Rex Dieter <rdieter at fedoraproject.org> - 4.2.1-9
 - kdm subpkg
 - -devel: move cmake modules here




More information about the fedora-extras-commits mailing list