1 diff -ru ./kio/kio/kservice.cpp ../kdelibs-new/kio/kio/kservice.cpp
2 --- ./kio/kio/kservice.cpp 2008-02-13 10:41:06.000000000 +0100
3 +++ ../kdelibs-new/kio/kio/kservice.cpp 2009-05-21 01:53:22.000000000 +0200
7 bool absPath = !QDir::isRelativePath(entryPath());
8 + QString kde4prefix = config->fileName();
9 + QString kde4menusuffix = " (KDE4)";
10 + int index = kde4prefix.find("/share/applications/kde4/");
11 + bool kde4app = index != -1;
13 + // get kdeprefix and kde version
16 + kde4prefix.truncate(index);
17 + kdedir = kde4prefix.section('/', -1, -1).upper();
18 + if (kdedir != "USR")
19 + kde4menusuffix = QString(" (KDE-%1)").arg(kdedir);
22 config->setDesktopGroup();
26 m_strName = m_strName.left(i);
29 + m_strName += kde4menusuffix;
31 m_strType = config->readEntry( "Type" );
32 entryMap.remove("Type");
34 name = name.left(pos);
36 m_strExec = config->readPathEntry( "Exec" );
37 + if (kde4app && !m_strExec.startsWith("/"))
38 + m_strExec = kde4prefix + QString("/bin/") + m_strExec;
39 + else if (config->readBoolEntry("X-KDE-SubstituteUID")) {
40 + int space = m_strExec.find(" ");
42 + m_strExec = KStandardDirs::findExe(m_strExec);
44 + const QString command = m_strExec.left(space);
45 + m_strExec.replace(command,KStandardDirs::findExe(command));
49 entryMap.remove("Exec");
51 m_strIcon = config->readEntry( "Icon", "unknown" );
53 m_DCOPServiceType = DCOP_None;
55 m_strDesktopEntryName = name.lower();
57 + m_strDesktopEntryName = QString("kde%1-").arg(kdedir.lower()) + m_strDesktopEntryName;
59 m_bAllowAsDefault = config->readBoolEntry( "AllowDefault", true );
60 entryMap.remove("AllowDefault");
62 m_initialPreference = config->readNumEntry( "InitialPreference", 1 );
64 + m_initialPreference = 1;
65 entryMap.remove("InitialPreference");
67 // Store all additional entries in the property map.
69 for( ; it != entryMap.end();++it)
71 //qDebug(" Key = %s Data = %s", it.key().latin1(), it.data().latin1());
72 - m_mapProps.insert( it.key(), QVariant( it.data()));
73 + QString key = it.key();
74 + if (kde4app && key == "OnlyShownIn" && it.data() == "KDE;")
76 + m_mapProps.insert(key, QVariant( it.data()));