From kde-commits Fri Jan 11 09:20:21 2008 From: Laurent Montel Date: Fri, 11 Jan 2008 09:20:21 +0000 To: kde-commits Subject: branches/KDE/4.0/kdelibs/kdeui/widgets Message-Id: <1200043221.637904.17265.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=120004322922266 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 #include #include +#include #include #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)