summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrell Anderson <humanreadable@yahoo.com>2013-08-17 20:31:38 -0500
committerDarrell Anderson <humanreadable@yahoo.com>2013-08-17 20:31:38 -0500
commit365f03061337a81bcffb4a45c4ad637edad27019 (patch)
treebc8bf3df607d88c0efc8efbde69bf98eb38f76ac
parent8825cf6535b4e3a920db1cc4a0e0228b4535bebf (diff)
downloadtdelibs-365f03061337a81bcffb4a45c4ad637edad27019.tar.gz
tdelibs-365f03061337a81bcffb4a45c4ad637edad27019.zip
Add compilation support to enable/disable
[KDE4] suffix in KDE4 menu items. This resolves bug report 1563.
-rw-r--r--CMakeLists.txt8
-rw-r--r--config.h.cmake3
-rw-r--r--tdeio/tdeio/kservice.cpp10
3 files changed, 17 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4e84a52ad..5a443a261 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,6 +94,7 @@ OPTION( WITH_NETWORK_MANAGER_BACKEND "Enable network-manager support" OFF )
OPTION( WITH_SUDO_TDESU_BACKEND "Use sudo as backend for tdesu (default is su)" OFF )
OPTION( WITH_OLD_XDG_STD "Use the pre R14.0.0 XDG standard where both TDE and KDE are recognized in desktop files" OFF )
OPTION( WITH_LZMA "Enable support for LZMA/XZ" ${WITH_ALL_OPTIONS} )
+OPTION( WITH_KDE4_MENU_SUFFIX "Add [KDE4] tag to KDE4 menu items" OFF )
OPTION( WITH_ASPELL "Enable aspell support" ${WITH_ALL_OPTIONS} )
OPTION( WITH_HSPELL "Enable hspell support" ${WITH_ALL_OPTIONS} )
@@ -838,6 +839,13 @@ if( WITH_NETWORK_MANAGER_BACKEND )
endif( WITH_NETWORK_MANAGER_BACKEND )
+##### Add '[KDE4]' to KDE4 menu items #########
+
+if( WITH_KDE4_MENU_SUFFIX )
+ set( KDE4_MENU_SUFFIX 1 )
+endif ( WITH_KDE4_MENU_SUFFIX )
+
+
##### check for gcc visibility support #########
# FIXME
# This should check for [T]Qt3 visibility support
diff --git a/config.h.cmake b/config.h.cmake
index 9d1ffa0c7..a0e3e92fd 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -65,6 +65,9 @@
/* Defines if lzma/xz is compiled */
#cmakedefine HAVE_XZ_SUPPORT 1
+/* Defines if '[KDE4]' is added to KDE4 menu items */
+#cmakedefine KDE4_MENU_SUFFIX 1
+
/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
#cmakedefine HAVE_CARBON_CARBON_H 1
diff --git a/tdeio/tdeio/kservice.cpp b/tdeio/tdeio/kservice.cpp
index bbcbed5c9..67031d06d 100644
--- a/tdeio/tdeio/kservice.cpp
+++ b/tdeio/tdeio/kservice.cpp
@@ -236,9 +236,11 @@ KService::init( KDesktopFile *config )
m_strComment = config->readComment();
entryMap.remove("Comment");
m_strGenName = config->readGenericName();
+#ifdef KDE4_MENU_SUFFIX
if (kde4application) {
m_strGenName += " [KDE4]";
}
+#endif
entryMap.remove("GenericName");
TQString untranslatedGenericName = config->readEntryUntranslated( "GenericName" );
if (!untranslatedGenericName.isEmpty())
@@ -496,12 +498,12 @@ public:
void reparseConfiguration() { }
- KEntryMap internalEntryMap( const TQString &pGroup) const
+ KEntryMap internalEntryMap( const TQString &pGroup) const
{ Q_UNUSED(pGroup); return KEntryMap(); }
KEntryMap internalEntryMap() const { return KEntryMap(); }
- void putData(const KEntryKey &_key, const KEntry& _data, bool _checkGroup)
+ void putData(const KEntryKey &_key, const KEntry& _data, bool _checkGroup)
{ Q_UNUSED(_key); Q_UNUSED(_data); Q_UNUSED(_checkGroup); }
KEntry lookupData(const KEntryKey &_key) const
@@ -771,10 +773,10 @@ bool KService::noDisplay() const {
return true;
#endif
}
-
+
if (!kapp->authorizeControlModule(d->menuId))
return true;
-
+
return false;
}