--- kdebase-3.4.2/kioslave/settings/kio_settings.cc.fix_kio_settings_path 2005-05-23 14:14:23.000000000 +0200 +++ kdebase-3.4.2/kioslave/settings/kio_settings.cc 2005-09-09 18:53:35.000000000 +0200 @@ -30,7 +30,7 @@ #include <kservice.h> #include <kservicegroup.h> #include <kstandarddirs.h> - + class SettingsProtocol : public KIO::SlaveBase { public: @@ -51,6 +51,7 @@ private: extern "C" { KDE_EXPORT int kdemain( int, char **argv ) { + kdDebug() << "kdemain for settings kioslave" << endl; KInstance instance( "kio_settings" ); SettingsProtocol slave(argv[1], argv[2], argv[3]); @@ -98,7 +99,7 @@ static void createDirEntry(KIO::UDSEntry SettingsProtocol::SettingsProtocol( const QCString &protocol, const QCString &pool, const QCString &app): SlaveBase( protocol, pool, app ) { - // Adjusts which part of the K Menu to virtualize. + // Adjusts which part of the K Menu to virtualize. if ( protocol == "programs" ) m_runMode = ProgramsMode; else @@ -122,7 +123,17 @@ SettingsProtocol::~SettingsProtocol() KServiceGroup::Ptr SettingsProtocol::findGroup(const QString &relPath) { QString nextPart; + QString mdkMenu = KStandardDirs::menu_type_by_version(); + QString alreadyFound("Settings/"); + + if( mdkMenu == "mdk" ) + alreadyFound = QString::fromLatin1("System/Configuration/KDE/"); + else if( mdkMenu == "mdk-simplified") + alreadyFound = QString::fromLatin1("Administer Your System/Use More Administration Tools/Configuration/KDE/"); + else + alreadyFound = QString::fromLatin1("Settings/"); + QStringList rest = QStringList::split('/', relPath); kdDebug() << "Trying harder to find group " << relPath << endl; @@ -155,7 +166,7 @@ KServiceGroup::Ptr SettingsProtocol::fin } if (!found) { - kdDebug() << "Group with caption " << rest.front() << " not found within " + kdDebug() << "Group with caption " << rest.front() << " not found within " << alreadyFound << endl; return 0; } @@ -166,7 +177,7 @@ KServiceGroup::Ptr SettingsProtocol::fin void SettingsProtocol::get( const KURL & url ) { - KService::Ptr service = KService::serviceByDesktopName(url.fileName()); + KService::Ptr service = KService::serviceByDesktopName(url.fileName()); if (service && service->isValid()) { KURL redirUrl; redirUrl.setPath(locate("apps", service->desktopEntryPath())); @@ -174,7 +185,7 @@ void SettingsProtocol::get( const KURL & finished(); } else { error( KIO::ERR_IS_DIRECTORY, url.prettyURL() ); - } + } } @@ -184,12 +195,18 @@ void SettingsProtocol::stat(const KURL& QString servicePath( url.path(1) ); servicePath.remove(0, 1); // remove starting '/' + QString mdkMenu = KStandardDirs::menu_type_by_version(); if ( m_runMode == SettingsMode) - servicePath = "Settings/" + servicePath; - + { + if( mdkMenu == "mdk" ) + servicePath = "System/Configuration/KDE/"+ servicePath; + else if( mdkMenu == "mdk-simplified") + servicePath = "Administer Your System/Use More Administration Tools/Configuration/KDE/"+ servicePath; + else + servicePath = "Settings/" + servicePath; + } KServiceGroup::Ptr grp = KServiceGroup::group(servicePath); - if (grp && grp->isValid()) { createDirEntry(entry, (m_runMode == SettingsMode) ? i18n("Settings") : ( (m_runMode==ApplicationsMode) ? i18n("Applications") : i18n("Programs")), url.url(), "inode/directory",grp->icon() ); @@ -206,7 +223,7 @@ void SettingsProtocol::stat(const KURL& error(KIO::ERR_SLAVE_DEFINED,i18n("Unknown settings folder")); return; } - } + } statEntry(entry); finished(); @@ -218,9 +235,17 @@ void SettingsProtocol::listDir(const KUR { QString groupPath = url.path(1); groupPath.remove(0, 1); // remove starting '/' + QString mdkMenu = KStandardDirs::menu_type_by_version(); if ( m_runMode == SettingsMode) - groupPath.prepend("Settings/"); + { + if( mdkMenu == "mdk" ) + groupPath.prepend("System/Configuration/KDE/" ); + else if( mdkMenu == "mdk-simplified") + groupPath.prepend("Administer Your System/Use More Administration Tools/Configuration/KDE/" ); + else + groupPath.prepend("Settings/" ); + } KServiceGroup::Ptr grp = KServiceGroup::group(groupPath); @@ -234,7 +259,6 @@ void SettingsProtocol::listDir(const KUR unsigned int count = 0; KIO::UDSEntry entry; - KServiceGroup::List list = grp->entries(true, true); KServiceGroup::List::ConstIterator it; @@ -266,7 +290,12 @@ void SettingsProtocol::listDir(const KUR switch( m_runMode ) { case( SettingsMode ): - relPath.remove(0, 9); // length("Settings/") ==9 + if( mdkMenu == "mdk" ) + relPath.remove(0, 25); // length("Settings/") ==9 + else if( mdkMenu == "mdk-simplified") + relPath.remove(0, 71); // length("Settings/") ==9 + else + relPath.remove(0, 9); // length("Settings/") ==9 kdDebug() << "SettingsProtocol: adding entry settings:/" << relPath << endl; createDirEntry(entry, groupCaption, "settings:/"+relPath, "inode/directory",g->icon()); break;