From 14cd57f54a9228241204e230df715139bf922fc5 Mon Sep 17 00:00:00 2001
From: Francois Andriot <francois.andriot@free.fr>
Date: Thu, 9 May 2013 19:05:10 +0200
Subject: Kickoff menu: Adds a distribution-specific link in 'computer' tab

---
 CMakeLists.txt                 | 21 +++++++++++++++++++++
 config.h.cmake                 |  4 ++++
 kicker/kicker/ui/k_new_mnu.cpp |  9 +++++++++
 3 files changed, 34 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ff608393..df16178e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -278,6 +278,27 @@ else()
   message( STATUS "Selected man-db for tdeio-man on your system" )
 endif()
 
+##### Checks for a distribution-specific 1st menu item, generally a control center
+if(EXISTS "/usr/share/applications/YaST.desktop")
+  set( KICKOFF_DIST_CONFIG_SHORTCUT1 "/usr/share/applications/YaST.desktop" )
+endif()
+if(EXISTS "/usr/share/applications/mageia-drakconf.desktop")
+  set( KICKOFF_DIST_CONFIG_SHORTCUT1 "/usr/share/applications/mageia-drakconf.desktop" )
+endif()
+if(EXISTS "/usr/share/applications/pclinuxos-drakconf.desktop")
+  set( KICKOFF_DIST_CONFIG_SHORTCUT1 "/usr/share/applications/pclinuxos-drakconf.desktop" )
+endif()
+if(EXISTS "/usr/share/applications/mandriva-drakconf.desktop")
+  set( KICKOFF_DIST_CONFIG_SHORTCUT1 "/usr/share/applications/mandriva-drakconf.desktop" )
+endif()
+
+##### Checks for a distribution-specific 2nd menu item, generally a shortcut to graphical package manager
+if(EXISTS "/usr/share/applications/package-manager.desktop")
+  set( KICKOFF_DIST_CONFIG_SHORTCUT2 "/usr/share/applications/package-manager.desktop" )
+endif()
+if(EXISTS "/usr/share/applications/rpmdrake.desktop")
+  set( KICKOFF_DIST_CONFIG_SHORTCUT2 "/usr/share/applications/rpmdrake.desktop" )
+endif()
 
 ##### write configure files #####################
 
diff --git a/config.h.cmake b/config.h.cmake
index 282e3a80d..4fbb33915 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -195,3 +195,7 @@
 
 // Use makewhatis manpage support
 #cmakedefine WITH_MAKEWHATIS "@WITH_MAKEWHATIS@"
+
+// Kickoff menu
+#cmakedefine KICKOFF_DIST_CONFIG_SHORTCUT1 "@KICKOFF_DIST_CONFIG_SHORTCUT1@"
+#cmakedefine KICKOFF_DIST_CONFIG_SHORTCUT2 "@KICKOFF_DIST_CONFIG_SHORTCUT2@"
diff --git a/kicker/kicker/ui/k_new_mnu.cpp b/kicker/kicker/ui/k_new_mnu.cpp
index e2ecf40cb..24d751a33 100644
--- a/kicker/kicker/ui/k_new_mnu.cpp
+++ b/kicker/kicker/ui/k_new_mnu.cpp
@@ -1342,6 +1342,15 @@ void KMenu::insertStaticItems()
 
     m_systemView->insertSeparator( nId++, i18n("Applications"), index++);
 
+#ifdef KICKOFF_DIST_CONFIG_SHORTCUT1
+    KService::Ptr kdcs1 = KService::serviceByStorageId(KICKOFF_DIST_CONFIG_SHORTCUT1);
+    m_systemView->insertMenuItem(kdcs1, nId++, index++);
+#endif
+#ifdef KICKOFF_DIST_CONFIG_SHORTCUT2
+    KService::Ptr kdcs2 = KService::serviceByStorageId(KICKOFF_DIST_CONFIG_SHORTCUT2);
+    m_systemView->insertMenuItem(kdcs2, nId++, index++);
+#endif
+
     KService::Ptr p = KService::serviceByStorageId("KControl.desktop");
     m_systemView->insertMenuItem(p, nId++, index++);
 
-- 
cgit v1.2.1