All pastes #764142 Raw Edit

Stuff

public text v1 · immutable
#764142 ·published 2007-11-06 23:46 UTC
rendered paste body
Index: kio/kio/slavebase.cpp
===================================================================
--- kio/kio/slavebase.cpp	(revision 733566)
+++ kio/kio/slavebase.cpp	(working copy)
@@ -974,8 +974,8 @@
         const MetaData::ConstIterator end = d->configData.constEnd();
         for (MetaData::ConstIterator it = d->configData.constBegin(); it != end; ++it)
             d->configGroup->writeEntry(it.key(), it->toUtf8(), KConfigGroup::WriteConfigFlags());
-	delete d->remotefile;
-	d->remotefile = 0;
+        delete d->remotefile;
+        d->remotefile = 0;
         break;
     }
     case CMD_GET:
Index: kio/kio/kfileshare.cpp
===================================================================
--- kio/kio/kfileshare.cpp	(revision 733566)
+++ kio/kio/kfileshare.cpp	(working copy)
@@ -88,10 +88,10 @@
   }
 }
 
-template <>
-KFileShare::ShareMode KConfigGroup::readEntry(const QByteArray &key, const KFileShare::ShareMode& aDefault) const
+KFileShare::ShareMode readEntry(const KConfigGroup &cg, const char* key, 
+	const KFileShare::ShareMode& aDefault)
 {
-    const QByteArray data=readEntry(key, QByteArray());
+    const QByteArray data=cg.readEntry(key, QByteArray());
 
     if (!data.isEmpty()) {
         if (data.toLower() == "simple")
@@ -129,7 +129,7 @@
             s_authorization = UserNotAllowed;
     }
 
-    s_shareMode = group.readEntry("SHARINGMODE", Simple);
+    s_shareMode = readEntry(group, "SHARINGMODE", Simple);
 
 
     s_sambaEnabled = group.readEntry("SAMBA", true);
Index: kio/kfile/kopenwithdialog.cpp
===================================================================
--- kio/kfile/kopenwithdialog.cpp	(revision 733566)
+++ kio/kfile/kopenwithdialog.cpp	(working copy)
@@ -52,12 +52,11 @@
 #include <kbuildsycocaprogressdialog.h>
 #include <kconfiggroup.h>
 
-template <> inline
-void KConfigGroup::writeEntry( const QByteArray &key,
-                              const KGlobalSettings::Completion& aValue,
-                              KConfigBase::WriteConfigFlags flags)
+inline void writeEntry( KConfigGroup& group, const char* key,
+                        const KGlobalSettings::Completion& aValue,
+                        KConfigBase::WriteConfigFlags flags = KConfigBase::Normal )
 {
-  writeEntry(key, int(aValue), flags);
+    group.writeEntry(key, int(aValue), flags);
 }
 
 class AppNode
@@ -564,12 +563,11 @@
     combo->setLineEdit(lineEdit);
     combo->setDuplicatesEnabled( false );
     KConfigGroup cg( KGlobal::config(), QString::fromLatin1("Open-with settings") );
-    int max = cg.readEntry( QString::fromLatin1("Maximum history"), 15 );
+    int max = cg.readEntry( "Maximum history", 15 );
     combo->setMaxCount( max );
-    int mode = cg.readEntry(QString::fromLatin1("CompletionMode"),
-				int(KGlobalSettings::completionMode()));
+    int mode = cg.readEntry( "CompletionMode", int(KGlobalSettings::completionMode()));
     combo->setCompletionMode((KGlobalSettings::Completion)mode);
-    QStringList list = cg.readEntry( QString::fromLatin1("History"), QStringList() );
+    QStringList list = cg.readEntry( "History", QStringList() );
     combo->setHistoryItems( list, true );
     edit = new KUrlRequester( combo, mainWidget );
   }
@@ -875,7 +873,7 @@
      desktop = new KDesktopFile(newPath);
   }
   KConfigGroup cg = desktop->desktopGroup();
-  cg.writeEntry("Type", QString::fromLatin1("Application"));
+  cg.writeEntry("Type", "Application");
   cg.writeEntry("Name", initialServiceName);
   cg.writePathEntry("Exec", fullExec);
   if (terminal->isChecked())
@@ -954,8 +952,8 @@
         combo->addToHistory(d->edit->url().url());
 
         KConfigGroup cg( KGlobal::config(), QString::fromLatin1("Open-with settings") );
-        cg.writeEntry( QString::fromLatin1("History"), combo->historyItems() );
-        cg.writeEntry(QString::fromLatin1("CompletionMode"), combo->completionMode());
+        cg.writeEntry( "History", combo->historyItems() );
+        writeEntry( cg, "CompletionMode", combo->completionMode() );
         // don't store the completion-list, as it contains all of KUrlCompletion's
         // executables
         cg.sync();