Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 1a0a8526 authored by Laurent Montel's avatar Laurent Montel 😁

Allow to debug even if we build as release mode

parent e90dbdc0
......@@ -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
......
......@@ -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
......@@ -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);
......
......@@ -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());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment