Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 9bb938de93248ca5cc71ecf424cefd6c > files > 51

kdebase-3.5.4-21.el5_5.1.src.rpm

Index: libkonq/konq_popupmenu.cc
===================================================================
--- libkonq/konq_popupmenu.cc	(Revision 594167)
+++ libkonq/konq_popupmenu.cc	(Revision 594168)
@@ -851,9 +851,25 @@
                 KTrader::OfferList::ConstIterator it = offers.begin();
                 for( ; it != offers.end(); it++ )
                 {
-                    if ((*it)->noDisplay())
-                        continue;
+                    KService::Ptr service = (*it);
 
+                    // Skip OnlyShowIn=Foo and NotShowIn=KDE entries,
+                    // but still offer NoDisplay=true entries, that's the
+                    // whole point of such desktop files. This is why we don't
+                    // use service->noDisplay() here.
+                    const QString onlyShowIn = service->property("OnlyShowIn", QVariant::String).toString();
+                    if ( !onlyShowIn.isEmpty() ) {
+                        const QStringList aList = QStringList::split(';', onlyShowIn);
+                        if (!aList.contains("KDE"))
+                            continue;
+                    }
+                    const QString notShowIn = service->property("NotShowIn", QVariant::String).toString();
+                    if ( !notShowIn.isEmpty() ) {
+                        const QStringList aList = QStringList::split(';', notShowIn);
+                        if (aList.contains("KDE"))
+                            continue;
+                    }
+
                     QCString nam;
                     nam.setNum( id );