Commit 7aaf8b4b authored by Rolf Eike Beer's avatar Rolf Eike Beer

port away from kDebug()

parent 6e265458
......@@ -141,6 +141,7 @@ set(kgpg_SRCS ${core_SRCS} ${kgpg_editor_SRCS} ${kgpg_model_SRCS} ${kgpg_transac
kgpgoptions.cpp
keysmanager.cpp
kgpg.cpp
kgpg_debug.cpp
main.cpp
kgpgkeygenerate.cpp
kgpginterface.cpp
......@@ -189,6 +190,7 @@ set(kgpg_HDRS
kgpgoptions.h
kgpgrevokewidget.h
kgpgtextinterface.h
kgpg_debug.h
klinebufferedprocess.h
newkey.h
selectexpirydate.h
......
......@@ -25,7 +25,8 @@
#include "transactions/kgpgsignuid.h"
#include "gpgproc.h"
#include <KDebug>
#include <QDebug>
#include "kgpg_debug.h"
#include <KLocalizedString>
#include <KMessageBox>
......@@ -144,7 +145,7 @@ KGpgCaffPrivate::abortOperation(int result)
{
Q_Q(KGpgCaff);
kDebug(2100) << "transaction" << sender() << "failed, result" << result;
qCDebug(KGPG_LOG_GENERAL) << "transaction" << sender() << "failed, result" << result;
m_tempdir.reset();
emit q->aborted();
......
......@@ -22,7 +22,8 @@
#include "KGpgRootNode.h"
#include "kgpgsettings.h"
#include <KDebug>
#include <QDebug>
#include "kgpg_debug.h"
#include <KLocalizedString>
#include <QFile>
......@@ -185,7 +186,7 @@ KGpgGroupNode::rename(const QString &newName)
return;
if (index < 0) {
kDebug(2100) << "Group " << d->m_name << " not renamed, group does not exist";
qCDebug(KGPG_LOG_GENERAL) << "Group " << d->m_name << " not renamed, group does not exist";
return;
}
......
......@@ -21,7 +21,8 @@
#include "convert.h"
#include <KDebug>
#include <QDebug>
#include "kgpg_debug.h"
#include <gpgme.h>
#include "kgpgsettings.h"
......@@ -218,7 +219,7 @@ KgpgSubKeyType toSubType(const QString& capString, bool upper)
case '?': // unknown to GnuPG
continue;
default:
kDebug(2100) << "unknown capability letter" << ch
qCDebug(KGPG_LOG_GENERAL) << "unknown capability letter" << ch
<< "in cap string" << capString;
}
}
......
......@@ -15,7 +15,8 @@
#include "kgpgsettings.h"
#include <KDebug>
#include <QDebug>
#include "kgpg_debug.h"
#include <KProcess>
#include <KStandardDirs>
......@@ -115,12 +116,12 @@ getGpgProcessHome(const QString &binary)
void GnupgBinary::setBinary(const QString &executable)
{
kDebug(2100) << "checking version of GnuPG executable" << executable;
qCDebug(KGPG_LOG_GENERAL) << "checking version of GnuPG executable" << executable;
// must be set first as gpgVersionString() uses GPGProc to parse the output
m_binary = executable;
const QString verstr = GPGProc::gpgVersionString(executable);
m_version = GPGProc::gpgVersion(verstr);
kDebug(2100) << "version is" << verstr << m_version;
qCDebug(KGPG_LOG_GENERAL) << "version is" << verstr << m_version;
m_useDebugLevel = (m_version > 0x20000);
......
......@@ -61,7 +61,8 @@
#include <akonadi/contact/contacteditordialog.h>
#include <akonadi/contact/contactsearchjob.h>
#include <KActionCollection>
#include <KDebug>
#include <QDebug>
#include "kgpg_debug.h"
#include <KLocalizedString>
#include <KMessageBox>
#include <KMimeTypeTrader>
......@@ -1126,7 +1127,7 @@ void KeysManager::checkList()
changeMessage(i18n("Group member"));
break;
default:
kDebug(2100) << "Oops, unmatched type value" << exportList.at(0)->getType();
qCDebug(KGPG_LOG_GENERAL) << "Oops, unmatched type value" << exportList.at(0)->getType();
}
}
......@@ -1678,7 +1679,7 @@ void KeysManager::keyproperties()
break;
}
default:
kDebug(2100) << "Oops, called with invalid item type" << cur->getType();
qCDebug(KGPG_LOG_GENERAL) << "Oops, called with invalid item type" << cur->getType();
return;
}
......@@ -2308,7 +2309,7 @@ void KeysManager::slotEditDone(int exitcode)
void KeysManager::doPrint(const QString &txt)
{
QPrinter prt;
//kDebug(2100) << "Printing..." ;
//qCDebug(KGPG_LOG_GENERAL) << "Printing..." ;
QPointer<QPrintDialog> printDialog = new QPrintDialog(&prt, this);
if (printDialog->exec() == QDialog::Accepted) {
QPainter painter(&prt);
......
/* This file is part of the KDE project
Copyright (C) 2015 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 "kgpg_debug.h"
Q_LOGGING_CATEGORY(KGPG_LOG_GENERAL, "log_kgpg")
Q_LOGGING_CATEGORY(KGPG_LOG_TRANSACTIONS, "log_kgpg")
/* This file is part of the KDE project
Copyright (C) 2015 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 KGPG_DEBUG_H
#define KGPG_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(KGPG_LOG_GENERAL)
Q_DECLARE_LOGGING_CATEGORY(KGPG_LOG_TRANSACTIONS)
#endif
......@@ -24,7 +24,8 @@
#include <KConfig>
#include <KConfigGroup>
#include <KDebug>
#include <QDebug>
#include "kgpg_debug.h"
#include <KDesktopFile>
#include <KFontChooser>
#include <KLocalizedString>
......@@ -333,7 +334,7 @@ void kgpgOptions::updateWidgets()
if (!serverList.isEmpty())
m_serverModel->setDefault(keyServer);
kDebug(2100) << "Finishing options";
qCDebug(KGPG_LOG_GENERAL) << "Finishing options";
}
void kgpgOptions::updateWidgetsDefault()
......@@ -351,7 +352,7 @@ void kgpgOptions::updateWidgetsDefault()
m_page3->kcfg_EmailSorting->setCurrentIndex(KGpgSettings::EnumEmailSorting::Alphabetical);
kDebug(2100) << "Finishing default options" ;
qCDebug(KGPG_LOG_GENERAL) << "Finishing default options" ;
}
void kgpgOptions::updateSettings()
......
......@@ -14,7 +14,8 @@
#include "kgpgsearchresultmodel.h"
#include <KDebug>
#include <QDebug>
#include "kgpg_debug.h"
#include <KLocalizedString>
#include <QDateTime>
......@@ -473,7 +474,7 @@ KGpgSearchResultBackingModel::slotAddKey(const QStringList &lines)
} else if (line.startsWith(QLatin1String("uat:"))) {
nkey->m_uatCount++;
} else {
kDebug(2100) << "ignored search result line" << line;
qCDebug(KGPG_LOG_GENERAL) << "ignored search result line" << line;
}
}
......
......@@ -13,7 +13,8 @@
#include "kgpggeneraterevoke.h"
#include <KDebug>
#include <QDebug>
#include "kgpg_debug.h"
#include <KLocalizedString>
#include <QFile>
......@@ -68,7 +69,7 @@ KGpgGenerateRevoke::nextLine(const QString &line)
m_description.clear();
} else if (line.contains(QLatin1String( "GET_" ))) {
setSuccess(TS_MSG_SEQUENCE);
kDebug(2100) << line;
qCDebug(KGPG_LOG_GENERAL) << line;
return true;
}
......
......@@ -16,7 +16,8 @@
#include "model/kgpgitemmodel.h"
#include "core/KGpgKeyNode.h"
#include <KDebug>
#include <QDebug>
#include "kgpg_debug.h"
#include <KLocalizedString>
KGpgImport::KGpgImport(QObject *parent, const QString &text)
......@@ -68,14 +69,14 @@ KGpgImport::getImportedIds(const QStringList &log, const int reason)
int space = tmpstr.indexOf(QLatin1Char( ' ' ));
if (space <= 0) {
kDebug(2100) << __LINE__ << "invalid format:" << str;
qCDebug(KGPG_LOG_GENERAL) << __LINE__ << "invalid format:" << str;
continue;
}
bool ok;
unsigned char code = tmpstr.left(space).toUInt(&ok);
if (!ok) {
kDebug(2100) << __LINE__ << "invalid format:" << str << space << tmpstr.left(space - 1);
qCDebug(KGPG_LOG_GENERAL) << __LINE__ << "invalid format:" << str << space << tmpstr.left(space - 1);
continue;
}
......@@ -209,7 +210,7 @@ KGpgImport::getDetailedImportMessage(const QStringList &log, const KGpgItemModel
QStringList rc(keyresult.mid(19).split(QLatin1Char( ' ' )));
if (rc.count() < 2) {
kDebug(2100) << "unexpected syntax:" << keyresult;
qCDebug(KGPG_LOG_GENERAL) << "unexpected syntax:" << keyresult;
continue;
}
......
......@@ -15,7 +15,8 @@
#include "gpgproc.h"
#include <KDebug>
#include <QDebug>
#include "kgpg_debug.h"
#include <KIO/Job>
#include <QRegExp>
......@@ -67,7 +68,7 @@ KGpgTextOrFileTransaction::setText(const QString &text)
if (text.mid(begin, charset.length()) == charset) {
QString cs = text.mid(begin + charset.length(), nextlf - begin - charset.length());
if (!getProcess()->setCodec(cs.toAscii()))
kDebug(2100) << "unsupported charset found in header" << cs;
qCDebug(KGPG_LOG_GENERAL) << "unsupported charset found in header" << cs;
break;
}
begin = nextlf + 1;
......
......@@ -23,7 +23,8 @@
#include <QWidget>
#include <KConfigGroup>
#include <KDebug>
#include <QDebug>
#include "kgpg_debug.h"
#include <KNewPasswordDialog>
#include <KLocalizedString>
#include <KPasswordDialog>
......@@ -53,7 +54,7 @@ KGpgTransaction::start()
if (d->m_inputTransaction != Q_NULLPTR)
d->m_inputTransaction->start();
#ifdef KGPG_DEBUG_TRANSACTIONS
kDebug(2100) << this << d->m_process->program();
qCDebug(KGPG_LOG_TRANSACTIONS) << this << d->m_process->program();
#endif /* KGPG_DEBUG_TRANSACTIONS */
d->m_process->start();
emit infoProgress(0, 1);
......@@ -101,7 +102,7 @@ void
KGpgTransaction::setSuccess(const int v)
{
#ifdef KGPG_DEBUG_TRANSACTIONS
kDebug(2100) << "old" << d->m_success << "new" << v;
qCDebug(KGPG_LOG_TRANSACTIONS) << "old" << d->m_success << "new" << v;
#endif /* KGPG_DEBUG_TRANSACTIONS */
d->m_success = v;
}
......@@ -158,7 +159,7 @@ KGpgTransaction::waitForInputTransaction()
void
KGpgTransaction::unexpectedLine(const QString &line)
{
kDebug(2100) << this << "unexpected input line" << line << "for command" << d->m_process->program();
qCDebug(KGPG_LOG_GENERAL) << this << "unexpected input line" << line << "for command" << d->m_process->program();
}
bool
......
......@@ -15,7 +15,8 @@
#include <QWeakPointer>
#include <QWidget>
#include <KDebug>
#include <QDebug>
#include "kgpg_debug.h"
#include <KLocalizedString>
#include <KIO/RenameDialog>
......@@ -66,7 +67,7 @@ KGpgTransactionPrivate::slotReadReady()
if (m_quitTries)
m_quitLines << line;
#ifdef KGPG_DEBUG_TRANSACTIONS
kDebug(2100) << m_parent << line;
qCDebug(KGPG_LOG_TRANSACTIONS) << m_parent << line;
#endif /* KGPG_DEBUG_TRANSACTIONS */
static const QString getBool = QLatin1String("[GNUPG:] GET_BOOL ");
......@@ -224,13 +225,13 @@ KGpgTransactionPrivate::sendQuit(void)
#ifdef KGPG_DEBUG_TRANSACTIONS
if (m_quitTries == 0)
kDebug(2100) << "sending quit";
qCDebug(KGPG_LOG_TRANSACTIONS) << "sending quit";
#endif /* KGPG_DEBUG_TRANSACTIONS */
if (m_quitTries++ >= 3) {
kDebug(2100) << "tried" << m_quitTries << "times to quit the GnuPG session";
kDebug(2100) << "last input was" << m_quitLines;
kDebug(2100) << "please file a bug report at https://bugs.kde.org";
qCDebug(KGPG_LOG_GENERAL) << "tried" << m_quitTries << "times to quit the GnuPG session";
qCDebug(KGPG_LOG_GENERAL) << "last input was" << m_quitLines;
qCDebug(KGPG_LOG_GENERAL) << "please file a bug report at https://bugs.kde.org";
m_process->closeWriteChannel();
m_success = KGpgTransaction::TS_MSG_SEQUENCE;
}
......@@ -285,7 +286,7 @@ KGpgTransactionPrivate::write(const QByteArray &a)
{
m_process->write(a);
#ifdef KGPG_DEBUG_TRANSACTIONS
kDebug(2100) << m_parent << a;
qCDebug(KGPG_LOG_TRANSACTIONS) << m_parent << a;
#endif /* KGPG_DEBUG_TRANSACTIONS */
}
......@@ -311,6 +312,6 @@ KGpgTransactionPrivate::processDone()
emit m_parent->infoProgress(100, 100);
emit m_parent->done(m_success);
#ifdef KGPG_DEBUG_TRANSACTIONS
kDebug(2100) << this << "result:" << m_success;
qCDebug(KGPG_LOG_TRANSACTIONS) << this << "result:" << m_success;
#endif /* KGPG_DEBUG_TRANSACTIONS */
}
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