Sophie

Sophie

distrib > Mageia > 5 > x86_64 > by-pkgid > 39359d2c850920af1f87c6d71762d90a > files > 20

kdebase4-workspace-4.11.22-2.mga5.src.rpm

Index: plasma/desktop/applets/kickoff/core/models.cpp
===================================================================
--- kdebase-workspace/plasma/desktop/applets/kickoff/core/models.cpp	(révision 1085142)
+++ kdebase-workspace/plasma/desktop/applets/kickoff/core/models.cpp	(copie de travail)
@@ -143,7 +143,21 @@
     QStandardItem *appItem = new QStandardItem;
 
     QString genericName = service->genericName();
+    
     QString appName = service->name();
+    QString fromCustom = i18n( appName.toUtf8() );
+
+    if( ! fromCustom.isEmpty() && appName != fromCustom )
+        appName = fromCustom;
+    if( ! genericName.isEmpty() )
+    {
+        fromCustom = i18n( genericName.toUtf8() );
+        if( ! fromCustom.isEmpty() && genericName != fromCustom )
+            genericName = fromCustom;
+    }
+
+    QString teste = genericName.isEmpty() ? appName : genericName;
+ 
     bool nameFirst = displayOrder == NameBeforeDescription;
     appItem->setText(nameFirst || genericName.isEmpty() ? appName : genericName);
     appItem->setIcon(KIcon(service->icon()));
diff --git a/plasma/desktop/applets/kickoff/core/applicationmodel.cpp b/plasma/desktop/applets/kickoff/core/applicationmodel.cpp
index 57b6ba5..b754fbb 100644
--- a/plasma/desktop/applets/kickoff/core/applicationmodel.cpp
+++ b/plasma/desktop/applets/kickoff/core/applicationmodel.cpp
@@ -160,6 +160,10 @@ void ApplicationModelPrivate::fillNode(const QString &_relPath, AppNode *node)
         QString genericName;
         QString relPath = _relPath;
         QString desktopEntry;
+        // We do not want to see the menu entry Step translated by our menu-messages
+        // see https://bugs.mageia.org/show_bug.cgi?id=4078
+        QString clashName("Step") ;
+        
         bool isDir = false;
         bool isSeparator = false;
         const KSycocaEntry::Ptr p = (*it);
@@ -172,10 +176,21 @@ void ApplicationModelPrivate::fillNode(const QString &_relPath, AppNode *node)
             }
 
             icon = service->icon();
+            
             appName = service->name();
+            QString fromCustom = i18n( appName.toUtf8() );
+            if ( ! appName.isEmpty() && ! fromCustom.isEmpty() && appName != fromCustom && appName != clashName ) {
+                appName = fromCustom;
+            }
+            
             genericName = service->genericName();
-            desktopEntry = service->entryPath();
 
+            fromCustom = i18n( genericName.toUtf8() );
+            if ( ! genericName.isEmpty() && ! fromCustom.isEmpty() && genericName != fromCustom ) {
+                genericName = fromCustom;
+            }
+
+            desktopEntry = service->entryPath();
             // check for duplicates (eg. KDE 3 and KDE 4 versions of application
             // both present)
             if (duplicatePolicy == ApplicationModel::ShowLatestOnlyPolicy &&
@@ -229,10 +244,18 @@ void ApplicationModelPrivate::fillNode(const QString &_relPath, AppNode *node)
                 icon = iconNameMap().value(icon);
             }
 
+        appName = serviceGroup->comment();
+        QString fromCustom = i18n( appName.toUtf8() );
+        if( !appName.isEmpty() && ! fromCustom.isEmpty() && appName != fromCustom ) {
+            appName = fromCustom;
+        }
+        genericName = serviceGroup->caption();
+        fromCustom = i18n( genericName.toUtf8() );
+        if( ! fromCustom.isEmpty() && genericName != fromCustom ) {
+            genericName = fromCustom;
+        }
             desktopEntry = serviceGroup->entryPath();
-            genericName = serviceGroup->caption();
             relPath = serviceGroup->relPath();
-            appName = serviceGroup->comment();
             isDir = true;
         } else if (p->isType(KST_KServiceSeparator)) {
             isSeparator = true;