Commit 46521a2a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use explicit/nullptr don't use const'ref for a boolean

parent 6afd5938
......@@ -27,7 +27,7 @@ class ActivitySwitcherExtensionPlugin : public QQmlExtensionPlugin {
Q_PLUGIN_METADATA(IID "org.kde.plasma.activityswitcher")
public:
ActivitySwitcherExtensionPlugin(QObject *parent = Q_NULLPTR);
explicit ActivitySwitcherExtensionPlugin(QObject *parent = nullptr);
void registerTypes(const char *uri) override;
};
......
......@@ -220,7 +220,7 @@ namespace {
}
SortedActivitiesModel::SortedActivitiesModel(QVector<KActivities::Info::State> states, QObject *parent)
SortedActivitiesModel::SortedActivitiesModel(const QVector<KActivities::Info::State> &states, QObject *parent)
: QSortFilterProxyModel(parent)
, m_activitiesModel(new KActivities::ActivitiesModel(states, this))
, m_activities(new KActivities::Consumer(this))
......
......@@ -39,7 +39,7 @@ class SortedActivitiesModel : public QSortFilterProxyModel {
Q_PROPERTY(bool inhibitUpdates READ inhibitUpdates WRITE setInhibitUpdates NOTIFY inhibitUpdatesChanged)
public:
SortedActivitiesModel(QVector<KActivities::Info::State> states, QObject *parent = 0);
SortedActivitiesModel(const QVector<KActivities::Info::State> &states, QObject *parent = nullptr);
virtual ~SortedActivitiesModel();
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
......@@ -84,8 +84,8 @@ private:
QString m_previousActivity;
KActivities::ActivitiesModel *m_activitiesModel;
KActivities::Consumer *m_activities;
KActivities::ActivitiesModel *m_activitiesModel = nullptr;
KActivities::Consumer *m_activities = nullptr;
QHash<QString, QVector<WId>> m_activitiesWindows;
};
......
......@@ -149,14 +149,14 @@ namespace {
private:
QString m_id;
QSize m_requestedSize;
QQuickTextureFactory *m_texture;
QQuickTextureFactory *m_texture = nullptr;
};
ThumbnailImageResponse::ThumbnailImageResponse(const QString &id,
const QSize &requestedSize)
: m_id(id)
, m_requestedSize(requestedSize)
, m_texture(Q_NULLPTR)
, m_texture(nullptr)
{
int width = m_requestedSize.width();
int height = m_requestedSize.height();
......@@ -244,7 +244,6 @@ inline void SwitcherBackend::registerShortcut(const QString &actionName,
SwitcherBackend::SwitcherBackend(QObject *parent)
: QObject(parent)
, m_lastInvokedAction(Q_NULLPTR)
, m_shouldShowSwitcher(false)
, m_runningActivitiesModel(new SortedActivitiesModel({KActivities::Info::Running, KActivities::Info::Stopping}, this))
, m_stoppedActivitiesModel(new SortedActivitiesModel({KActivities::Info::Stopped, KActivities::Info::Starting}, this))
......@@ -398,7 +397,7 @@ bool SwitcherBackend::shouldShowSwitcher() const
return m_shouldShowSwitcher;
}
void SwitcherBackend::setShouldShowSwitcher(const bool &shouldShowSwitcher)
void SwitcherBackend::setShouldShowSwitcher(bool shouldShowSwitcher)
{
if (m_shouldShowSwitcher == shouldShowSwitcher) return;
......
......@@ -48,7 +48,7 @@ class SwitcherBackend : public QObject {
public:
SwitcherBackend(QObject *parent = Q_NULLPTR);
explicit SwitcherBackend(QObject *parent = nullptr);
~SwitcherBackend();
static QObject *instance(QQmlEngine *engine, QJSEngine *scriptEngine);
......@@ -61,7 +61,7 @@ public Q_SLOTS:
void init();
bool shouldShowSwitcher() const;
void setShouldShowSwitcher(const bool &shouldShowSwitcher);
void setShouldShowSwitcher(bool shouldShowSwitcher);
QAbstractItemModel *runningActivitiesModel() const;
QAbstractItemModel *stoppedActivitiesModel() const;
......@@ -93,14 +93,14 @@ private Q_SLOTS:
private:
QHash<QString, QKeySequence> m_actionShortcut;
QAction *m_lastInvokedAction;
QAction *m_lastInvokedAction = nullptr;
KActivities::Controller m_activities;
bool m_shouldShowSwitcher;
QTimer m_modKeyPollingTimer;
QString m_previousActivity;
SortedActivitiesModel *m_runningActivitiesModel;
SortedActivitiesModel *m_stoppedActivitiesModel;
SortedActivitiesModel *m_runningActivitiesModel = nullptr;
SortedActivitiesModel *m_stoppedActivitiesModel = nullptr;
};
......
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