From kde-commits Sun Aug 31 23:09:48 2014 From: Jaroslaw Staniek Date: Sun, 31 Aug 2014 23:09:48 +0000 To: kde-commits Subject: [calligra/calligra/2.8] kexi/core: Avoid displaying actions for parts that do not create objects Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=140952659913908 Git commit f0f87484b05a02963ccac34f0b72b6954c2365f1 by Jaroslaw Staniek. Committed on 31/08/2014 at 22:41. Pushed by staniek into branch 'calligra/2.8'. Avoid displaying actions for parts that do not create objects Example: migration part. In 2.9 there's no such problem. M +1 -1 kexi/core/kexipartinfo.cpp M +1 -0 kexi/core/kexipartinfo.h http://commits.kde.org/calligra/f0f87484b05a02963ccac34f0b72b6954c2365f1 diff --git a/kexi/core/kexipartinfo.cpp b/kexi/core/kexipartinfo.cpp index 8aca138..f1b6d01 100644 --- a/kexi/core/kexipartinfo.cpp +++ b/kexi/core/kexipartinfo.cpp @@ -269,7 +269,7 @@ bool Info::isPropertyEditorAlwaysVisibleInDesignMode() = const = QString KexiPart::nameForCreateAction(const Info& info) { - return info.objectName() + "part_create"; + return info.isVisibleInNavigator() ? (info.objectName() + "part_create= ") : QString(); } = #include "kexipartinfo_p.moc" diff --git a/kexi/core/kexipartinfo.h b/kexi/core/kexipartinfo.h index c5c4a29..7121701 100644 --- a/kexi/core/kexipartinfo.h +++ b/kexi/core/kexipartinfo.h @@ -188,6 +188,7 @@ private: }; = /*! \return "create" KAction's name for part defined by \a info. + Empty string is returned if info.isVisibleInNavigator() is false. The result is like "tablepart_create". Used in Part::createGUIClients() and KexiBrowser. */ KEXICORE_EXPORT QString nameForCreateAction(const Info& info);