[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    konsole patch
From:       Kurt Granroth <granroth () kde ! org>
Date:       1999-08-25 0:54:09
[Download RAW message or body]

Hello all,

A patch towards konsole (KDE_1_1_BRANCH) for your perusal.  This does
two things:

1) Finds schema files in the various .../apps/konsole dirs if it is not
   specified with an absolute path
2) Finds image files for schemas in various .../wallpapers dirs if it is
   not specified with an absolute path

Both of those changes are necessary if we hope to theme konsole.  As it is,
it is necessary to HARD-CODE paths.  Yech!

Can somebody else apply this if it looks reasonable?
-- 
Kurt Granroth            | granroth@kde.org
KDE Developer/Evangelist | http://www.pobox.com/~kurt_granroth
        KDE -- Putting a Friendly Face on Linux

["konsole.diff" (text/plain)]

Index: schema.C
===================================================================
RCS file: /home/kde/kdebase/konsole/src/schema.C,v
retrieving revision 1.4.2.1
diff -u -r1.4.2.1 schema.C
--- schema.C	1999/02/25 03:20:19	1.4.2.1
+++ schema.C	1999/08/25 00:37:19
@@ -13,6 +13,7 @@
 #include <stdio.h>
 #include "kapp.h"
 #include <qdir.h>
+#include <qfile.h>
 
 static int schema_serial = 0; //FIXME: remove,localize
 
@@ -56,8 +57,16 @@
           continue;
 
         // if this is not an absolute filename, prepend the wallpaper dir
-        if (path[0] != '/') res->imagepath = kapp->kde_wallpaperdir() + '/';
+        if (path[0] != '/') res->imagepath = kapp->localkdedir() + "/share/wallpapers/";
         res->imagepath += path;
+        if (QFile::exists(res->imagepath) == false)
+        {
+          // search for a global wallpaper
+          res->imagepath = kapp->kde_wallpaperdir() + '/';
+          res->imagepath += path;
+          if (QFile::exists(res->imagepath) == false)
+            res->imagepath = "";
+        }
         res->alignment = attr;
       }
       if (!strncmp(line,"color",5))
@@ -110,7 +119,20 @@
 
 ColorSchema* ColorSchema::find(const char* path)
 {
-  ColorSchema* res = path2schema.find(path);
+  ColorSchema* res = 0;
+  QString temp_path;
+
+  // search for a local schema first
+  if (path[0] != '/') temp_path = kapp->localkdedir() + "/share/apps/konsole/";
+  temp_path += path;
+  if (QFile::exists(temp_path) == true)
+    res = path2schema.find(temp_path.data());
+  else
+  {
+    temp_path = kapp->kde_datadir() + "/konsole/";
+    if (QFile::exists(temp_path) == true)
+      res = path2schema.find(temp_path.data());
+  }
   return res ? res : numb2schema.find(0);
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic