Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 43470222 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Add more context some qCDebugs

Don't just print an arbitrary value, always provide a context
of what that value means.
parent f70b9e87
......@@ -971,7 +971,8 @@ void ResourceBasePrivate::slotSynchronizeCollection(const Collection &col)
emit q->status(AgentBase::Running, i18nc("@info:status", "Syncing folder '%1'", currentCollection.displayName()));
}
qCDebug(AKONADIAGENTBASE_LOG) << currentCollection.id() << currentCollection.displayName();
qCDebug(AKONADIAGENTBASE_LOG) << "Preparing collection sync of collection" <<
<< currentCollection.id() << currentCollection.displayName();
Akonadi::CollectionFetchJob *fetchJob = new Akonadi::CollectionFetchJob(col, CollectionFetchJob::Base, this);
fetchJob->setFetchScope(q->changeRecorder()->collectionFetchScope());
connect(fetchJob, SIGNAL(result(KJob*)), q, SLOT(slotItemRetrievalCollectionFetchDone(KJob*)));
......
......@@ -62,7 +62,8 @@ bool AgentServer::started(const QString &identifier) const
void AgentServer::startAgent(const QString &identifier, const QString &typeIdentifier, const QString &fileName)
{
qCDebug(AKONADIAGENTSERVER_LOG) << identifier << typeIdentifier << fileName;
qCDebug(AKONADIAGENTSERVER_LOG) << "Starting agent" << identifier << "of type"
<< typeIdentifier << "(file:" << fileName << ")";
//First try to load it staticly
const QObjectList objList = QPluginLoader::staticInstances();
......
......@@ -140,7 +140,6 @@ void Connection::doReconnect()
}
options.insert(pair.first(), pair.last());
}
qCDebug(AKONADICORE_LOG) << protocol << options;
if (protocol == "unix") {
serverAddress = options.value(QStringLiteral("path"));
......@@ -154,7 +153,7 @@ void Connection::doReconnect()
const QString connectionConfigFile = StandardDirs::connectionConfigFile();
const QFileInfo fileInfo(connectionConfigFile);
if (!fileInfo.exists()) {
qCDebug(AKONADICORE_LOG) << "Akonadi Client Session: connection config file '"
qCWarning(AKONADICORE_LOG) << "Akonadi Client Session: connection config file '"
"akonadi/akonadiconnectionrc' can not be found!";
}
......
......@@ -98,7 +98,7 @@ bool Control::Private::exec()
void Control::Private::serverStateChanged(ServerManager::State state)
{
qCDebug(AKONADICORE_LOG) << state;
qCDebug(AKONADICORE_LOG) << "Server state changed to" << state;
if (mEventLoop && mEventLoop->isRunning()) {
// ignore transient states going into the right direction
if ((mStarting && (state == ServerManager::Starting || state == ServerManager::Upgrading)) ||
......
......@@ -57,7 +57,7 @@ Firstrun::Firstrun(QObject *parent)
}
if (KDBusConnectionPool::threadConnection().registerService(QLatin1String(FIRSTRUN_DBUSLOCK))) {
findPendingDefaults();
qCDebug(AKONADICORE_LOG) << mPendingDefaults;
qCDebug(AKONADICORE_LOG) << "D-Bus lock acquired, pending defaults:" << mPendingDefaults;
setupNext();
} else {
qCDebug(AKONADICORE_LOG) << "D-Bus lock found, so someone else does the work for us already.";
......
......@@ -211,9 +211,9 @@ void ItemSync::setFullSyncItems(const Item::List &items)
}
d->mRemoteItemQueue += items;
d->mTotalItemsProcessed += items.count();
qCDebug(AKONADICORE_LOG) << "Received: " << items.count()
<< "In total: " << d->mTotalItemsProcessed
<< " Wanted: " << d->mTotalItems;
qCDebug(AKONADICORE_LOG) << "Received batch: " << items.count()
<< "Already processed: " << d->mTotalItemsProcessed
<< "Expected total amount: " << d->mTotalItems;
if (!d->mDisableAutomaticDeliveryDone && (d->mTotalItemsProcessed == d->mTotalItems)) {
d->mDeliveryDone = true;
}
......@@ -226,7 +226,7 @@ void ItemSync::setTotalItems(int amount)
Q_ASSERT(!d->mIncremental);
Q_ASSERT(amount >= 0);
setStreamingEnabled(true);
qCDebug(AKONADICORE_LOG) << amount;
qCDebug(AKONADICORE_LOG) << "Expected total amount:" << amount;
d->mTotalItems = amount;
setTotalAmount(KJob::Bytes, amount);
if (!d->mDisableAutomaticDeliveryDone && (d->mTotalItems == 0)) {
......
......@@ -484,7 +484,7 @@ Qt::ItemFlags FavoriteCollectionsModel::flags(const QModelIndex &index) const
void FavoriteCollectionsModel::pasteJobDone(KJob *job)
{
if (job->error()) {
qCDebug(AKONADICORE_LOG) << job->errorString();
qCDebug(AKONADICORE_LOG) << "Paste job error:" << job->errorString();
}
}
......
......@@ -87,19 +87,15 @@ PasteHelperJob::PasteHelperJob(Qt::DropAction action, const Item::List &items,
setProperty("transactionsDisabled", true);
Collection dragSourceCollection;
using namespace std::placeholders;
if (!items.isEmpty() && items.first().parentCollection().isValid()) {
// Check if all items have the same parent collection ID
const Collection parent = items.first().parentCollection();
if (std::find_if(items.constBegin(), items.constEnd(),
[parent](const Item & item) -> bool {
return item.parentCollection() != parent;
})
== items.constEnd()) {
if (!std::any_of(items.cbegin(), items.cend(),
[parent](const Item &item) {
return item.parentCollection() != parent;
})) {
dragSourceCollection = parent;
}
qCDebug(AKONADICORE_LOG) << items.first().parentCollection().id() << dragSourceCollection.id();
}
if (dragSourceCollection.isValid()) {
......
......@@ -327,14 +327,15 @@ SessionPrivate::~SessionPrivate()
void SessionPrivate::init(const QByteArray &id)
{
qCDebug(AKONADICORE_LOG) << id;
if (!id.isEmpty()) {
sessionId = id;
} else {
sessionId = QCoreApplication::instance()->applicationName().toUtf8()
+ '-' + QByteArray::number(qrand());
}
qCDebug(AKONADICORE_LOG) << "Initializing session with ID" << id;
connected = false;
theNextTag = 2;
jobRunning = false;
......
......@@ -169,7 +169,7 @@ bool ControlGui::Private::exec()
void ControlGui::Private::serverStateChanged(ServerManager::State state)
{
qCDebug(AKONADIWIDGETS_LOG) << state;
qCDebug(AKONADIWIDGETS_LOG) << "Server state changed to" << state;
if (mEventLoop && mEventLoop->isRunning()) {
// ignore transient states going into the right direction
if ((mStarting && (state == ServerManager::Starting || state == ServerManager::Upgrading)) ||
......
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