Blob Blame History Raw
diff -ur kdebase-workspace-4.0.85/libs/plasma/theme.cpp kdebase-workspace-4.0.85-plasma-default-wallpaper/libs/plasma/theme.cpp
--- kdebase-workspace-4.0.85/libs/plasma/theme.cpp	2008-07-03 07:05:35.000000000 +0200
+++ kdebase-workspace-4.0.85-plasma-default-wallpaper/libs/plasma/theme.cpp	2008-07-09 23:16:58.000000000 +0200
@@ -94,6 +94,7 @@
     KSharedConfigPtr colors;
     KConfigGroup cfg;
     QFont generalFont;
+    QString globalDefaultWallpaper;
     QString defaultWallpaperTheme;
     QString defaultWallpaperSuffix;
     int defaultWallpaperWidth;
@@ -235,6 +236,10 @@
     //kDebug() << "we're going for..." << colorsFile << "*******************";
 
     // load the wallpaper settings, if any
+    KSharedConfigPtr config = KSharedConfig::openConfig("plasmarc");
+    KConfigGroup group = KConfigGroup(config, "Defaults");
+    d->globalDefaultWallpaper = group.readEntry("wallpaper", (const char *) 0);
+
     KConfig metadata(KStandardDirs::locate("data", "desktoptheme/" + theme + "/metadata.desktop"));
     KConfigGroup cg;
     if (metadata.hasGroup("Wallpaper")) {
@@ -247,8 +252,8 @@
         cg = d->config();
     }
 
-    d->defaultWallpaperTheme = cg.readEntry("defaultWallpaperTheme", DEFAULT_WALLPAPER_THEME);
-    d->defaultWallpaperSuffix = cg.readEntry("defaultFileSuffix", DEFAULT_WALLPAPER_SUFFIX);
+    d->defaultWallpaperTheme = cg.readEntry("defaultWallpaperTheme", d->globalDefaultWallpaper.isEmpty() ? DEFAULT_WALLPAPER_THEME : (const char *) 0);
+    d->defaultWallpaperSuffix = cg.readEntry("defaultFileSuffix", d->globalDefaultWallpaper.isEmpty() ? DEFAULT_WALLPAPER_SUFFIX : (const char *) 0);
     d->defaultWallpaperWidth = cg.readEntry("defaultWidth", DEFAULT_WALLPAPER_WIDTH);
     d->defaultWallpaperHeight = cg.readEntry("defaultHeight", DEFAULT_WALLPAPER_HEIGHT);
 
@@ -300,7 +305,10 @@
     QString fullPath;
     QString image = d->defaultWallpaperTheme;
 
-    image.append("/contents/images/%1x%2").append(d->defaultWallpaperSuffix);
+    if (image.isEmpty() && !d->globalDefaultWallpaper.isEmpty())
+        image = d->globalDefaultWallpaper;
+    else
+        image.append("/contents/images/%1x%2").append(d->defaultWallpaperSuffix);
     QString defaultImage = image.arg(d->defaultWallpaperWidth).arg(d->defaultWallpaperHeight);
 
     if (size.isValid()) {