Commit 947f4a4b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ify variable + initialize variable in headers etc.

parent b46a382a
Pipeline #74652 passed with stage
in 6 minutes and 1 second
......@@ -46,7 +46,7 @@ void CalendarBaseTest::fetchCollection()
AKVERIFYEXEC(job);
// Find our collection
Collection::List collections = job->collections();
const Collection::List collections = job->collections();
QVERIFY(!collections.isEmpty());
mCollection = collections.first();
......
......@@ -74,19 +74,20 @@ QVariant CalendarModel::entityData(const Akonadi::Item &item, int column, int ro
}
switch (role) {
case Qt::DecorationRole:
case Qt::DecorationRole: {
if (column != Summary) {
return QVariant();
}
if (inc->type() == KCalendarCore::IncidenceBase::TypeTodo) {
const auto incType{inc->type()};
if (incType == KCalendarCore::IncidenceBase::TypeTodo) {
return QIcon::fromTheme(QStringLiteral("view-pim-tasks"));
} else if (inc->type() == KCalendarCore::IncidenceBase::TypeJournal) {
} else if (incType == KCalendarCore::IncidenceBase::TypeJournal) {
return QIcon::fromTheme(QStringLiteral("view-pim-journal"));
} else if (inc->type() == KCalendarCore::IncidenceBase::TypeEvent) {
} else if (incType == KCalendarCore::IncidenceBase::TypeEvent) {
return QIcon::fromTheme(QStringLiteral("view-calendar"));
}
return QIcon::fromTheme(QStringLiteral("network-wired"));
}
case Qt::DisplayRole:
switch (column) {
case Summary:
......
......@@ -26,15 +26,15 @@ public:
void start() override;
QUrl url() const;
QByteArray rawFreeBusyData() const;
Q_REQUIRED_RESULT QUrl url() const;
Q_REQUIRED_RESULT QByteArray rawFreeBusyData() const;
private Q_SLOTS:
void slotData(KIO::Job *, const QByteArray &data);
void slotResult(KJob *job);
private:
QUrl mUrl;
const QUrl mUrl;
QByteArray mFreeBusyData;
QWidget *const mParent;
};
......
......@@ -26,8 +26,6 @@ History::~History()
History::Private::Private(History *qq)
: mChanger(new IncidenceChanger(/*history=*/false, qq))
, mOperationTypeInProgress(TypeNone)
, mUndoAllInProgress(false)
, mEnabled(true)
, q(qq)
{
mChanger->setObjectName(QStringLiteral("changer")); // for auto-connects
......
......@@ -89,14 +89,14 @@ public:
Entry::Ptr mEntryInProgress;
QString mLastErrorString;
bool mUndoAllInProgress;
bool mUndoAllInProgress = false;
/**
* When recordCreation/Deletion/Modification is called and an undo operation is already in progress
* the entry is added here.
*/
QVector<Entry::Ptr> mQueuedEntries;
bool mEnabled;
bool mEnabled = true;
QPointer<QWidget> mCurrentParent;
public Q_SLOTS:
......
......@@ -26,8 +26,6 @@ public:
Private(KActionCollection *actionCollection, QWidget *parentWidget, StandardCalendarActionManager *parent)
: mActionCollection(actionCollection)
, mParentWidget(parentWidget)
, mCollectionSelectionModel(nullptr)
, mItemSelectionModel(nullptr)
, mParent(parent)
{
mGenericManager = new StandardActionManager(actionCollection, parentWidget);
......
Supports Markdown
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