On Thursday 25 June 2009, Marco Martin wrote:
> b)mantain oxygen as "default" and just load air instead of oxygen at kde
> startup

and how will that work for krunner? kwin? put this in every application that 
should be using the global setting? that doesn't seem like a good idea.

it also means we have to keep Oxygen up to date with all items we create 
(otherwise there will be no fallback).

> c)have a fallbackTo=foo entry in themes desktop files making possible for
> themes to fallback to a desired theme (maybe kinda overkill and what
> happens when a 3rd party theme falls back to another 3rd party theme? or
> what happens when a theme falls back to an incomplete theme?)

this probably makes sense, but could be combined with:

d) in Plasma::Theme, make the fallback separate from the default theme. this 
way Oxygen could be the fallback, Air the default. we could also cover our 
bases and have it a cascading list of fallbacks, with Oxygen as the first 
fallback and Air the last so if an element appears in Air (our default) that 
doesn't appear in Oxygen, then we're still good. this will also preserve 
things for widgets that put their widgets in default/ (aka "Air")

see attached patch.

> soo, if we just make the default as air every time the default theme will
> change the same pain will repeat, if we keep oxygen  as the fallback theme
> we are condemned to keep it complete for ever (that sounds sensible
> anyways) but will be less painful for old themes even if someday another
> new default theme will be provided...

personally i think that themes that rely on a certain subset of elements in 
the fallback theme remaining consistent are operating on a delusion.

in future, they can use FallbackTheme= if that's what they assume. and we need 
a techbase article on this :)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

Index: theme.cpp
===================================================================
--- theme.cpp	(revision 984110)
+++ theme.cpp	(working copy)
@@ -136,6 +136,7 @@
 
     Theme *q;
     QString themeName;
+    QList<QString> fallbackThemes;
     KSharedConfigPtr colors;
     KColorScheme colorScheme;
     KColorScheme buttonColorScheme;
@@ -403,7 +404,21 @@
 
     cg = KConfigGroup(&metadata, "Settings");
     useNativeWidgetStyle = cg.readEntry("UseNativeWidgetStyle", false);
+    QString fallback = cg.readEntry("FallbackTheme", QString());
 
+    fallbackThemes.clear();
+    while (!fallback.isEmpty()) {
+        fallbackThemes.append(fallback);
+
+        QString metadataPath(KStandardDirs::locate("data", "desktoptheme/" + theme + "/metadata.desktop"));
+        KConfig metadata(metadataPath);
+        cg = KConfigGroup(&metadata, "Settings");
+        fallback = cg.readEntry("FallbackTheme", QString());
+        //TODO: grab the fallback's wallpaper defaults?
+    }
+    fallbackThemes.append("oxygen");
+    fallbackThemes.append(ThemePrivate::defaultTheme);
+
     QObject::disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
                         q, SLOT(colorsChanged()));
 
@@ -465,16 +480,20 @@
         // try for an uncompressed svg file
         path = d->findInTheme(name + ".svg", d->themeName);
 
-        if (path.isEmpty() && d->themeName != ThemePrivate::defaultTheme) {
-            // try a compressed svg file in the default theme
-            path = d->findInTheme(name + ".svgz", ThemePrivate::defaultTheme);
+        // search in fallback themes if necessary
+        for (int i = 0; path.isEmpty() && i < d->fallbackThemes.count(); ++i) {
+            if (d->themeName == d->fallbackThemes[i]) {
+                continue;
+            }
 
+            // try a compressed svg file in the fallback theme
+            path = d->findInTheme(name + ".svgz", d->fallbackThemes[i]);
+
             if (path.isEmpty()) {
-                // try an uncompressed svg file in the default theme
-                path = d->findInTheme(name + ".svg", ThemePrivate::defaultTheme);
+                // try an uncompressed svg file in the fallback theme
+                path = d->findInTheme(name + ".svg", d->fallbackThemes[i]);
             }
         }
-
     }
 
     if (path.isEmpty()) {

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to