summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-10-10 08:53:03 +0200
committerMontel Laurent <[email protected]>2017-10-10 08:53:03 +0200
commit1a0a8526bf9e143282f8ebb53aca13a0650148fa (patch)
tree4d890fdf37a0da41b7ad105533fc311a39c0fc39
parente90dbdc0ab183c8045b12551dbe340f6a2e5574e (diff)
Allow to debug even if we build as release mode
-rw-r--r--src/kmkernel.cpp11
-rw-r--r--src/kmkernel.h4
-rw-r--r--src/kmmainwidget.cpp24
-rw-r--r--src/kmreadermainwin.cpp2
4 files changed, 17 insertions, 24 deletions
diff --git a/src/kmkernel.cpp b/src/kmkernel.cpp
index 0545eda..3793236 100644
--- a/src/kmkernel.cpp
+++ b/src/kmkernel.cpp
@@ -125,15 +125,10 @@ static bool s_askingToGoOnline = false;
/********************************************************************/
KMKernel::KMKernel(QObject *parent)
: QObject(parent)
- , mConfigureDialog(nullptr)
- , mMailService(nullptr)
- , mSystemNetworkStatus(true)
- , mSystemTray(nullptr)
- , mDebugAkonadiSearch(false)
{
//Initialize kmail sieveimap interface
KSieveUi::SieveImapInstanceInterfaceManager::self()->setSieveImapInstanceInterface(new KMailSieveImapInstanceInterface);
- mDebugAkonadiSearch = !qEnvironmentVariableIsEmpty("KDEPIM_DEBUGGING");
+ mDebug = !qEnvironmentVariableIsEmpty("KDEPIM_DEBUGGING");
mSystemNetworkStatus = PimCommon::NetworkManager::self()->networkConfigureManager()->isOnline();
@@ -1925,9 +1920,9 @@ FolderArchiveManager *KMKernel::folderArchiveManager() const
return mFolderArchiveManager;
}
-bool KMKernel::allowToDebugAkonadiSeachSupport() const
+bool KMKernel::allowToDebug() const
{
- return mDebugAkonadiSearch;
+ return mDebug;
}
bool KMKernel::firstStart() const
diff --git a/src/kmkernel.h b/src/kmkernel.h
index 45f8563..8e648cf 100644
--- a/src/kmkernel.h
+++ b/src/kmkernel.h
@@ -415,7 +415,7 @@ public:
void toggleSystemTray();
FolderArchiveManager *folderArchiveManager() const;
- bool allowToDebugAkonadiSeachSupport() const;
+ bool allowToDebug() const;
Akonadi::Search::PIM::IndexedItems *indexedItems() const;
@@ -535,7 +535,7 @@ private:
CheckIndexingManager *mCheckIndexingManager = nullptr;
Akonadi::Search::PIM::IndexedItems *mIndexedItems = nullptr;
MailCommon::MailCommonSettings *mMailCommonSettings = nullptr;
- bool mDebugAkonadiSearch = false;
+ bool mDebug = false;
};
#endif // _KMKERNEL_H
diff --git a/src/kmmainwidget.cpp b/src/kmmainwidget.cpp
index 374483d..88be060 100644
--- a/src/kmmainwidget.cpp
+++ b/src/kmmainwidget.cpp
@@ -53,10 +53,8 @@
#include "job/markallmessagesasreadinfolderandsubfolderjob.h"
#include "job/removeduplicatemessageinfolderandsubfolderjob.h"
#include "sieveimapinterface/kmsieveimappasswordprovider.h"
-#if !defined(NDEBUG)
#include <KSieveUi/SieveDebugDialog>
using KSieveUi::SieveDebugDialog;
-#endif
#include <AkonadiWidgets/CollectionMaintenancePage>
#include "collectionpage/collectionquotapage.h"
@@ -2242,11 +2240,11 @@ void KMMainWidget::slotEditVacation(const QString &serverName)
//-----------------------------------------------------------------------------
void KMMainWidget::slotDebugSieve()
{
-#if !defined(NDEBUG)
- QPointer<KSieveUi::SieveDebugDialog> mSieveDebugDialog = new KSieveUi::SieveDebugDialog(mSievePasswordProvider, this);
- mSieveDebugDialog->exec();
- delete mSieveDebugDialog;
-#endif
+ if (kmkernel->allowToDebug()) {
+ QPointer<KSieveUi::SieveDebugDialog> mSieveDebugDialog = new KSieveUi::SieveDebugDialog(mSievePasswordProvider, this);
+ mSieveDebugDialog->exec();
+ delete mSieveDebugDialog;
+ }
}
void KMMainWidget::slotConfigChanged()
@@ -2730,7 +2728,7 @@ void KMMainWidget::showMessagePopup(const Akonadi::Item &msg, const QUrl &url, c
menu.addSeparator();
menu.addAction(mMsgActions->addFollowupReminderAction());
- if (kmkernel->allowToDebugAkonadiSeachSupport()) {
+ if (kmkernel->allowToDebug()) {
menu.addSeparator();
menu.addAction(mMsgActions->debugAkonadiSearchAction());
}
@@ -2850,13 +2848,13 @@ void KMMainWidget::setupActions()
}
}
-#if !defined(NDEBUG)
{
- QAction *action = new QAction(i18n("&Debug Sieve..."), this);
- actionCollection()->addAction(QStringLiteral("tools_debug_sieve"), action);
- connect(action, &QAction::triggered, this, &KMMainWidget::slotDebugSieve);
+ if (kmkernel->allowToDebug()) {
+ QAction *action = new QAction(i18n("&Debug Sieve..."), this);
+ actionCollection()->addAction(QStringLiteral("tools_debug_sieve"), action);
+ connect(action, &QAction::triggered, this, &KMMainWidget::slotDebugSieve);
+ }
}
-#endif
{
QAction *action = new QAction(i18n("Filter &Log Viewer..."), this);
diff --git a/src/kmreadermainwin.cpp b/src/kmreadermainwin.cpp
index b275480..1126eb3 100644
--- a/src/kmreadermainwin.cpp
+++ b/src/kmreadermainwin.cpp
@@ -612,7 +612,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url
menu->addSeparator();
menu->addAction(mMsgActions->addFollowupReminderAction());
}
- if (kmkernel->allowToDebugAkonadiSeachSupport()) {
+ if (kmkernel->allowToDebug()) {
menu->addSeparator();
menu->addAction(mMsgActions->debugAkonadiSearchAction());
}