Commit c2cf02e3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to qdebug categories

parent a98b766a
......@@ -24,7 +24,7 @@ include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMAddTests)
include(ECMMarkNonGuiExecutable)
include(ECMQtDeclareLoggingCategory)
include(CMakePackageConfigHelpers)
include(FeatureSummary)
include(ECMAddAppIcon)
......@@ -48,6 +48,6 @@ endif()
add_subdirectory(src)
add_subdirectory(doc)
install(FILES keditbookmarks.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
org.kde.keditbookmarks keditbookmarks IDENTIFIER [KEDITBOOKMARKS_LOG]
############ subdir ###################
set(debug_file_common_SRCS)
ecm_qt_declare_logging_category(debug_file_common_SRCS HEADER keditbookmarks_debug.h IDENTIFIER KEDITBOOKMARKS_LOG CATEGORY_NAME org.kde.keditbookmarks)
add_subdirectory(kbookmarkmodel)
......@@ -6,7 +9,7 @@ add_subdirectory(kbookmarkmodel)
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KEDITBOOKMARKS VERSION_HEADER keditbookmarks_version.h)
set(kbookmarkmerger_SRCS kbookmarkmerger.cpp )
set(kbookmarkmerger_SRCS kbookmarkmerger.cpp ${debug_file_common_SRCS})
add_executable(kbookmarkmerger ${kbookmarkmerger_SRCS})
......@@ -35,8 +38,8 @@ set(keditbookmarks_SRCS
bookmarkinfowidget.cpp
kebsearchline.cpp
bookmarklistview.cpp
${debug_file_common_SRCS}
)
set(toplevel_xml ${CMAKE_CURRENT_BINARY_DIR}/org.kde.keditbookmarks.xml)
qt5_generate_dbus_interface( ${CMAKE_CURRENT_SOURCE_DIR}/toplevel.h org.kde.keditbookmarks.xml )
......
......@@ -38,7 +38,7 @@
#include <QFileDialog>
#include <QMimeData>
#include <QApplication>
#include <QDebug>
#include "keditbookmarks_debug.h"
#include <kactioncollection.h>
#include <QIcon>
......@@ -405,7 +405,7 @@ void ActionsImpl::slotInsertSeparator()
void ActionsImpl::slotImport() {
KEBApp::self()->bkInfo()->commitChanges();
qDebug() << "ActionsImpl::slotImport() where sender()->name() == "
qCDebug(KEDITBOOKMARKS_LOG) << "ActionsImpl::slotImport() where sender()->name() == "
<< sender()->objectName();
ImportCommand* import
= ImportCommand::performImport(m_model, sender()->objectName(), KEBApp::self());
......
......@@ -22,7 +22,7 @@
#include "kbookmarkmodel/model.h"
#include <kbookmarkmanager.h>
#include <QDebug>
#include "keditbookmarks_debug.h"
#include <QTimer>
BookmarkIterator::BookmarkIterator(BookmarkIteratorHolder* holder, const QList<KBookmark>& bks)
......@@ -47,7 +47,7 @@ KBookmark BookmarkIterator::currentBookmark()
void BookmarkIterator::nextOne()
{
// //qDebug() << "BookmarkIterator::nextOne";
// //qCDebug(KEDITBOOKMARKS_LOG) << "BookmarkIterator::nextOne";
// Look for an interesting bookmark
while (!m_bookmarkList.isEmpty()) {
......@@ -103,20 +103,20 @@ void BookmarkIteratorHolder::cancelAllItrs()
void BookmarkIteratorHolder::addAffectedBookmark(const QString & address)
{
//qDebug() << address;
//qCDebug(KEDITBOOKMARKS_LOG) << address;
if(m_affectedBookmark.isNull())
m_affectedBookmark = address;
else
m_affectedBookmark = KBookmark::commonParent(m_affectedBookmark, address);
//qDebug() << "m_affectedBookmark is now" << m_affectedBookmark;
//qCDebug(KEDITBOOKMARKS_LOG) << "m_affectedBookmark is now" << m_affectedBookmark;
}
void BookmarkIteratorHolder::doIteratorListChanged()
{
//qDebug() << count() << "iterators";
//qCDebug(KEDITBOOKMARKS_LOG) << count() << "iterators";
emit setCancelEnabled(count() > 0);
if(count() == 0) {
//qDebug() << "Notifying managers" << m_affectedBookmark;
//qCDebug(KEDITBOOKMARKS_LOG) << "Notifying managers" << m_affectedBookmark;
KBookmarkManager* mgr = m_model->bookmarkManager();
model()->notifyManagers(mgr->findByAddress(m_affectedBookmark).toGroup());
m_affectedBookmark.clear();
......
......@@ -30,7 +30,7 @@
#include <QMenu>
#include <QBrush>
#include <QDebug>
#include "keditbookmarks_debug.h"
BookmarkFolderView::BookmarkFolderView( BookmarkListView * view, QWidget * parent )
: KBookmarkView(parent), mview(view)
......@@ -70,7 +70,7 @@ void BookmarkFolderView::slotReset()
KBookmark BookmarkFolderView::bookmarkForIndex(const QModelIndex & idx) const
{
qDebug()<<"BookmarkFolderView::bookmarkForIndex"<<idx;
qCDebug(KEDITBOOKMARKS_LOG)<<"BookmarkFolderView::bookmarkForIndex"<<idx;
const QModelIndex & index = mmodel->mapToSource(idx);
return static_cast<KBookmarkModel *>(mmodel->sourceModel())->bookmarkForIndex(index);
}
......
......@@ -19,7 +19,7 @@
#include "exporters.h"
#include <QDebug>
#include "keditbookmarks_debug.h"
#include <klocalizedstring.h>
#include <QFile>
......@@ -32,7 +32,7 @@ HTMLExporter::HTMLExporter()
void HTMLExporter::write(const KBookmarkGroup &grp, const QString &filename, bool showAddress) {
QFile file(filename);
if (!file.open(QIODevice::WriteOnly)) {
qCritical() << "Can't write to file " << filename;
qCCritical(KEDITBOOKMARKS_LOG) << "Can't write to file " << filename;
return;
}
QTextStream tstream(&file);
......@@ -56,7 +56,7 @@ QString HTMLExporter::toString(const KBookmarkGroup &grp, bool showAddress)
}
void HTMLExporter::visit(const KBookmark &bk) {
// //qDebug() << "visit(" << bk.text() << ")";
// //qCDebug(KEDITBOOKMARKS_LOG) << "visit(" << bk.text() << ")";
if(bk.isSeparator())
{
m_out << bk.fullText() << "<br>"<< QLatin1Char('\n');
......@@ -78,14 +78,14 @@ void HTMLExporter::visit(const KBookmark &bk) {
}
void HTMLExporter::visitEnter(const KBookmarkGroup &grp) {
// //qDebug() << "visitEnter(" << grp.text() << ")";
// //qCDebug(KEDITBOOKMARKS_LOG) << "visitEnter(" << grp.text() << ")";
m_out << "<b>" << grp.fullText() << "</b><br>"<< QLatin1Char('\n');
m_out << "<div style=\"margin-left: 2em\">"<< QLatin1Char('\n');
m_out.flush();
}
void HTMLExporter::visitLeave(const KBookmarkGroup &) {
// //qDebug() << "visitLeave()";
// //qCDebug(KEDITBOOKMARKS_LOG) << "visitLeave()";
m_out << "</div>" << QLatin1Char('\n');
m_out.flush();
}
......
......@@ -24,7 +24,7 @@
#include "kbookmarkmodel/commands.h"
#include "kbookmarkmodel/model.h"
#include <QDebug>
#include "keditbookmarks_debug.h"
#include <klocalizedstring.h>
FavIconsItrHolder::FavIconsItrHolder(QObject* parent, KBookmarkModel* model)
......@@ -52,7 +52,7 @@ void FavIconsItr::setStatus(const QString & status)
void FavIconsItr::slotDone(bool succeeded, const QString& errorString)
{
// //qDebug() << "FavIconsItr::slotDone()";
// //qCDebug(KEDITBOOKMARKS_LOG) << "FavIconsItr::slotDone()";
setStatus(succeeded ? i18n("OK") : errorString);
holder()->addAffectedBookmark(KBookmark::parentAddress(currentBookmark().address()));
delayedEmitNextOne();
......@@ -67,7 +67,7 @@ bool FavIconsItr::isApplicable(const KBookmark &bk) const
void FavIconsItr::doAction()
{
// //qDebug() << "FavIconsItr::doAction()";
// //qCDebug(KEDITBOOKMARKS_LOG) << "FavIconsItr::doAction()";
m_oldStatus = currentBookmark().metaDataItem(QStringLiteral("favstate"));
setStatus(i18n("Updating favicon..."));
if (!m_updater) {
......
......@@ -24,7 +24,7 @@
#include "bookmarkiterator.h"
#include "toplevel.h"
#include <QDebug>
#include "keditbookmarks_debug.h"
#include <klocalizedstring.h>
#include <kio/job.h>
......@@ -47,14 +47,14 @@ void FavIconUpdater::downloadIcon(const KBookmark &bk)
const QUrl url = bk.url();
const QString favicon = KIO::favIconForUrl(url);
if (!favicon.isEmpty()) {
//qDebug() << "got favicon" << favicon;
//qCDebug(KEDITBOOKMARKS_LOG) << "got favicon" << favicon;
m_bk.setIcon(favicon);
KEBApp::self()->notifyCommandExecuted();
// //qDebug() << "emit done(true)";
// //qCDebug(KEDITBOOKMARKS_LOG) << "emit done(true)";
emit done(true, QString());
} else {
//qDebug() << "no favicon found";
//qCDebug(KEDITBOOKMARKS_LOG) << "no favicon found";
webupdate = false;
KIO::FavIconRequestJob *job = new KIO::FavIconRequestJob(url, KIO::Reload);
connect(job, &KIO::FavIconRequestJob::result, this, &FavIconUpdater::slotResult);
......@@ -69,7 +69,7 @@ FavIconUpdater::~FavIconUpdater()
void FavIconUpdater::downloadIconUsingWebBrowser(const KBookmark &bk, const QString& currentError)
{
//qDebug();
//qCDebug(KEDITBOOKMARKS_LOG);
m_bk = bk;
webupdate = true;
......@@ -119,11 +119,11 @@ void FavIconUpdater::slotResult(KJob *job)
KIO::FavIconRequestJob *requestJob = static_cast<KIO::FavIconRequestJob *>(job);
if (job->error()) {
if (!webupdate) {
qDebug() << "favicon job failed, going to downloadIconUsingWebBrowser";
qCDebug(KEDITBOOKMARKS_LOG) << "favicon job failed, going to downloadIconUsingWebBrowser";
// no icon found, try webupdater
downloadIconUsingWebBrowser(m_bk, job->errorString());
} else {
qDebug() << "favicon job failed, emit done";
qCDebug(KEDITBOOKMARKS_LOG) << "favicon job failed, emit done";
// already tried webupdater
emit done(false, job->errorString());
}
......@@ -149,7 +149,7 @@ FavIconWebGrabber::FavIconWebGrabber(KParts::ReadOnlyPart *part, const QUrl &url
// the use of KIO rather than directly using KHTML is to allow silently abort on error
// TODO: an alternative would be to derive from KHTMLPart and reimplement showError(KJob*).
//qDebug() << "starting KIO::get() on" << m_url;
//qCDebug(KEDITBOOKMARKS_LOG) << "starting KIO::get() on" << m_url;
KIO::Job *job = KIO::get(m_url, KIO::NoReload, KIO::HideProgressInfo);
job->addMetaData( QStringLiteral("cookies"), QStringLiteral("none") );
job->addMetaData( QStringLiteral("errorPage"), QStringLiteral("false") );
......@@ -168,7 +168,7 @@ void FavIconWebGrabber::slotMimetype(KIO::Job *job, const QString &type)
sjob->putOnHold();
// QString typeLocal = typeUncopied; // local copy
qDebug() << "slotMimetype " << type << "calling openUrl on" << m_url;
qCDebug(KEDITBOOKMARKS_LOG) << "slotMimetype " << type << "calling openUrl on" << m_url;
// TODO - what to do if typeLocal is not text/html ??
m_part->openUrl(m_url);
......@@ -177,7 +177,7 @@ void FavIconWebGrabber::slotMimetype(KIO::Job *job, const QString &type)
void FavIconWebGrabber::slotFinished(KJob *job)
{
if (job->error()) {
qDebug() << job->errorString();
qCDebug(KEDITBOOKMARKS_LOG) << job->errorString();
emit done(false, job->errorString());
return;
}
......@@ -186,13 +186,13 @@ void FavIconWebGrabber::slotFinished(KJob *job)
void FavIconWebGrabber::slotCompleted()
{
qDebug();
qCDebug(KEDITBOOKMARKS_LOG);
emit done(true, QString());
}
void FavIconWebGrabber::slotCanceled(const QString& errorString)
{
//qDebug() << errorString;
//qCDebug(KEDITBOOKMARKS_LOG) << errorString;
emit done(false, errorString);
}
......
......@@ -20,7 +20,7 @@
#include "globalbookmarkmanager.h"
#include <QDateTime>
#include <QDebug>
#include "keditbookmarks_debug.h"
#include "kbookmarkmanager.h"
#include "kbookmarkmodel/model.h"
#include "kbookmarkmodel/commandhistory.h"
......@@ -54,11 +54,11 @@ QString GlobalBookmarkManager::path() const { return mgr()->path(); }
void GlobalBookmarkManager::createManager(const QString &filename, const QString &dbusObjectName, CommandHistory* commandHistory) {
if (m_mgr) {
//qDebug()<<"createManager called twice";
//qCDebug(KEDITBOOKMARKS_LOG)<<"createManager called twice";
delete m_mgr;
}
//qDebug()<<"DBus Object name: "<<dbusObjectName;
//qCDebug(KEDITBOOKMARKS_LOG)<<"DBus Object name: "<<dbusObjectName;
m_mgr = KBookmarkManager::managerForFile(filename, dbusObjectName);
commandHistory->setBookmarkManager(m_mgr);
......
......@@ -28,7 +28,7 @@
#include "kbookmarkmodel/model.h"
#include <QFileDialog>
#include <QDebug>
#include "keditbookmarks_debug.h"
#include <klocalizedstring.h>
#include <kmessagebox.h>
......@@ -70,7 +70,7 @@ ImportCommand* ImportCommand::importerFactory(KBookmarkModel* model, const QStri
else if (type == QLatin1String("Moz")) return new MozImportCommand(model);
else if (type == QLatin1String("NS")) return new NSImportCommand(model);
else {
qCritical() << "ImportCommand::importerFactory() - invalid type (" << type << ")!";
qCCritical(KEDITBOOKMARKS_LOG) << "ImportCommand::importerFactory() - invalid type (" << type << ")!";
return nullptr;
}
}
......
......@@ -27,7 +27,7 @@
#include <kbookmarkmanager.h>
#include <QDebug>
#include "keditbookmarks_debug.h"
#include <QDir>
......@@ -63,7 +63,7 @@ int main( int argc, char**argv )
aboutData.processCommandLine(&parser);
if ( parser.positionalArguments().count() != 1 ) {
qCritical() << "No directory to scan for bookmarks specified.";
qCCritical(KEDITBOOKMARKS_LOG) << "No directory to scan for bookmarks specified.";
return 1;
}
......@@ -88,7 +88,7 @@ int main( int argc, char**argv )
QString extraBookmarksDirName = parser.positionalArguments().at(0);
QDir extraBookmarksDir( extraBookmarksDirName, QStringLiteral("*.xml") );
if ( !extraBookmarksDir.isReadable() ) {
qCritical() << "Failed to read files in directory " << extraBookmarksDirName;
qCCritical(KEDITBOOKMARKS_LOG) << "Failed to read files in directory " << extraBookmarksDirName;
return 1;
}
......
......@@ -8,8 +8,8 @@ set(kbookmarkmodel_SRCS
model.cpp
treeitem.cpp
view.cpp
${debug_file_common_SRCS}
)
add_library(kbookmarkmodel_private SHARED ${kbookmarkmodel_SRCS})
target_link_libraries(kbookmarkmodel_private
PUBLIC
......
......@@ -25,7 +25,7 @@
#include "model.h"
#include "kinsertionsort_p.h"
#include <QDebug>
#include "keditbookmarks_debug.h"
#include <klocalizedstring.h>
#include <kbookmarkmanager.h>
#include <kdesktopfile.h>
......@@ -103,7 +103,7 @@ void CreateCommand::redo()
QString previousSibling = KBookmark::previousAddress(m_to);
// qDebug() << "previousSibling=" << previousSibling;
// qCDebug(KEDITBOOKMARKS_LOG) << "previousSibling=" << previousSibling;
KBookmark prev = (previousSibling.isEmpty())
? KBookmark(QDomElement())
: m_model->bookmarkManager()->findByAddress(previousSibling);
......@@ -169,7 +169,7 @@ QString CreateCommand::affectedBookmarks() const
EditCommand::EditCommand(KBookmarkModel* model, const QString & address, int col, const QString & newValue, QUndoCommand* parent)
: QUndoCommand(parent), m_model(model), mAddress(address), mCol(col)
{
qDebug() << address << col << newValue;
qCDebug(KEDITBOOKMARKS_LOG) << address << col << newValue;
if(mCol == 1)
{
const QUrl u(newValue);
......@@ -211,7 +211,7 @@ void EditCommand::redo()
{
if (mOldValue.isEmpty()) // only the first time, not when compressing changes in modify()
mOldValue = bk.fullText();
qDebug() << "mOldValue=" << mOldValue;
qCDebug(KEDITBOOKMARKS_LOG) << "mOldValue=" << mOldValue;
bk.setFullText(mNewValue);
}
else if(mCol==1)
......@@ -233,7 +233,7 @@ void EditCommand::redo()
void EditCommand::undo()
{
qDebug() << "Setting old value" << mOldValue << "in bk" << mAddress << "col" << mCol;
qCDebug(KEDITBOOKMARKS_LOG) << "Setting old value" << mOldValue << "in bk" << mAddress << "col" << mCol;
KBookmark bk = m_model->bookmarkManager()->findByAddress(mAddress);
if(mCol==-2)
{
......@@ -292,7 +292,7 @@ void DeleteCommand::redo()
while (!n.isNull()) {
QDomElement e = n.toElement();
if (!e.isNull()) {
// qDebug() << e.tagName();
// qCDebug(KEDITBOOKMARKS_LOG) << e.tagName();
}
QDomNode next = n.nextSibling();
groupRoot.removeChild(n);
......@@ -325,7 +325,7 @@ void DeleteCommand::redo()
void DeleteCommand::undo()
{
// qDebug() << "DeleteCommand::undo " << m_from;
// qCDebug(KEDITBOOKMARKS_LOG) << "DeleteCommand::undo " << m_from;
if (m_contentOnly) {
// TODO - recover saved metadata
......@@ -369,16 +369,16 @@ MoveCommand::MoveCommand(KBookmarkModel* model, const QString &from, const QStri
void MoveCommand::redo()
{
//qDebug() << "Moving from=" << m_from << "to=" << m_to;
//qCDebug(KEDITBOOKMARKS_LOG) << "Moving from=" << m_from << "to=" << m_to;
KBookmark fromBk = m_model->bookmarkManager()->findByAddress( m_from );
Q_ASSERT(fromBk.address() == m_from);
//qDebug() << " 1) creating" << m_to;
//qCDebug(KEDITBOOKMARKS_LOG) << " 1) creating" << m_to;
m_cc = new CreateCommand(m_model, m_to, fromBk, QString());
m_cc->redo();
//qDebug() << " 2) deleting" << fromBk.address();
//qCDebug(KEDITBOOKMARKS_LOG) << " 2) deleting" << fromBk.address();
m_dc = new DeleteCommand(m_model, fromBk.address());
m_dc->redo();
}
......
......@@ -39,7 +39,7 @@ inline void kInsertionSort( Item& firstChild, SortHelper& sortHelper )
while ( !j.isNull() )
{
Key key = Criteria::key(j);
//qDebug() << "Looking at j=" << key;
//qCDebug(KEDITBOOKMARKS_LOG) << "Looking at j=" << key;
// Insert A[j] into the sorted sequence A[1..j-1]
Item i = j.previousSibling();
Item next = j.nextSibling();
......@@ -50,11 +50,11 @@ inline void kInsertionSort( Item& firstChild, SortHelper& sortHelper )
moved = true;
}
if ( moved ) {
//qDebug() << "moveAfter(" << Criteria::key(j) << "," << (i.isNull() ? "null" : Criteria::key(i)) << ")";
//qCDebug(KEDITBOOKMARKS_LOG) << "moveAfter(" << Criteria::key(j) << "," << (i.isNull() ? "null" : Criteria::key(i)) << ")";
sortHelper.moveAfter( j, i ); // move j right after i. If i is null, move to first position.
}
j = next;
//qDebug() << "Now j is" << Criteria::key(next);
//qCDebug(KEDITBOOKMARKS_LOG) << "Now j is" << Criteria::key(next);
}
}
......
......@@ -27,7 +27,7 @@
#include <klocalizedstring.h>
#include <QIcon>
#include <QDebug>
#include "keditbookmarks_debug.h"
#include <QStringList>
#include <QMimeData>
......@@ -199,7 +199,7 @@ bool KBookmarkModel::setData(const QModelIndex &index, const QVariant &value, in
{
if (index.isValid() && role == Qt::EditRole)
{
qDebug() << value.toString();
qCDebug(KEDITBOOKMARKS_LOG) << value.toString();
d->mCommandHistory->addCommand(new EditCommand(this, bookmarkForIndex(index).address(), index.column(), value.toString()));
return true;
}
......@@ -289,7 +289,7 @@ QModelIndex KBookmarkModel::indexForBookmark(const KBookmark& bk) const
{
TreeItem *item = d->mRootItem->treeItemForBookmark(bk);
if (!item) {
qWarning() << "Bookmark not found" << bk.address();
qCWarning(KEDITBOOKMARKS_LOG) << "Bookmark not found" << bk.address();
Q_ASSERT(item);
}
return createIndex(KBookmark::positionInParent(bk.address()) , 0, item);
......@@ -298,7 +298,7 @@ QModelIndex KBookmarkModel::indexForBookmark(const KBookmark& bk) const
void KBookmarkModel::emitDataChanged(const KBookmark& bk)
{
QModelIndex idx = indexForBookmark(bk);
qDebug() << idx;
qCDebug(KEDITBOOKMARKS_LOG) << idx;
emit dataChanged(idx, idx.sibling(idx.row(), columnCount()-1));
}
......@@ -316,7 +316,7 @@ QMimeData * KBookmarkModel::mimeData(const QModelIndexList & indexes) const
if (!addresses.isEmpty())
addresses.append(';');
addresses.append(bookmarkForIndex(it).address().toLatin1());
qDebug() << "appended" << bookmarkForIndex(it).address();
qCDebug(KEDITBOOKMARKS_LOG) << "appended" << bookmarkForIndex(it).address();
}
}
......@@ -376,14 +376,14 @@ bool KBookmarkModel::dropMimeData(const QMimeData * data, Qt::DropAction action,
std::sort(addresses.begin(), addresses.end());
Q_FOREACH(const QByteArray& address, addresses) {
KBookmark bk = bookmarkManager()->findByAddress(QString::fromLatin1(address));
qDebug() << "Extracted bookmark:" << bk.address();
qCDebug(KEDITBOOKMARKS_LOG) << "Extracted bookmark:" << bk.address();
bookmarks.prepend(bk); // reverse order, so that we don't invalidate addresses (#287038)
}
KEBMacroCommand * cmd = CmdGen::itemsMoved(this, bookmarks, addr, false);
d->mCommandHistory->addCommand(cmd);
} else {
qDebug()<<"NO FORMAT";
qCDebug(KEDITBOOKMARKS_LOG)<<"NO FORMAT";
KEBMacroCommand * cmd = CmdGen::insertMimeSource(this, QStringLiteral("Copy"), data, addr);
d->mCommandHistory->addCommand(cmd);
}
......@@ -471,13 +471,13 @@ void KBookmarkModel::Private::_kd_slotBookmarksChanged(const QString& groupAddre
{
Q_UNUSED(groupAddress);
Q_UNUSED(caller);
//qDebug() << "_kd_slotBookmarksChanged" << groupAddress << "caller=" << caller << "mIgnoreNext=" << mIgnoreNext;
//qCDebug(KEDITBOOKMARKS_LOG) << "_kd_slotBookmarksChanged" << groupAddress << "caller=" << caller << "mIgnoreNext=" << mIgnoreNext;
if (mIgnoreNext > 0) { // We ignore the first changed signal after every change we did
--mIgnoreNext;
return;
}
//qDebug() << " setRoot!";
//qCDebug(KEDITBOOKMARKS_LOG) << " setRoot!";
q->setRoot(q->bookmarkManager()->root());
mCommandHistory->clearHistory();
......@@ -486,7 +486,7 @@ void KBookmarkModel::Private::_kd_slotBookmarksChanged(const QString& groupAddre
void KBookmarkModel::notifyManagers(const KBookmarkGroup& grp)
{
++d->mIgnoreNext;
//qDebug() << "notifyManagers -> mIgnoreNext=" << d->mIgnoreNext;
//qCDebug(KEDITBOOKMARKS_LOG) << "notifyManagers -> mIgnoreNext=" << d->mIgnoreNext;
bookmarkManager()->emitChanged(grp);
}
......
......@@ -197,7 +197,7 @@ private Q_SLOTS:
m_cmdHistory->addCommand(new CreateCommand(m_model, "/0/" + QString::number(i), bookmarks[i], QStringLiteral("www"), QUrl(kde)));
}
const QStringList addresses = BookmarkLister::addressList(m_bookmarkManager);
//kDebug() << addresses;
//qCDebug(KEDITBOOKMARKS_LOG) << addresses;
const QStringList origTitleList = BookmarkLister::titleList(m_bookmarkManager);
QCOMPARE(addresses.count(), bookmarks.count() + 1 /* parent folder */);
SortCommand* sortCmd = new SortCommand(m_model, QStringLiteral("Sort"), QStringLiteral("/0"));
......@@ -206,7 +206,7 @@ private Q_SLOTS:
expectedTitleList.sort();
expectedTitleList.prepend(QStringLiteral("folder"));
const QStringList sortedTitles = BookmarkLister::titleList(m_bookmarkManager);
//kDebug() << sortedTitles;
//qCDebug(KEDITBOOKMARKS_LOG) << sortedTitles;
QCOMPARE(sortedTitles, expectedTitleList);
sortCmd->undo();
......@@ -234,7 +234,7 @@ private Q_SLOTS:
const QStringList addresses = BookmarkLister::addressList(bookmarkManager);
const QStringList origTitleList = BookmarkLister::titleList(bookmarkManager);
//qDebug() << addresses << origTitleList;
//qCDebug(KEDITBOOKMARKS_LOG) << addresses << origTitleList;
QCOMPARE(addresses.count(), 53);
CommandHistory cmdHistory;
......
......@@ -18,7 +18,7 @@
*/
#include "kebsearchline.h"
#include <QDebug>
#include "keditbookmarks_debug.h"
#include <QTimer>
#include <QTreeView>
#include <QListView>
......@@ -407,7 +407,7 @@ void KViewSearchLine::slotColumnsRemoved(const QModelIndex &, int first, int las
if(d->listView->modelColumn() >= first && d->listView->modelColumn()<= last)
{
if(d->listView->modelColumn()>last)
qCritical()<<"Columns were removed, the modelColumn() doesn't exist anymore. "
qCCritical(KEDITBOOKMARKS_LOG)<<"Columns were removed, the modelColumn() doesn't exist anymore. "
"K4listViewSearchLine can't cope with that.";
updateSearch();
}
......
......@@ -27,7 +27,7 @@
#include "keditbookmarks_version.h"
#include <QApplication>
#include <QDebug>
#include "keditbookmarks_debug.h"
#include <QCommandLineParser>
#include <QCommandLineOption>
......@@ -77,7 +77,7 @@ static bool askUser(const QString& filename, bool &readonly) {
qlonglong id = 0;
if( value.isValid())
id = value;
////qDebug()<<" id !!!!!!!!!!!!!!!!!!! :"<<id;
////qCDebug(KEDITBOOKMARKS_LOG)<<" id !!!!!!!!!!!!!!!!!!! :"<<id;
KWindowSystem::activateWindow((WId)id);
return false;
} else if (ret == KMessageBox::Yes) {
......@@ -180,14 +180,14 @@ int main(int argc, char **argv)
Q_ASSERT(arg2);
// TODO - maybe an xbel export???
if (got > 1) { // got == 0 isn't possible as !isGui is dependent on "export.*"
qWarning() << i18n("You may only specify a single --export option.");
qCWarning(KEDITBOOKMARKS_LOG) << i18n("You may only specify a single --export option.");
return 1;