[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.0/kdelibs/kdeui/widgets
From:       Laurent Montel <montel () kde ! org>
Date:       2008-01-11 9:20:21
Message-ID: 1200043221.637904.17265.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 759747 by mlaurent:

Backport: don't add switch language menu when we have just one language on computer


 M  +8 -5      khelpmenu.cpp  


--- branches/KDE/4.0/kdelibs/kdeui/widgets/khelpmenu.cpp #759746:759747
@@ -47,6 +47,7 @@
 #include <kstandardguiitem.h>
 #include <kswitchlanguagedialog_p.h>
 #include <ktoolinvocation.h>
+#include <kstandarddirs.h>
 
 #include <config.h>
 #ifdef Q_WS_X11
@@ -134,7 +135,6 @@
   delete d;
 }
 
-
 KMenu* KHelpMenu::menu()
 {
   if( !d->mMenu )
@@ -175,10 +175,13 @@
 
     if (KAuthorized::authorizeKAction("switch_application_language"))
     {
-      if (need_separator)
-        d->mMenu->addSeparator();
-      d->mSwitchApplicationLanguageAction = d->mMenu->addAction( i18n( "Switch \
                Application &Language..." ), this, SLOT(switchApplicationLanguage()) \
                );
-      need_separator = true;
+      if((KGlobal::dirs()->findAllResources("locale", \
QString::fromLatin1("*/entry.desktop"))).count() > 1) +      {
+        if (need_separator)
+          d->mMenu->addSeparator();
+        d->mSwitchApplicationLanguageAction = d->mMenu->addAction( i18n( "Switch \
Application &Language..." ), this, SLOT(switchApplicationLanguage()) ); +        \
need_separator = true; +      }
     }
 
     if (need_separator)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic