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

Port to debug categories

parent 92e2b220
......@@ -15,6 +15,8 @@ include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
# KDE Application Version, managed by release script
set (KDE_APPLICATIONS_VERSION_MAJOR "17")
......@@ -37,4 +39,6 @@ add_subdirectory(src)
add_subdirectory(icons)
add_subdirectory(doc)
install( FILES kfind.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
org.kde.pim.sieveeditor sieveeditor (sieveeditor)
set(kfind_SRCS main.cpp
kfinddlg.cpp
kftabdlg.cpp
kquery.cpp
kfindtreeview.cpp)
ecm_qt_declare_logging_category(kfind_SRCS HEADER kfind_debug.h IDENTIFIER
KFING_LOG CATEGORY_NAME org.kde.kfind)
file(GLOB ICONS_SRCS "../icons/*-apps-kfind.png")
ecm_add_app_icon(kfind_SRCS ICONS ${ICONS_SRCS})
......
......@@ -24,7 +24,6 @@
#include <KLocalizedString>
#include <kstatusbar.h>
#include <kmessagebox.h>
#include <QDebug>
#include <kaboutapplicationdialog.h>
#include <khelpmenu.h>
#include <qmenu.h>
......@@ -205,7 +204,6 @@ void KfindDlg::slotResult(int errorCode)
setStatusMsg(i18n("Error."));
KMessageBox::sorry(this, i18n("Could not find the specified folder."));
} else {
//qDebug()<<"KIO error code: "<<errorCode;
setStatusMsg(i18n("Error."));
}
......@@ -249,8 +247,6 @@ void KfindDlg::about()
void KfindDlg::slotDeleteItem(const QString &file)
{
//qDebug()<<QString("Will remove one item: %1").arg(file);
win->removeItem(QUrl::fromLocalFile(file));
const QString str = i18np("one file found", "%1 files found", win->itemCount());
......@@ -259,7 +255,6 @@ void KfindDlg::slotDeleteItem(const QString &file)
void KfindDlg::slotNewItems(const QString &file)
{
//qDebug()<<QString("Will add this item") << file;
const QUrl url = QUrl::fromLocalFile(file);
if (query->url().isParentOf(url)) {
......@@ -277,7 +272,8 @@ QStringList KfindDlg::getAllSubdirs(QDir d)
d.setFilter(QDir::Dirs);
dirs = d.entryList();
for (QStringList::const_iterator it = dirs.constBegin(); it != dirs.constEnd(); ++it) {
const QStringList::const_iterator end(dirs.constEnd());
for (QStringList::const_iterator it = dirs.constBegin(); it != end; ++it) {
if ((*it == QLatin1String(".")) || (*it == QLatin1String(".."))) {
continue;
}
......
......@@ -35,7 +35,6 @@
#include <krun.h>
#include <kmessagebox.h>
#include <kglobal.h>
#include <QDebug>
#include <kiconloader.h>
#include <kglobalsettings.h>
#include <kjobwidgets.h>
......@@ -392,7 +391,6 @@ QString KFindTreeView::reducedDir(const QString &fullDir)
void KFindTreeView::beginSearch(const QUrl &baseUrl)
{
//qDebug() << QString("beginSearch in: %1").arg(baseUrl.path());
m_baseDir = QDir(baseUrl.toLocalFile());
m_model->clear();
}
......
......@@ -17,7 +17,7 @@
******************************************************************/
#include "kquery.h"
#include "kfind_debug.h"
#include <stdlib.h>
#include <QCoreApplication>
......@@ -25,7 +25,6 @@
#include <QTextCodec>
#include <QTextStream>
#include <QList>
#include <QDebug>
#include <kmimetype.h>
#include <kfileitem.h>
#include <kfilemetainfo.h>
......@@ -386,7 +385,6 @@ void KQuery::processQuery(const KFileItem &file)
}
if (!m_search_binary && ignore_mimetypes.indexOf(file.mimetype()) != -1) {
//qDebug() << "ignoring, mime type is in exclusion list: " << file.url();
return;
}
......@@ -417,7 +415,7 @@ void KQuery::processQuery(const KFileItem &file)
zipfileEntry = (KZipFileEntry *)zipfileContent->entry(QStringLiteral("content.xml")); //for OpenOffice.org
}
if (!zipfileEntry) {
qWarning() << "Expected XML file not found in ZIP archive " << file.url();
qCWarning(KFING_LOG) << "Expected XML file not found in ZIP archive " << file.url();
return;
}
......@@ -428,12 +426,11 @@ void KQuery::processQuery(const KFileItem &file)
stream->setCodec("UTF-8");
isZippedOfficeDocument = true;
} else {
qWarning() << "Cannot open supposed ZIP file " << file.url();
qCWarning(KFING_LOG) << "Cannot open supposed ZIP file " << file.url();
}
} else if (!m_search_binary && !file.mimetype().startsWith(QLatin1String("text/"))
&& file.url().isLocalFile() && !file.url().path().startsWith(QLatin1String("/dev"))) {
if (KMimeType::isBinaryData(file.url().path())) {
//qDebug() << "ignoring, not a text file: " << file.url();
return;
}
}
......
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