Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1494154
 поиск   регистрация   авторизация 
 
Группа :: Графические оболочки/KDE
Пакет: kdegames

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: kpat-3.2.3-fix-find-wallpaper.patch


--- kdegames-3.2.3/kpat/pwidget.cpp~	2004-07-05 20:48:51 +0400
+++ kdegames-3.2.3/kpat/pwidget.cpp	2004-07-06 16:05:03 +0400
@@ -101,15 +101,17 @@ pWidget::pWidget()
     games->setItems(list);
 
     KGlobal::dirs()->addResourceType("wallpaper", KStandardDirs::kde_default("data") + "ksnake/backgrounds/");
+    KGlobal::dirs()->addResourceType("wallpaper", "share/artworks/backgrounds/");
     wallpapers = new KSelectAction(i18n("&Change Background"), 0, this,
                               SLOT(changeWallpaper()),
                               actionCollection(), "wallpaper");
     list.clear();
     wallpaperlist = KGlobal::dirs()->findAllResources("wallpaper", "*.jpg", false, true, list);
+    wallpaperlist += KGlobal::dirs()->findAllResources("wallpaper", "*.png", false, true, list);
     for (QStringList::Iterator it = list.begin(); it != list.end(); ++it)
         *it = (*it).left((*it).length() - 4);
     wallpapers->setItems(list);
-    wallpapers->setCurrentItem(list.findIndex("No-Ones-Laughing-3"));
+    wallpapers->setCurrentItem( list.findIndex("default") );
 
     changeWallpaper();
 
@@ -132,7 +134,7 @@ pWidget::pWidget()
     QString bgpath = config->readPathEntry("Background");
     kdDebug() << "bgpath '" << bgpath << "'" << endl;
     if (bgpath.isEmpty())
-        bgpath = locate("wallpaper", "No-Ones-Laughing-3.jpg");
+        bgpath = locate("wallpaper", "default.png");
     background = QPixmap(bgpath);
 
     bool animate = config->readBoolEntry( "Animation", true);
@@ -213,7 +215,12 @@ void pWidget::changeWallpaper()
 {
     QString bgpath=locate("wallpaper", wallpaperlist[wallpapers->currentItem()]);
     if (bgpath.isEmpty())
-        return;
+    {
+	if( wallpaperlist.count() > 0 )
+    	    bgpath=locate("wallpaper", wallpaperlist[0]);
+	else
+	    return;
+    }
     background = QPixmap(bgpath);
     if (background.isNull()) {
         KMessageBox::sorry(this, i18n("<qt>Couldn't load wallpaper<br/>%1</qt>").arg(bgpath));
 
design & coding: Vladimir Lettiev aka crux © 2004-2005