[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kexi] src/core: GIT_SILENT KexiPart::Info::newObjectAction(): don't warn when called for instancele
From: Jaroslaw Staniek <staniek () kde ! org>
Date: 2016-02-29 23:12:21
Message-ID: E1aaWzF-0000sv-Iq () scm ! kde ! org
[Download RAW message or body]
Git commit f432b3fac6900d103345f4b5405d42e5222f359b by Jaroslaw Staniek.
Committed on 29/02/2016 at 23:07.
Pushed by staniek into branch 'master'.
GIT_SILENT KexiPart::Info::newObjectAction(): don't warn when called for instanceless \
part
(from calligra.git)
M +5 -4 src/core/kexipartinfo.cpp
M +3 -0 src/core/kexipartinfo.h
http://commits.kde.org/kexi/f432b3fac6900d103345f4b5405d42e5222f359b
diff --git a/src/core/kexipartinfo.cpp b/src/core/kexipartinfo.cpp
index f8340af..d788c39 100644
--- a/src/core/kexipartinfo.cpp
+++ b/src/core/kexipartinfo.cpp
@@ -191,10 +191,11 @@ bool Info::isPropertyEditorAlwaysVisibleInDesignMode() const
QAction* Info::newObjectAction()
{
- if (!KexiMainWindowIface::global() || \
!KexiMainWindowIface::global()->actionCollection()
- || !isVisibleInNavigator())
- {
- qWarning();
+ if (!isVisibleInNavigator()) {
+ return 0;
+ }
+ if (!KexiMainWindowIface::global() || \
!KexiMainWindowIface::global()->actionCollection()) { + qWarning() << "Missing \
Kexi's global action collection"; return 0;
}
QAction *act = KexiMainWindowIface::global()->actionCollection()->action(nameForCreateAction(*this));
diff --git a/src/core/kexipartinfo.h b/src/core/kexipartinfo.h
index 7f8ae30..2a57a45 100644
--- a/src/core/kexipartinfo.h
+++ b/src/core/kexipartinfo.h
@@ -134,6 +134,9 @@ public:
/**
* @return "New object" action for this part.
+ * @return "New object" action for this part. nullptr is returned if this part \
could + * not create instances (e.g. CSV import) or if global structures such as \
action + * collection are not (yet) set up.
*/
QAction* newObjectAction();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic