LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File plasma-branding-defaults-applets.diff of Package kdebase4-workspace (Project openSUSE:11.4)

Index: plasma/desktop/applets/kickoff/applet/applet.cpp
===================================================================
--- plasma/desktop/applets/kickoff/applet/applet.cpp.orig	2010-11-05 11:47:50.000000000 +0100
+++ plasma/desktop/applets/kickoff/applet/applet.cpp	2010-11-21 20:47:03.734717865 +0100
@@ -27,6 +27,7 @@
 #include <QtGui/QVBoxLayout>
 #include <QtGui/QLabel>
 #include <QtGui/QGraphicsLinearLayout>
+#include <QFile>
 
 // KDE
 #include <KAuthorized>
@@ -188,7 +189,10 @@ void LauncherApplet::toolTipAboutToShow(
 void LauncherApplet::configChanged()
 {
     KConfigGroup cg = config();
-    setPopupIcon(cg.readEntry("icon", "start-here-kde"));
+    if (QFile::exists("/usr/share/icons/oxygen/scalable/places/start-here-branding.svg"))
+      setPopupIcon(cg.readEntry("icon", "start-here-branding"));
+    else
+      setPopupIcon(cg.readEntry("icon", "start-here-kde"));
     constraintsEvent(Plasma::ImmutableConstraint);
 
     if (d->launcher) {
@@ -207,7 +211,12 @@ void LauncherApplet::configAccepted()
     d->createLauncher();
 
     KConfigGroup cg = config();
-    const QString oldIcon = cg.readEntry("icon", "start-here-kde");
+    QString oldIcon;
+    if (QFile::exists("/usr/share/icons/oxygen/scalable/places/start-here-branding.svg"))
+      oldIcon = cg.readEntry("icon", "start-here-branding");
+    else
+      oldIcon = cg.readEntry("icon", "start-here-kde");
+    
     if (!iconname.isEmpty() && iconname != oldIcon) {
         cg.writeEntry("icon", iconname);
 
Index: plasma/desktop/applets/kickoff/core/favoritesmodel.cpp
===================================================================
--- plasma/desktop/applets/kickoff/core/favoritesmodel.cpp.orig	2010-05-27 19:23:43.000000000 +0200
+++ plasma/desktop/applets/kickoff/core/favoritesmodel.cpp	2010-11-21 20:47:03.735718347 +0100
@@ -167,6 +167,11 @@ FavoritesModel::~FavoritesModel()
 
 void FavoritesModel::add(const QString& url)
 {
+	KService::Ptr service = KService::serviceByStorageId(url);
+	if (!service) {
+		return;
+	}
+
     Private::globalFavoriteList << url;
     Private::globalFavoriteSet << url;
 
Index: plasma/desktop/applets/kickoff/core/models.cpp
===================================================================
--- plasma/desktop/applets/kickoff/core/models.cpp.orig	2009-10-15 18:33:38.000000000 +0200
+++ plasma/desktop/applets/kickoff/core/models.cpp	2010-11-21 20:47:03.735718347 +0100
@@ -177,7 +177,19 @@ QStringList Kickoff::systemApplicationLi
 {
     KConfigGroup appsGroup = componentData().config()->group("SystemApplications");
     QStringList apps;
-    apps << "systemsettings";
+
+	if (QFile::exists("/usr/share/applications/YaST.desktop"))
+    	apps << "YaST.desktop";
+
+	if (QFile::exists("/usr/share/applications/package-manager.desktop"))
+    	apps << "package-manager.desktop";
+
+	if (KService::serviceByStorageId("YaST2/live-installer.desktop"))
+	    apps << "YaST2/live-installer.desktop";
+
+	if (QFile::exists("/usr/share/kde4/services/sysinfo.protocol"))
+	    apps << "/usr/share/kde4/services/sysinfo.protocol";
+
     apps = appsGroup.readEntry("DesktopFiles", apps);
     return apps;
 }
Index: plasma/desktop/applets/kickoff/core/systemmodel.cpp
===================================================================
--- plasma/desktop/applets/kickoff/core/systemmodel.cpp.orig	2010-04-15 10:59:33.000000000 +0200
+++ plasma/desktop/applets/kickoff/core/systemmodel.cpp	2010-11-21 20:47:03.736717501 +0100
@@ -81,7 +81,7 @@ public:
         connect(placesModel, SIGNAL(rowsRemoved(QModelIndex, int, int)),
                 q, SLOT(sourceRowsRemoved(QModelIndex, int, int)));
 
-        topLevelSections << i18n("Applications")
+        topLevelSections << i18n("Administration")
         << i18n("Places")
         << i18n("Removable Storage")
         << i18n("Storage");
@@ -225,19 +225,33 @@ QVariant SystemModel::data(const QModelI
         }
 
         KService::Ptr service = d->appsList[index.row()];
-
-        switch (role) {
-        case Qt::DisplayRole:
-            return service->name();
-        case Qt::DecorationRole:
-            return KIcon(service->icon());
-        case SubTitleRole:
-            return service->genericName();
-        case UrlRole:
-            return service->entryPath();
-        default:
-            return QVariant();
-        }
+		if (service->name()=="sysinfo") {
+			switch(role) {
+				case Qt::DisplayRole:
+		            return i18n("System Information");
+				case Qt::DecorationRole:
+		            return KIcon("hwinfo");
+				case SubTitleRole:
+		            return "sysinfo:/";
+				case UrlRole:
+		            return "sysinfo:/";
+				default:
+		            return QVariant();
+			}
+		} else {
+	        switch (role) {
+		        case Qt::DisplayRole:
+		            return service->name();
+		        case Qt::DecorationRole:
+		            return KIcon(service->icon());
+		        case SubTitleRole:
+		            return service->genericName();
+		        case UrlRole:
+		            return service->entryPath();
+		        default:
+        		    return QVariant();
+	        }
+		}
     }
 
     if (role == UrlRole && !d->placesModel->isHidden(mapToSource(index))) {
Index: plasma/desktop/applets/kickoff/simpleapplet/simpleapplet.cpp
===================================================================
--- plasma/desktop/applets/kickoff/simpleapplet/simpleapplet.cpp.orig	2010-11-19 11:51:20.000000000 +0100
+++ plasma/desktop/applets/kickoff/simpleapplet/simpleapplet.cpp	2010-11-21 20:47:03.737717526 +0100
@@ -36,6 +36,7 @@
 #include <QtGui/QSpacerItem>
 #include <QtGui/QListWidget>
 #include <QtGui/QListWidgetItem>
+#include <QFile>
 
 // KDE Libs
 #include <KActionCollection>
@@ -305,7 +306,10 @@ MenuLauncherApplet::MenuLauncherApplet(Q
                 d->viewtypes << "RunCommand";
             }
             d->viewtypes << "Leave";
-            d->iconname = "start-here-kde";
+            if (QFile::exists("/usr/share/icons/oxygen/scalable/places/start-here-branding.svg"))
+                d->iconname = "start-here-branding";
+            else
+                d->iconname = "start-here-kde";
         }
     }
     d->formattype = NameDescription;
Index: plasma/desktop/applets/kickoff/ui/brandingbutton.cpp
===================================================================
--- plasma/desktop/applets/kickoff/ui/brandingbutton.cpp.orig	2009-09-16 13:40:52.000000000 +0200
+++ plasma/desktop/applets/kickoff/ui/brandingbutton.cpp	2010-11-21 20:47:03.737717526 +0100
@@ -69,7 +69,10 @@ void BrandingButton::checkBranding()
 void BrandingButton::openHomepage()
 {
     //FIXME: 4.3 .. add a brandingConfig to Theme
-    KUrl home("http://www.kde.org");
+    KConfig config("kickoffrc");
+	KConfigGroup group = config.group("Branding");
+	KUrl home(group.readEntry("Homepage", "http://www.kde.org/"));
+
     QString themePath = KStandardDirs::locate("data", "desktoptheme/" +
                                               Plasma::Theme::defaultTheme()->themeName() +
                                               "/metadata.desktop");