Blob Blame History Raw
Index: kinit.cpp
===================================================================
--- kinit/kinit.cpp	(revision 829264)
+++ kinit/kinit.cpp	(revision 828077)
@@ -49,10 +49,9 @@
 #include <QtCore/QTextStream>
 #include <QtCore/QRegExp>
 #include <QtGui/QFont>
-#include <QDir>
 #include <kcomponentdata.h>
 #include <kstandarddirs.h>
-#include <kconfiggroup.h>
+#include <kglobalsettings.h>
 #include <kglobal.h>
 #include <kconfig.h>
 #include <klibloader.h>
@@ -530,17 +529,8 @@
      if (cwd && *cwd)
         chdir(cwd);
      else {
-         // Can't use KGlobalSettings::documentPath() here, we don't have a main component set,
-         // and we don't want to set one; e.g. kioslaves will do that.
-         // So we have to duplicate this stuff from KGlobalSettings.
-         KConfigGroup g(s_instance->config(), "Paths");
-         const QString documentPath = g.readPathEntry("Documents",
-#ifdef Q_WS_WIN
-                                                       getWin32ShellFoldersPath("Personal")
-#else
-                                                       QDir::homePath());
-#endif
-         const QByteArray docPath = QFile::encodeName(documentPath);
+         KComponentData componentData("klauncher"); // needed for KConfig usage
+         const QByteArray docPath = QFile::encodeName(KGlobalSettings::documentPath());
          chdir(docPath.constData());
      }