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 in= stanceless 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 =3D KexiMainWindowIface::global()->actionCollection()->ac= tion(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 t= his part could + * not create instances (e.g. CSV import) or if global structures such= as action + * collection are not (yet) set up. */ QAction* newObjectAction(); =