Commit f4058bde authored by Laurent Montel's avatar Laurent Montel 😁

Use debug categories

parent f2905e80
...@@ -23,3 +23,4 @@ org.kde.pim.kmail_automaticaddcontactsplugin kdepim-addons (Automatic add contac ...@@ -23,3 +23,4 @@ org.kde.pim.kmail_automaticaddcontactsplugin kdepim-addons (Automatic add contac
org.kde.pim.kaddressbook_importexportgmx kdepim-addons (KAddressbook import export gmx plugin) org.kde.pim.kaddressbook_importexportgmx kdepim-addons (KAddressbook import export gmx plugin)
org.kde.pim.gnupgwks kdepim-addons (OpenPGP and GnuPG WKS body part formatter plugin) org.kde.pim.gnupgwks kdepim-addons (OpenPGP and GnuPG WKS body part formatter plugin)
org.kde.pim.imapfoldercompletion kdepim-addons (SieveEditor imap completion folder) org.kde.pim.imapfoldercompletion kdepim-addons (SieveEditor imap completion folder)
org.kde.pim.regexpeditorlineedit kdepim-addons (SieveEditor Regexp Editor plugin)
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
set(sieveeditorregexp_plugin_categories_SRCS)
ecm_qt_declare_logging_category(sieveeditorregexp_plugin_categories_SRCS HEADER regexpeditorlineeditplugin_debug.h IDENTIFIER
REGEXPEDITORLINEEDITPLUGIN_LOG CATEGORY_NAME org.kde.pim.regexpeditorlineedit)
if(BUILD_TESTING) if(BUILD_TESTING)
add_subdirectory(tests) add_subdirectory(tests)
add_subdirectory(autotests) add_subdirectory(autotests)
...@@ -8,6 +13,7 @@ endif() ...@@ -8,6 +13,7 @@ endif()
set(regexpeditorlineeditplugin_SRCS set(regexpeditorlineeditplugin_SRCS
regexpeditorlineedit.cpp regexpeditorlineedit.cpp
${sieveeditorregexp_plugin_categories_SRCS}
) )
kcoreaddons_add_plugin(regexpeditorlineeditplugin JSON regexepeditorlineedit.json SOURCES kcoreaddons_add_plugin(regexpeditorlineeditplugin JSON regexepeditorlineedit.json SOURCES
......
...@@ -7,4 +7,4 @@ macro(add_regexpeditorplugin_unittest _source _additional) ...@@ -7,4 +7,4 @@ macro(add_regexpeditorplugin_unittest _source _additional)
ecm_mark_as_test(sieveeditorplugin-${_name}) ecm_mark_as_test(sieveeditorplugin-${_name})
target_link_libraries( ${_name} Qt5::Widgets Qt5::Test KF5::I18n KF5::KSieveUi) target_link_libraries( ${_name} Qt5::Widgets Qt5::Test KF5::I18n KF5::KSieveUi)
endmacro () endmacro ()
add_regexpeditorplugin_unittest(regexpeditorlineedittest.cpp "../regexpeditorlineedit.cpp") add_regexpeditorplugin_unittest(regexpeditorlineedittest.cpp "../regexpeditorlineedit.cpp;${sieveeditorregexp_plugin_categories_SRCS}")
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include "regexpeditorlineedit.h" #include "regexpeditorlineedit.h"
#include "regexpeditorlineeditplugin_debug.h"
#include <kpluginfactory.h> #include <kpluginfactory.h>
#include <QStackedWidget> #include <QStackedWidget>
...@@ -57,7 +58,7 @@ RegexpEditorLineEdit::RegexpEditorLineEdit(QWidget *parent, const QList<QVariant ...@@ -57,7 +58,7 @@ RegexpEditorLineEdit::RegexpEditorLineEdit(QWidget *parent, const QList<QVariant
if (mRegexEditorInstalled) { if (mRegexEditorInstalled) {
connect(mRegExpEditorButton, &QPushButton::clicked, this, &RegexpEditorLineEdit::slotOpenRegexpEditor); connect(mRegExpEditorButton, &QPushButton::clicked, this, &RegexpEditorLineEdit::slotOpenRegexpEditor);
} else { } else {
qWarning() << "KRegExpEditor is not installed on system."; qCWarning(REGEXPEDITORLINEEDITPLUGIN_LOG) << "KRegExpEditor is not installed on system.";
} }
//Hidden by default //Hidden by default
mRegExpEditorButton->setVisible(false); mRegExpEditorButton->setVisible(false);
...@@ -70,6 +71,7 @@ RegexpEditorLineEdit::~RegexpEditorLineEdit() ...@@ -70,6 +71,7 @@ RegexpEditorLineEdit::~RegexpEditorLineEdit()
void RegexpEditorLineEdit::slotOpenRegexpEditor() void RegexpEditorLineEdit::slotOpenRegexpEditor()
{ {
QString error; QString error;
QDialog *editorDialog = KServiceTypeTrader::createInstanceFromQuery<QDialog>(QStringLiteral("KRegExpEditor/KRegExpEditor"), this, this, {}, {}, &error); QDialog *editorDialog = KServiceTypeTrader::createInstanceFromQuery<QDialog>(QStringLiteral("KRegExpEditor/KRegExpEditor"), this, this, {}, {}, &error);
qDebug() << " editorDialog"<<editorDialog; qDebug() << " editorDialog"<<editorDialog;
if ( editorDialog ) { if ( editorDialog ) {
...@@ -83,7 +85,7 @@ void RegexpEditorLineEdit::slotOpenRegexpEditor() ...@@ -83,7 +85,7 @@ void RegexpEditorLineEdit::slotOpenRegexpEditor()
mLineEdit->setText(iface->regExp()); mLineEdit->setText(iface->regExp());
} }
} else { } else {
qDebug() << " Impossible to create regexpeditor " << error; qCWarning(REGEXPEDITORLINEEDITPLUGIN_LOG) << " Impossible to create regexpeditor " << error;
} }
} }
......
...@@ -2,6 +2,7 @@ set(sieveeditor_regexpeditor_SRCS ...@@ -2,6 +2,7 @@ set(sieveeditor_regexpeditor_SRCS
main.cpp main.cpp
regexpeditorwidget.cpp regexpeditorwidget.cpp
../regexpeditorlineedit.cpp ../regexpeditorlineedit.cpp
${sieveeditorregexp_plugin_categories_SRCS}
) )
add_executable(sieveeditorregexpeditor_gui ${sieveeditor_regexpeditor_SRCS}) add_executable(sieveeditorregexpeditor_gui ${sieveeditor_regexpeditor_SRCS})
......
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