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

Port to qcdebug

parent 9250bd69
......@@ -6,6 +6,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}
${LibKGAPI2_INCLUDE_DIR} )
set(blogilo_SRCS
blogilo_debug.cpp
main.cpp
mainwindow.cpp
toolbox.cpp
......
......@@ -32,7 +32,7 @@
#include <kblog/wordpressbuggy.h>
#include "blogger.h"
#include <kmessagebox.h>
#include <qdebug.h>
#include "blogilo_debug.h"
#include <kio/jobclasses.h>
#include <kio/job.h>
#include <KLocalizedString>
......@@ -69,7 +69,7 @@ public:
AddEditBlog::AddEditBlog(int blog_id, QWidget *parent, Qt::WindowFlags flags)
: KDialog(parent, flags), d(new Private)
{
qDebug();
qCDebug(BLOGILO_LOG);
d->mainW = new QTabWidget(this);
d->ui.setupUi(d->mainW);
setMainWidget(d->mainW);
......@@ -131,9 +131,9 @@ void AddEditBlog::enableAutoConfBtn()
void AddEditBlog::autoConfigure()
{
qDebug();
qCDebug(BLOGILO_LOG);
if (d->ui.txtUrl->text().isEmpty() || d->ui.txtUser->text().isEmpty() || d->ui.txtPass->text().isEmpty()) {
qDebug() << "Username, Password or Url doesn't set!";
qCDebug(BLOGILO_LOG) << "Username, Password or Url doesn't set!";
KMessageBox::sorry(this, i18n("You have to set the username, password and URL of your blog or website."),
i18n("Incomplete fields"));
return;
......@@ -171,7 +171,7 @@ void AddEditBlog::autoConfigure()
hideWaitWidget();
return;
}
qDebug() << "Trying to guess API type by Homepage contents";
qCDebug(BLOGILO_LOG) << "Trying to guess API type by Homepage contents";
KIO::StoredTransferJob *httpGetJob = KIO::storedGet(d->ui.txtUrl->text() , KIO::NoReload, KIO::HideProgressInfo);
connect(httpGetJob, &KIO::StoredTransferJob::result, this, &AddEditBlog::gotHtml);
d->mFetchAPITimer = new QTimer(this);
......@@ -186,7 +186,7 @@ void AddEditBlog::gotHtml(KJob *job)
return;
}
if (job->error()) {
qDebug() << "Auto configuration failed! Error: " << job->errorString();
qCDebug(BLOGILO_LOG) << "Auto configuration failed! Error: " << job->errorString();
hideWaitWidget();
KMessageBox::sorry(this, i18n("Auto configuration failed. You have to set Blog API on Advanced tab manually."));
return;
......@@ -196,7 +196,7 @@ void AddEditBlog::gotHtml(KJob *job)
QRegExp rxGData(QStringLiteral("content='blogger' name='generator'"));
if (rxGData.indexIn(httpData) != -1) {
qDebug() << "content='blogger' name='generator' matched";
qCDebug(BLOGILO_LOG) << "content='blogger' name='generator' matched";
d->mFetchAPITimer->deleteLater();
d->ui.comboApi->setCurrentIndex(4);
QRegExp rxBlogId(QStringLiteral("BlogID=(\\d+)"));
......@@ -207,7 +207,7 @@ void AddEditBlog::gotHtml(KJob *job)
QRegExp rxLiveJournal(QStringLiteral("rel=\"openid.server\" href=\"http://www.livejournal.com/openid/server.bml\""));
if (rxLiveJournal.indexIn(httpData) != -1) {
qDebug() << " rel=\"openid.server\" href=\"http://www.livejournal.com/openid/server.bml\" matched";
qCDebug(BLOGILO_LOG) << " rel=\"openid.server\" href=\"http://www.livejournal.com/openid/server.bml\" matched";
d->mFetchAPITimer->deleteLater();
d->ui.comboApi->setCurrentIndex(0);
d->ui.txtUrl->setText(QLatin1String("http://www.liverjournal.com/interface/blogger/"));
......@@ -219,7 +219,7 @@ void AddEditBlog::gotHtml(KJob *job)
QString textUrl;
QRegExp rxWordpress(QStringLiteral("name=\"generator\" content=\"WordPress"));
if (rxWordpress.indexIn(httpData) != -1) {
qDebug() << "name=\"generator\" content=\"WordPress matched";
qCDebug(BLOGILO_LOG) << "name=\"generator\" content=\"WordPress matched";
d->mFetchAPITimer->deleteLater();
d->ui.comboApi->setCurrentIndex(3);
......@@ -245,13 +245,13 @@ void AddEditBlog::gotHtml(KJob *job)
void AddEditBlog::gotXmlRpcTest(KJob *job)
{
qDebug();
qCDebug(BLOGILO_LOG);
d->mFetchAPITimer->deleteLater();
if (!job) {
return;
}
if (job->error()) {
qDebug() << "Auto configuration failed! Error: " << job->errorString();
qCDebug(BLOGILO_LOG) << "Auto configuration failed! Error: " << job->errorString();
hideWaitWidget();
KMessageBox::sorry(this, i18n("Auto configuration failed. You have to set Blog API on Advanced tab manually."));
return;
......@@ -299,7 +299,7 @@ void AddEditBlog::fetchBlogId()
break;
}
default:
qDebug() << "Unknown API";
qCDebug(BLOGILO_LOG) << "Unknown API";
return;
}
......@@ -311,7 +311,7 @@ void AddEditBlog::fetchBlogId()
void AddEditBlog::handleFetchIDTimeout()
{
qDebug();
qCDebug(BLOGILO_LOG);
if (d->mFetchBlogIdTimer) {
d->mFetchBlogIdTimer->stop();
}
......@@ -328,7 +328,7 @@ void AddEditBlog::handleFetchIDTimeout()
void AddEditBlog::handleFetchAPITimeout()
{
qDebug();
qCDebug(BLOGILO_LOG);
d->mFetchAPITimer->deleteLater();
d->mFetchAPITimer = 0;
hideWaitWidget();
......@@ -341,7 +341,7 @@ void AddEditBlog::handleFetchAPITimeout()
void AddEditBlog::handleFetchError(KBlog::Blog::ErrorType type, const QString &errorMsg)
{
qDebug() << " ErrorType: " << type;
qCDebug(BLOGILO_LOG) << " ErrorType: " << type;
d->ui.txtId->setEnabled(true);
d->ui.txtId->setText(QString());
hideWaitWidget();
......@@ -358,7 +358,7 @@ void AddEditBlog::fetchedBlogId(const QList< QMap < QString , QString > > &list)
QString blogId, blogName, blogUrl, apiUrl;
const int listCount(list.count());
if (listCount > 1) {
qDebug() << "User has more than ONE blog!";
qCDebug(BLOGILO_LOG) << "User has more than ONE blog!";
KDialog *blogsDialog = new KDialog(this);
QTableWidget *blogsList = new QTableWidget(blogsDialog);
blogsList->setSelectionBehavior(QAbstractItemView::SelectRows);
......@@ -373,7 +373,7 @@ void AddEditBlog::fetchedBlogId(const QList< QMap < QString , QString > > &list)
blogsList->setColumnHidden(2, true);
blogsList->setColumnHidden(3, true);
for (; it != endIt; ++it) {
qDebug() << it->value(QLatin1String("title"));
qCDebug(BLOGILO_LOG) << it->value(QLatin1String("title"));
blogsList->insertRow(i);
blogsList->setCellWidget(i, 0, new QLabel(it->value(QLatin1String("title"))));
blogsList->setCellWidget(i, 1, new QLabel(it->value(QLatin1String("url"))));
......@@ -460,7 +460,7 @@ void AddEditBlog::slotReturnPressed()
AddEditBlog::~AddEditBlog()
{
qDebug();
qCDebug(BLOGILO_LOG);
delete d;
}
......@@ -548,7 +548,7 @@ void AddEditBlog::slotComboApiChanged(int index)
void AddEditBlog::slotButtonClicked(int button)
{
qDebug();
qCDebug(BLOGILO_LOG);
if (button == KDialog::Ok) {
if (d->bBlog->blogid().isEmpty() && d->ui.txtId->text().isEmpty()) {
KMessageBox::sorry(this, i18n("Blog ID has not yet been retrieved.\n"
......@@ -572,17 +572,17 @@ void AddEditBlog::slotButtonClicked(int button)
int blog_id = DBMan::self()->addBlog(*d->bBlog);
d->bBlog->setId(blog_id);
if (blog_id != -1) {
qDebug() << "Emitting sigBlogAdded() ...";
qCDebug(BLOGILO_LOG) << "Emitting sigBlogAdded() ...";
Q_EMIT sigBlogAdded(*d->bBlog);
} else {
qDebug() << "Cannot add blog";
qCDebug(BLOGILO_LOG) << "Cannot add blog";
}
} else {
if (DBMan::self()->editBlog(*d->bBlog)) {
qDebug() << "Emitting sigBlogEdited() ...";
qCDebug(BLOGILO_LOG) << "Emitting sigBlogEdited() ...";
Q_EMIT sigBlogEdited(*d->bBlog);
} else {
qDebug() << "Cannot edit blog with id " << d->bBlog->id();
qCDebug(BLOGILO_LOG) << "Cannot edit blog with id " << d->bBlog->id();
}
}
accept();
......
......@@ -34,7 +34,7 @@
#include <kblog/wordpressbuggy.h>
#include <kblog/blogmedia.h>
#include "blogger.h"
#include <qdebug.h>
#include "blogilo_debug.h"
#include <KLocalizedString>
#include <kio/netaccess.h>
......@@ -60,7 +60,7 @@ public:
Backend::Backend(int blog_id, QObject *parent)
: QObject(parent), d(new Private)
{
qDebug() << "with blog id: " << blog_id;
qCDebug(BLOGILO_LOG) << "with blog id: " << blog_id;
d->bBlog = DBMan::self()->blog(blog_id);
d->kBlog = d->bBlog->blogBackend();
if (d->bBlog->api() == BilboBlog::BLOGGER_API) {
......@@ -80,13 +80,13 @@ Backend::Backend(int blog_id, QObject *parent)
Backend::~Backend()
{
qDebug();
qCDebug(BLOGILO_LOG);
delete d;
}
void Backend::getCategoryListFromServer()
{
qDebug() << "Blog Id: " << d->bBlog->id();
qCDebug(BLOGILO_LOG) << "Blog Id: " << d->bBlog->id();
if (d->bBlog->api() == BilboBlog::METAWEBLOG_API ||
d->bBlog->api() == BilboBlog::MOVABLETYPE_API ||
d->bBlog->api() == BilboBlog::WORDPRESSBUGGY_API) {
......@@ -100,7 +100,7 @@ void Backend::getCategoryListFromServer()
void Backend::categoriesListed(const QList< QMap < QString , QString > > &categories)
{
qDebug() << "Blog Id: " << d->bBlog->id();
qCDebug(BLOGILO_LOG) << "Blog Id: " << d->bBlog->id();
DBMan::self()->clearCategories(d->bBlog->id());
const int categoriesCount(categories.count());
......@@ -120,20 +120,20 @@ void Backend::categoriesListed(const QList< QMap < QString , QString > > &catego
DBMan::self()->addCategory(name, description, htmlUrl, rssUrl, categoryId, parentId, d->bBlog->id());
}
qDebug() << "Emitting sigCategoryListFetched...";
qCDebug(BLOGILO_LOG) << "Emitting sigCategoryListFetched...";
Q_EMIT sigCategoryListFetched(d->bBlog->id());
}
void Backend::getEntriesListFromServer(int count)
{
qDebug() << "Blog Id: " << d->bBlog->id();
qCDebug(BLOGILO_LOG) << "Blog Id: " << d->bBlog->id();
connect(d->kBlog, &KBlog::Blog::listedRecentPosts, this, &Backend::entriesListed);
d->kBlog->listRecentPosts(count);
}
void Backend::entriesListed(const QList< KBlog::BlogPost > &posts)
{
qDebug() << "Blog Id: " << d->bBlog->id();
qCDebug(BLOGILO_LOG) << "Blog Id: " << d->bBlog->id();
// DBMan::self()->clearPosts( d->bBlog->id() );
const int postCount(posts.count());
......@@ -145,13 +145,13 @@ void Backend::entriesListed(const QList< KBlog::BlogPost > &posts)
}
DBMan::self()->addPost(tempPost, d->bBlog->id());
}
qDebug() << "Emitting sigEntriesListFetched ...";
qCDebug(BLOGILO_LOG) << "Emitting sigEntriesListFetched ...";
Q_EMIT sigEntriesListFetched(d->bBlog->id());
}
void Backend::publishPost(BilboPost *post)
{
qDebug() << "Blog Id: " << d->bBlog->id();
qCDebug(BLOGILO_LOG) << "Blog Id: " << d->bBlog->id();
// BilboPost tmpPost = post;
if (Settings::addPoweredBy()) {
QString poweredStr = QLatin1String("<p>=-=-=-=-=<br/>"
......@@ -165,15 +165,15 @@ void Backend::publishPost(BilboPost *post)
void Backend::postPublished(KBlog::BlogPost *post)
{
qDebug() << "Blog Id: " << d->bBlog->id();
qCDebug(BLOGILO_LOG) << "Blog Id: " << d->bBlog->id();
if (post->status() == KBlog::BlogPost::Error) {
qDebug() << "Publishing/Modifying Failed";
qCDebug(BLOGILO_LOG) << "Publishing/Modifying Failed";
const QString tmp(i18n("Publishing/Modifying post failed: %1", post->error()));
qDebug() << "Emitting sigError...";
qCDebug(BLOGILO_LOG) << "Emitting sigError...";
Q_EMIT sigError(tmp);
return;
}
qDebug() << "isPrivate: " << post->isPrivate();
qCDebug(BLOGILO_LOG) << "isPrivate: " << post->isPrivate();
d->mSubmitPostStatusMap[ post ] = post->status();
connect(d->kBlog, &KBlog::Blog::fetchedPost, this, &Backend::savePostInDbAndEmitResult);
d->kBlog->fetchPost(post);
......@@ -181,14 +181,14 @@ void Backend::postPublished(KBlog::BlogPost *post)
void Backend::uploadMedia(BilboMedia *media)
{
qDebug() << "Blog Id: " << d->bBlog->id();
qCDebug(BLOGILO_LOG) << "Blog Id: " << d->bBlog->id();
QString tmp;
switch (d->bBlog->api()) {
case BilboBlog::BLOGGER1_API:
case BilboBlog::BLOGGER_API:
qDebug() << "The Blogger1 and Blogspot API type doesn't support uploading Media files.";
qCDebug(BLOGILO_LOG) << "The Blogger1 and Blogspot API type doesn't support uploading Media files.";
tmp = i18n("Uploading media failed: Your Blog API does not support uploading media objects.");
qDebug() << "Emitting sigError...";
qCDebug(BLOGILO_LOG) << "Emitting sigError...";
Q_EMIT sigMediaError(tmp, media);
return;
case BilboBlog::METAWEBLOG_API:
......@@ -204,14 +204,14 @@ void Backend::uploadMedia(BilboMedia *media)
if (!KIO::NetAccess::synchronousRun(job, 0, &data)) {
qCritical() << "Job error: " << job->errorString();
tmp = i18n("Uploading media failed: Cannot read the media file, please check if it exists. Path: %1", media->localUrl().toDisplayString());
qDebug() << "Emitting sigError...";
qCDebug(BLOGILO_LOG) << "Emitting sigError...";
Q_EMIT sigMediaError(tmp, media);
}
if (data.count() == 0) {
qCritical() << "Cannot read the media file, please check if it exists.";
tmp = i18n("Uploading media failed: Cannot read the media file, please check if it exists. Path: %1", media->localUrl().toDisplayString());
qDebug() << "Emitting sigError...";
qCDebug(BLOGILO_LOG) << "Emitting sigError...";
Q_EMIT sigMediaError(tmp, media);
delete m;
return;
......@@ -226,7 +226,7 @@ void Backend::uploadMedia(BilboMedia *media)
qCritical() << "Media file checksum is zero";
tmp = i18n("Uploading media failed: Media file checksum is zero, please check file path. Path: %1",
media->localUrl().toDisplayString());
qDebug() << "Emitting sigError...";
qCDebug(BLOGILO_LOG) << "Emitting sigError...";
Q_EMIT sigMediaError(tmp, media);
delete m;
return;
......@@ -235,7 +235,7 @@ void Backend::uploadMedia(BilboMedia *media)
if (!MWBlog) {
qCritical() << "MWBlog is NULL: casting has not worked, this should NEVER happen, has the gui allowed using GDATA?";
tmp = i18n("INTERNAL ERROR: MWBlog is NULL: casting has not worked, this should NEVER happen.");
qDebug() << "Emitting sigError...";
qCDebug(BLOGILO_LOG) << "Emitting sigError...";
Q_EMIT sigError(tmp);
delete m;
return;
......@@ -253,7 +253,7 @@ void Backend::uploadMedia(BilboMedia *media)
void Backend::mediaUploaded(KBlog::BlogMedia *media)
{
qDebug() << "Blog Id: " << d->bBlog->id() << "Media: " << media->url();
qCDebug(BLOGILO_LOG) << "Blog Id: " << d->bBlog->id() << "Media: " << media->url();
if (!media) {
qCritical() << "ERROR! Media returned from KBlog is NULL!";
return;
......@@ -268,7 +268,7 @@ void Backend::mediaUploaded(KBlog::BlogMedia *media)
if (media->status() == KBlog::BlogMedia::Error) {
qCritical() << "Upload error! with this message: " << media->error();
const QString tmp(i18n("Uploading media failed: %1", media->error()));
qDebug() << "Emitting sigMediaError ...";
qCDebug(BLOGILO_LOG) << "Emitting sigMediaError ...";
Q_EMIT sigMediaError(tmp, m);
return;
}
......@@ -278,19 +278,19 @@ void Backend::mediaUploaded(KBlog::BlogMedia *media)
" Checksum of received file: " << newChecksum << "Error: " << media->error() << endl;
const QString tmp(i18n("Uploading media failed: Checksum error. Returned error: %1",
media->error()));
qDebug() << "Emitting sigMediaError ...";
qCDebug(BLOGILO_LOG) << "Emitting sigMediaError ...";
Q_EMIT sigMediaError(tmp, m);
return;
}
m->setRemoteUrl(QUrl(media->url().url()).toString());
m->setUploaded(true);
qDebug() << "Emitting sigMediaUploaded...";
qCDebug(BLOGILO_LOG) << "Emitting sigMediaUploaded...";
Q_EMIT sigMediaUploaded(m);
}
void Backend::modifyPost(BilboPost *post)
{
qDebug() << "Blog Id: " << d->bBlog->id();
qCDebug(BLOGILO_LOG) << "Blog Id: " << d->bBlog->id();
// BilboPost tmpPost = post;
preparePost(post);
connect(d->kBlog, &KBlog::Blog::modifiedPost, this, &Backend::postPublished);
......@@ -299,7 +299,7 @@ void Backend::modifyPost(BilboPost *post)
void Backend::removePost(BilboPost *post)
{
qDebug() << "Blog Id: " << d->bBlog->id();
qCDebug(BLOGILO_LOG) << "Blog Id: " << d->bBlog->id();
// KBlog::BlogPost *bp = post.toKBlogPost();
connect(d->kBlog, &KBlog::Blog::removedPost, this, &Backend::slotPostRemoved);
......@@ -309,11 +309,11 @@ void Backend::removePost(BilboPost *post)
void Backend::slotPostRemoved(KBlog::BlogPost *post)
{
if (!post) {
qDebug() << "post returned from server is NULL";
qCDebug(BLOGILO_LOG) << "post returned from server is NULL";
return;
}
if (!DBMan::self()->removePost(d->bBlog->id(), post->postId())) {
qDebug() << "cannot remove post from database, error: " << DBMan::self()->lastErrorText();
qCDebug(BLOGILO_LOG) << "cannot remove post from database, error: " << DBMan::self()->lastErrorText();
}
emit sigPostRemoved(d->bBlog->id(), BilboPost(*post));
}
......@@ -333,22 +333,22 @@ void Backend::slotPostFetched(KBlog::BlogPost *post)
void Backend::error(KBlog::Blog::ErrorType type, const QString &errorMessage)
{
qDebug() << "Blog Id: " << d->bBlog->id();
qCDebug(BLOGILO_LOG) << "Blog Id: " << d->bBlog->id();
QString errType = errorTypeToString(type);
errType += errorMessage;
qDebug() << errType;
qDebug() << "Emitting sigError";
qCDebug(BLOGILO_LOG) << errType;
qCDebug(BLOGILO_LOG) << "Emitting sigError";
Q_EMIT sigError(errType);
}
void Backend::slotMediaError(KBlog::Blog::ErrorType type, const QString &errorMessage,
KBlog::BlogMedia *media)
{
qDebug();
qCDebug(BLOGILO_LOG);
QString errType = errorTypeToString(type);
errType += errorMessage;
qDebug() << errType;
qDebug() << "Emitting sigMediaError ...";
qCDebug(BLOGILO_LOG) << errType;
qCDebug(BLOGILO_LOG) << "Emitting sigMediaError ...";
emit sigMediaError(errorMessage, d->mPublishMediaMap[ media ]);
d->mPublishMediaMap.remove(media);
}
......@@ -385,7 +385,7 @@ void Backend::savePostInDbAndEmitResult(KBlog::BlogPost *post)
Q_EMIT sigError(i18n("post is NULL"));
return;
}
qDebug() << "isPrivate: " << post->isPrivate();
qCDebug(BLOGILO_LOG) << "isPrivate: " << post->isPrivate();
BilboPost *pp = new BilboPost(*post);
int post_id;
if (d->mSubmitPostStatusMap[ post ] == KBlog::BlogPost::Modified) {
......@@ -397,7 +397,7 @@ void Backend::savePostInDbAndEmitResult(KBlog::BlogPost *post)
if (post_id != -1) {
pp->setPrivate(post->isPrivate());
pp->setId(post_id);
qDebug() << "Emitting sigPostPublished ...";
qCDebug(BLOGILO_LOG) << "Emitting sigPostPublished ...";
Q_EMIT sigPostPublished(d->bBlog->id(), pp);
}
// TODO crashes stylegetter on GData. Somehow the post gets deleted before
......
......@@ -23,7 +23,7 @@
#include "bilbomedia.h"
#include <qdebug.h>
#include "blogilo_debug.h"
#include <QIcon>
#include <QPixmap>
#include <QUrl>
......@@ -141,7 +141,7 @@ QIcon BilboMedia::icon() const
if (!iconPic.isNull()) {
return QIcon(iconPic);
} else {
qDebug() << "iconPic is Null";
qCDebug(BLOGILO_LOG) << "iconPic is Null";
}
}
......
......@@ -23,7 +23,7 @@
#include "bilbopost.h"
#include <kdatetime.h>
#include <qdebug.h>
#include "blogilo_debug.h"
#include <QStringList>
class BilboPostPrivate
......@@ -150,7 +150,7 @@ void BilboPost::setCategoryList(const QList< Category > &list)
void BilboPost::setProperties(const BilboPost &postProp)
{
qDebug();
qCDebug(BLOGILO_LOG);
this->setCreationDateTime(postProp.creationDateTime());
this->setModificationDateTime(postProp.modificationDateTime());
this->setLink(postProp.link());
......
......@@ -22,7 +22,7 @@
#include <kblog/blogpost.h>
#include <kblog/blogcomment.h>
#include <QDebug>
#include "blogilo_debug.h"
#include <KLocalizedString>
#include <KGAPI/Blogger/Blog>
......@@ -232,12 +232,12 @@ bool BloggerPrivate::handleError(KGAPI2::Job *job)
Blogger::Blogger(const QUrl &server, QObject *parent)
: Blog(server, *new BloggerPrivate(this), parent)
{
qDebug();
qCDebug(BLOGILO_LOG);
}
Blogger::~Blogger()
{
qDebug();
qCDebug(BLOGILO_LOG);
}
QString Blogger::interfaceName() const
......@@ -262,7 +262,7 @@ void Blogger::authenticate(const QMap<QString, QString> &authData)
Q_D(Blogger);
KGAPI2::AccountPtr account;
qDebug() << authData;
qCDebug(BLOGILO_LOG) << authData;
if (!authData.isEmpty()) {
QList<QUrl> scopes;
scopes << KGAPI2::Account::bloggerScopeUrl();
......
/* This file is part of the KDE project
Copyright (C) 2014 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "blogilo_debug.h"
Q_LOGGING_CATEGORY(BLOGILO_LOG, "log_blogilo")
/* This file is part of the KDE project
Copyright (C) 2014 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef BLOGILO_DEBUG_H
#define BLOGILO_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(BLOGILO_LOG)
#endif
......@@ -25,7 +25,7 @@
#include "addeditblog.h"
#include "dbman.h"
#include <qdebug.h>
#include "blogilo_debug.h"
#include <KMessageBox>
#include <QIcon>
#include <KLocalizedString>
......
......@@ -30,7 +30,7 @@
#include <kmessagebox.h>
#include <kseparator.h>
#include <QPushButton>
#include <QDebug>
#include "blogilo_debug.h"
#include "stylegetter.h"
#include "global.h"
......@@ -58,7 +58,7 @@ BilboBrowser::BilboBrowser(QWidget *parent)
BilboBrowser::~BilboBrowser()
{
qDebug();
qCDebug(BLOGILO_LOG);
}
void BilboBrowser::createUi(QWidget *parent)
......
......@@ -23,7 +23,7 @@
#include "bilbomedia.h"
#include "global.h"
#include <QDebug>
#include "blogilo_debug.h"
#include <QAction>
#include <KLocalizedString>
......@@ -109,12 +109,12 @@ void BlogiloComposerEditor::setReadOnly(bool _readOnly)
QList< BilboMedia * > BlogiloComposerEditor::getLocalImages()
{
qDebug();
qCDebug(BLOGILO_LOG);
QList< BilboMedia * > list;
QWebElementCollection images = view()->page()->mainFrame()->findAllElements(QLatin1String("img"));
Q_FOREACH (const QWebElement &elm, images) {
if (elm.attribute(QLatin1String("src")).startsWith(QLatin1String("file://"))) {
// qDebug()<<elm.toOuterXml();
// qCDebug(BLOGILO_LOG)<<elm.toOuterXml();
BilboMedia *media = new BilboMedia(this);
QUrl mediaUrl(elm.attribute(QLatin1String("src")));
media->setLocalUrl(mediaUrl);
......
......@@ -31,7 +31,7 @@
#include <QAction>
#include <klocalizedstring.h>
#include <QDebug>
#include "blogilo_debug.h"
#include <QMenu>
class HtmlEditorPrivate
......@@ -54,9 +54,9 @@ HtmlEditor::HtmlEditor() : QObject()
HtmlEditor::~HtmlEditor()
{