[rkward-cvs] SF.net SVN: rkward:[3500] trunk/rkward/rkward/windows
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Tue Mar 29 17:05:51 UTC 2011
Revision: 3500
http://rkward.svn.sourceforge.net/rkward/?rev=3500&view=rev
Author: tfry
Date: 2011-03-29 17:05:50 +0000 (Tue, 29 Mar 2011)
Log Message:
-----------
Don't add service actions several times for KDE 4.5 and above
Modified Paths:
--------------
trunk/rkward/rkward/windows/rkfilebrowser.cpp
trunk/rkward/rkward/windows/rkfilebrowser.h
Modified: trunk/rkward/rkward/windows/rkfilebrowser.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkfilebrowser.cpp 2011-03-28 12:28:09 UTC (rev 3499)
+++ trunk/rkward/rkward/windows/rkfilebrowser.cpp 2011-03-29 17:05:50 UTC (rev 3500)
@@ -120,6 +120,7 @@
#if KDE_IS_VERSION(4, 3, 0)
fi_actions = new KFileItemActions (this);
connect (dir, SIGNAL (contextMenuAboutToShow(KFileItem,QMenu*)), this, SLOT (contextMenuHook(KFileItem,QMenu*)));
+ actions_added = false;
#endif
connect (dir, SIGNAL (urlEntered (const KUrl &)), this, SLOT (urlChangedInView (const KUrl &)));
@@ -141,8 +142,10 @@
QList<KFileItem> dummy;
dummy.append (item);
fi_actions->setItemListProperties (KFileItemListProperties (dummy));
+ if (KDE::version () >= KDE_MAKE_VERSION (4,5,0) && actions_added) return; // in some versions of KDE the actions must be added each time the menu is shown, in others only once
fi_actions->addOpenWithActionsTo (menu, QString ());
fi_actions->addServiceActionsTo (menu);
+ actions_added = true;
#endif
}
Modified: trunk/rkward/rkward/windows/rkfilebrowser.h
===================================================================
--- trunk/rkward/rkward/windows/rkfilebrowser.h 2011-03-28 12:28:09 UTC (rev 3499)
+++ trunk/rkward/rkward/windows/rkfilebrowser.h 2011-03-29 17:05:50 UTC (rev 3500)
@@ -67,6 +67,7 @@
void saveConfig ();
void contextMenuHook (const KFileItem &item, QMenu *menu);
private:
+ bool actions_added;
KDirOperator *dir;
KUrlComboBox *urlbox;
KFileItemActions *fi_actions;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list