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

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

SVN commit 759746 by mlaurent:

Don't display switch menu entry when we have just on language on computer


 M  +8 -5      khelpmenu.cpp  


--- trunk/KDE/kdelibs/kdeui/widgets/khelpmenu.cpp #759745:759746
@@ -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