Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37344970
en ru br
Репозитории ALT

Группа :: Графические оболочки/KDE
Пакет: kde5-khelpcenter

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: khelpcenter-alt-hide-top-level-menu-without-children.patch
Скачать


From edfd68e87dcbaa0e594402cd94cfea727d7399eb Mon Sep 17 00:00:00 2001
From: Aleksei Nikiforov <darktemplar@altlinux.org>
Date: Fri, 14 Feb 2020 16:24:49 +0300
Subject: [PATCH] Hide top level menu items if they have no children
---
 khelpcenter/navigator.cpp | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/khelpcenter/navigator.cpp b/khelpcenter/navigator.cpp
index 770ef3fc..db927dfa 100644
--- a/khelpcenter/navigator.cpp
+++ b/khelpcenter/navigator.cpp
@@ -216,13 +216,17 @@ History                 no X-KDE-PluginKeyword in kcmhistory.desktop
     list = KServiceTypeTrader::self()->query( QStringLiteral("KCModule"), QStringLiteral("[X-KDE-ParentApp] == 'kinfocenter'") );
   }
 
+  bool no_children_present = true;
+
   for ( KService::List::const_iterator it = list.constBegin(); it != list.constEnd(); ++it )
   {
     KService::Ptr s(*it);
     QString desktopFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("kservices5/") + s->entryPath() );
     createItemFromDesktopFile( topItem, desktopFile );
+    no_children_present = false;
     }
     topItem->sortChildren( 0, Qt::AscendingOrder /* ascending */ );
+    topItem->setHidden(no_children_present);
 }
 
 void Navigator::insertIOSlaveDocs( const QString &name, NavigatorItem *topItem )
-- 
2.24.1
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin