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

Use qCWarning(...) too

parent 673d4ceb
Pipeline #101045 passed with stage
in 5 minutes
......@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "attachmentsmodel.h"
#include "kalendar_debug.h"
#include <QDebug>
#include <QMetaEnum>
......@@ -67,7 +68,7 @@ QVariant AttachmentsModel::data(const QModelIndex &idx, int role) const
case URIRole:
return attachment.uri();
default:
qWarning() << "Unknown role for attachment:" << QMetaEnum::fromType<Roles>().valueToKey(role);
qCWarning(KALENDAR_LOG) << "Unknown role for attachment:" << QMetaEnum::fromType<Roles>().valueToKey(role);
return {};
}
}
......
......@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "attendeesmodel.h"
#include "kalendar_debug.h"
#include <KContacts/Addressee>
#include <KLocalizedString>
#include <QMetaEnum>
......@@ -58,7 +59,7 @@ QVariant AttendeeStatusModel::data(const QModelIndex &idx, int role) const
case ValueRole:
return value;
default:
qWarning() << "Unknown role for attendee:" << QMetaEnum::fromType<Roles>().valueToKey(role);
qCWarning(KALENDAR_LOG) << "Unknown role for attendee:" << QMetaEnum::fromType<Roles>().valueToKey(role);
return {};
}
}
......@@ -171,7 +172,7 @@ QVariant AttendeesModel::data(const QModelIndex &idx, int role) const
case UidRole:
return attendee.uid();
default:
qWarning() << "Unknown role for attendee:" << QMetaEnum::fromType<Roles>().valueToKey(role);
qCWarning(KALENDAR_LOG) << "Unknown role for attendee:" << QMetaEnum::fromType<Roles>().valueToKey(role);
return {};
}
}
......@@ -240,7 +241,7 @@ bool AttendeesModel::setData(const QModelIndex &idx, const QVariant &value, int
break;
}
default:
qWarning() << "Unknown role for incidence:" << QMetaEnum::fromType<Roles>().valueToKey(role);
qCWarning(KALENDAR_LOG) << "Unknown role for incidence:" << QMetaEnum::fromType<Roles>().valueToKey(role);
return false;
}
m_incidence->setAttendees(currentAttendees);
......
......@@ -872,7 +872,7 @@ void CalendarManager::setCollectionColor(qint64 collectionId, QColor color)
auto modifyJob = new Akonadi::CollectionModifyJob(collection);
connect(modifyJob, &Akonadi::CollectionModifyJob::result, this, [this, collectionId, color](KJob *job) {
if (job->error()) {
qWarning() << "Error occurred modifying collection color: " << job->errorString();
qCWarning(KALENDAR_LOG) << "Error occurred modifying collection color: " << job->errorString();
} else {
m_baseModel->colorCache[QString::number(collectionId)] = color;
m_baseModel->save();
......@@ -914,7 +914,7 @@ void CalendarManager::deleteCollection(qint64 collectionId)
auto job = new Akonadi::CollectionDeleteJob(collection, this);
connect(job, &Akonadi::CollectionDeleteJob::result, this, [this](KJob *job) {
if (job->error()) {
qWarning() << "Error occurred deleting collection: " << job->errorString();
qCWarning(KALENDAR_LOG) << "Error occurred deleting collection: " << job->errorString();
}
});
return;
......
......@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-2.0-or-later
#include "hourlyincidencemodel.h"
#include "kalendar_debug.h"
#include <QTimeZone>
HourlyIncidenceModel::HourlyIncidenceModel(QObject *parent)
......@@ -62,7 +63,7 @@ QList<QModelIndex> HourlyIncidenceModel::sortedIncidencesFromSourceModel(const Q
// Skip incidences not part of the week
if (end < rowStart || start > rowEnd) {
// qWarning() << "Skipping because not part of this week";
// qCWarning(KALENDAR_LOG) << "Skipping because not part of this week";
continue;
}
......@@ -73,7 +74,8 @@ QList<QModelIndex> HourlyIncidenceModel::sortedIncidencesFromSourceModel(const Q
if (m_filters.testFlag(NoMultiDay) && srcIdx.data(IncidenceOccurrenceModel::Duration).value<KCalendarCore::Duration>().asDays() >= 1) {
continue;
}
// qWarning() << "found " << srcIdx.data(IncidenceOccurrenceModel::StartTime).toDateTime() << srcIdx.data(IncidenceOccurrenceModel::Summary).toString();
// qCWarning(KALENDAR_LOG) << "found " << srcIdx.data(IncidenceOccurrenceModel::StartTime).toDateTime() <<
// srcIdx.data(IncidenceOccurrenceModel::Summary).toString();
sorted.append(srcIdx);
}
......@@ -115,7 +117,8 @@ QVariantList HourlyIncidenceModel::layoutLines(const QDateTime &rowStart) const
const auto rowEnd = rowStart.date().endOfDay();
// for (const auto &srcIdx : sorted) {
// qWarning() << "sorted " << srcIdx.data(IncidenceOccurrenceModel::StartTime).toDateTime() << srcIdx.data(IncidenceOccurrenceModel::Summary).toString()
// qCWarning(KALENDAR_LOG) << "sorted " << srcIdx.data(IncidenceOccurrenceModel::StartTime).toDateTime() <<
// srcIdx.data(IncidenceOccurrenceModel::Summary).toString()
// << srcIdx.data(IncidenceOccurrenceModel::AllDay).toBool();
// }
auto result = QVariantList{};
......
......@@ -6,6 +6,7 @@
// SPDX-License-Identifier: LGPL-2.0-or-later
#include "incidenceoccurrencemodel.h"
#include "kalendar_debug.h"
#include <QMetaEnum>
#include <akonadi_version.h>
......@@ -307,7 +308,7 @@ QVariant IncidenceOccurrenceModel::data(const QModelIndex &idx, int role) const
case IncidenceOccurrence:
return QVariant::fromValue(incidence);
default:
qWarning() << "Unknown role for incidence:" << QMetaEnum::fromType<Roles>().valueToKey(role);
qCWarning(KALENDAR_LOG) << "Unknown role for incidence:" << QMetaEnum::fromType<Roles>().valueToKey(role);
return {};
}
}
......
......@@ -4,8 +4,8 @@
SPDX-License-Identifier: GPL-2.0-or-later WITH LicenseRef-Qt-Commercial-exception-1.0
*/
//#include "calendarview_debug.h"
#include "incidencetreemodel_p.h"
#include "kalendar_debug.h"
#if AKONADI_VERSION >= QT_VERSION_CHECK(5, 18, 41)
#include <Akonadi/EntityTreeModel>
#else
......
......@@ -82,7 +82,7 @@ void IncidenceWrapper::setIncidenceItem(const Akonadi::Item &incidenceItem)
Q_EMIT incidenceItemChanged();
Q_EMIT collectionIdChanged();
} else {
qWarning() << "This is not an incidence item.";
qCWarning(KALENDAR_LOG) << "This is not an incidence item.";
}
}
......@@ -315,7 +315,7 @@ void IncidenceWrapper::setIncidenceEnd(const QDateTime &incidenceEnd, bool respe
KCalendarCore::Todo::Ptr todo = m_incidence.staticCast<KCalendarCore::Todo>();
todo->setDtDue(end);
} else {
qWarning() << "Unknown incidence type";
qCWarning(KALENDAR_LOG) << "Unknown incidence type";
}
Q_EMIT incidenceEndChanged();
Q_EMIT incidenceEndDateDisplayChanged();
......@@ -683,7 +683,7 @@ void IncidenceWrapper::setRegularRecurrence(IncidenceWrapper::RecurrenceInterval
Q_EMIT recurrenceDataChanged();
return;
default:
qWarning() << "Unknown interval for recurrence" << interval;
qCWarning(KALENDAR_LOG) << "Unknown interval for recurrence" << interval;
return;
}
}
......
......@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "incidenceoccurrencemodel.h"
#include "kalendar_debug.h"
#include <QDebug>
#include <QMetaEnum>
#include <akonadi_version.h>
......@@ -179,7 +180,7 @@ QVariant InfiniteCalendarViewModel::data(const QModelIndex &idx, int role) const
return QVariant::fromValue(m_scheduleViewModels[firstDay]);
}
default:
qWarning() << "Unknown role for startdate:" << QMetaEnum::fromType<Roles>().valueToKey(role);
qCWarning(KALENDAR_LOG) << "Unknown role for startdate:" << QMetaEnum::fromType<Roles>().valueToKey(role);
return {};
}
}
......@@ -232,7 +233,7 @@ QVariant InfiniteCalendarViewModel::data(const QModelIndex &idx, int role) const
return QVariant::fromValue(m_weekViewMultiDayModels[startDate]);
}
default:
qWarning() << "Unknown role for startdate:" << QMetaEnum::fromType<Roles>().valueToKey(role);
qCWarning(KALENDAR_LOG) << "Unknown role for startdate:" << QMetaEnum::fromType<Roles>().valueToKey(role);
return {};
}
}
......
// SPDX-FileCopyrightText: 2021 Claudio Cambra <claudio.cambra@gmail.com>
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "kalendar_debug.h"
#include <QMetaEnum>
#include <akonadi_version.h>
#if AKONADI_VERSION >= QT_VERSION_CHECK(5, 18, 41)
#include <Akonadi/ItemFetchJob>
......@@ -55,7 +55,7 @@ QVariant ItemTagsModel::data(const QModelIndex &idx, int role) const
case IdRole:
return tag.id();
default:
qWarning() << "Unknown role for item tag:" << QMetaEnum::fromType<Roles>().valueToKey(role);
qCWarning(KALENDAR_LOG) << "Unknown role for item tag:" << QMetaEnum::fromType<Roles>().valueToKey(role);
return {};
}
}
......
......@@ -6,6 +6,7 @@
// SPDX-License-Identifier: LGPL-2.0-or-later
#include "multidayincidencemodel.h"
#include "kalendar_debug.h"
#include <QBitArray>
MultiDayIncidenceModel::MultiDayIncidenceModel(QObject *parent)
......@@ -66,7 +67,7 @@ QList<QModelIndex> MultiDayIncidenceModel::sortedIncidencesFromSourceModel(const
// Skip incidences not part of the week
if (end < rowStart || start > rowEnd) {
// qWarning() << "Skipping because not part of this week";
// qCWarning(KALENDAR_LOG) << "Skipping because not part of this week";
continue;
}
......@@ -74,7 +75,8 @@ QList<QModelIndex> MultiDayIncidenceModel::sortedIncidencesFromSourceModel(const
continue;
}
// qWarning() << "found " << srcIdx.data(IncidenceOccurrenceModel::StartTime).toDateTime() << srcIdx.data(IncidenceOccurrenceModel::Summary).toString();
// qCWarning(KALENDAR_LOG) << "found " << srcIdx.data(IncidenceOccurrenceModel::StartTime).toDateTime() <<
// srcIdx.data(IncidenceOccurrenceModel::Summary).toString();
sorted.append(srcIdx);
}
......@@ -127,7 +129,8 @@ QVariantList MultiDayIncidenceModel::layoutLines(const QDate &rowStart) const
QList<QModelIndex> sorted = sortedIncidencesFromSourceModel(rowStart);
// for (const auto &srcIdx : sorted) {
// qWarning() << "sorted " << srcIdx.data(IncidenceOccurrenceModel::StartTime).toDateTime() << srcIdx.data(IncidenceOccurrenceModel::Summary).toString()
// qCWarning(KALENDAR_LOG) << "sorted " << srcIdx.data(IncidenceOccurrenceModel::StartTime).toDateTime() <<
// srcIdx.data(IncidenceOccurrenceModel::Summary).toString()
// << srcIdx.data(IncidenceOccurrenceModel::AllDay).toBool();
// }
......@@ -140,7 +143,7 @@ QVariantList MultiDayIncidenceModel::layoutLines(const QDate &rowStart) const
const auto start = getStart(srcIdx.data(IncidenceOccurrenceModel::StartTime).toDateTime().date());
const auto duration = qMin(getDuration(startDate, srcIdx.data(IncidenceOccurrenceModel::EndTime).toDateTime().date()), mPeriodLength - start);
// qWarning() << "First of line " << srcIdx.data(IncidenceOccurrenceModel::StartTime).toDateTime() << duration <<
// qCWarning(KALENDAR_LOG) << "First of line " << srcIdx.data(IncidenceOccurrenceModel::StartTime).toDateTime() << duration <<
// srcIdx.data(IncidenceOccurrenceModel::Summary).toString();
auto currentLine = QVariantList{};
......@@ -173,7 +176,7 @@ QVariantList MultiDayIncidenceModel::layoutLines(const QDate &rowStart) const
};
if (start >= mPeriodLength) {
// qWarning() << "Skipping " << srcIdx.data(IncidenceOccurrenceModel::Summary);
// qCWarning(KALENDAR_LOG) << "Skipping " << srcIdx.data(IncidenceOccurrenceModel::Summary);
continue;
}
......@@ -191,7 +194,7 @@ QVariantList MultiDayIncidenceModel::layoutLines(const QDate &rowStart) const
auto doesIntersect = [&](int start, int end) {
for (int i = start; i < end; i++) {
if (takenSpaces[i]) {
// qWarning() << "Found intersection " << start << end;
// qCWarning(KALENDAR_LOG) << "Found intersection " << start << end;
return true;
}
}
......@@ -224,7 +227,7 @@ QVariantList MultiDayIncidenceModel::layoutLines(const QDate &rowStart) const
it = sorted.erase(it);
}
}
// qWarning() << "Appending line " << currentLine;
// qCWarning(KALENDAR_LOG) << "Appending line " << currentLine;
result.append(QVariant::fromValue(currentLine));
}
return result;
......@@ -338,7 +341,7 @@ int MultiDayIncidenceModel::incidenceCount()
// Skip incidences not part of the week
if (end < rowStart || start > rowEnd) {
// qWarning() << "Skipping because not part of this week";
// qCWarning(KALENDAR_LOG) << "Skipping because not part of this week";
continue;
}
......
......@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "recurrenceexceptionsmodel.h"
#include "kalendar_debug.h"
#include <QDebug>
#include <QMetaEnum>
......@@ -71,7 +72,7 @@ QVariant RecurrenceExceptionsModel::data(const QModelIndex &idx, int role) const
case DateRole:
return exception;
default:
qWarning() << "Unknown role for incidence:" << QMetaEnum::fromType<Roles>().valueToKey(role);
qCWarning(KALENDAR_LOG) << "Unknown role for incidence:" << QMetaEnum::fromType<Roles>().valueToKey(role);
return {};
}
}
......
// SPDX-FileCopyrightText: 2021 Claudio Cambra <claudio.cambra@gmail.com>
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "kalendar_debug.h"
#include <QMetaEnum>
#include <remindersmodel.h>
......@@ -57,7 +58,7 @@ QVariant RemindersModel::data(const QModelIndex &idx, int role) const
case EndOffsetRole:
return alarm->endOffset().asSeconds();
default:
qWarning() << "Unknown role for incidence:" << QMetaEnum::fromType<Roles>().valueToKey(role);
qCWarning(KALENDAR_LOG) << "Unknown role for incidence:" << QMetaEnum::fromType<Roles>().valueToKey(role);
return {};
}
}
......@@ -92,7 +93,7 @@ bool RemindersModel::setData(const QModelIndex &idx, const QVariant &value, int
break;
}
default:
qWarning() << "Unknown role for incidence:" << QMetaEnum::fromType<Roles>().valueToKey(role);
qCWarning(KALENDAR_LOG) << "Unknown role for incidence:" << QMetaEnum::fromType<Roles>().valueToKey(role);
return false;
}
emit dataChanged(idx, idx);
......
......@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "timezonelistmodel.h"
#include "kalendar_debug.h"
#include <KLocalizedString>
#include <QByteArray>
#include <QDebug>
......@@ -37,7 +38,7 @@ QVariant TimeZoneListModel::data(const QModelIndex &idx, int role) const
case IdRole:
return timeZone;
default:
qWarning() << "Unknown role for timezone:" << QMetaEnum::fromType<Roles>().valueToKey(role);
qCWarning(KALENDAR_LOG) << "Unknown role for timezone:" << QMetaEnum::fromType<Roles>().valueToKey(role);
return {};
}
}
......
......@@ -5,6 +5,7 @@
*/
#include "incidencetreemodel.h"
#include "kalendar_debug.h"
#include "todomodel_p.h"
#include <CalendarSupport/KCalPrefs>
......
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