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