Browse Source

Don't hardcode ~/.kde for localkdedir (KDEHOME).

git-svn-id: file:///var/svn/tigccpp/branches/ktigcc-1-branch@1031 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 17 years ago
parent
commit
ab9d923d33
2 changed files with 9 additions and 6 deletions
  1. 2 1
      ktigcc/NEWS
  2. 7 5
      ktigcc/preferences.cpp

+ 2 - 1
ktigcc/NEWS

@@ -1,12 +1,13 @@
 This is a summary of the changes in KTIGCC since the first alpha release:
 
-CVS ktigcc-1-branch (2007-02-26):
+CVS ktigcc-1-branch (2007-03-02):
 
 * Added a full changelog (generated from CVS logs).
 * Fixed stray indentation at the end of the line when autoclosing a curly brace
   as ENTER is pressed.
 * Fixed highlighting update when moving a file to Header Files from another
   editable category. (The first character was read from the wrong buffer.)
+* Don't hardcode ~/.kde for the KDEHOME directory.
 
 
 KTIGCC 1.06 (2006-11-25):

+ 7 - 5
ktigcc/preferences.cpp

@@ -1,7 +1,7 @@
 /*
    ktigcc - TIGCC IDE for KDE
 
-   Copyright (C) 2004-2006 Kevin Kofler
+   Copyright (C) 2004-2007 Kevin Kofler
    Copyright (C) 2006 Joey Adams
 
    This program is free software; you can redistribute it and/or modify
@@ -27,6 +27,8 @@
 #include <kapplication.h>
 #include <kcmdlineargs.h>
 #include <kaboutdata.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
 #include <qtextcodec.h>
 #include <qcolor.h>
 #include <qfont.h>
@@ -413,8 +415,8 @@ static void writeSyntaxXML(const Syn_SettingsForDoc &synprefs,
   #undef CHILD_NODE
 
   // Write it to disk.
-  QString xmlFileName=QString("%1/.kde/share/apps/katepart/syntax/ktigcc%2.xml")
-                      .arg(QDir::homeDirPath()).arg(internalName);
+  QString xmlFileName=QString("%1/share/apps/katepart/syntax/ktigcc%2.xml")
+                      .arg(KGlobal::dirs()->localkdedir()).arg(internalName);
   mkdir_multi(xmlFileName);
   std::FILE *f=std::fopen(xmlFileName,"w");
   if (f) {
@@ -455,8 +457,8 @@ static bool isNewerVersion(const QString &version1, const QString &version2)
 
 static bool checkSynHighlightVersion(const QString &internalName)
 {
-  QString xmlFileName=QString("%1/.kde/share/apps/katepart/syntax/ktigcc%2.xml")
-                      .arg(QDir::homeDirPath()).arg(internalName);
+  QString xmlFileName=QString("%1/share/apps/katepart/syntax/ktigcc%2.xml")
+                      .arg(KGlobal::dirs()->localkdedir()).arg(internalName);
   QDomDocument doc("language");
   QFile file(xmlFileName);
   if (!file.open(IO_ReadOnly))