Skip to content

Commit beefcb1

Browse files
committed
Use explicit
1 parent 2608ccc commit beefcb1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+56
-56
lines changed

Diff for: applets/digital-clock/plugin/timezonesi18n.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class TimezonesI18n : public QObject
3131
Q_OBJECT
3232

3333
public:
34-
TimezonesI18n(QObject *parent = nullptr);
34+
explicit TimezonesI18n(QObject *parent = nullptr);
3535
Q_INVOKABLE QString i18nCity(const QString &city);
3636
Q_INVOKABLE QString i18nContinents(const QString &continent);
3737
Q_INVOKABLE QString i18nCountry(QLocale::Country country);

Diff for: appmenu/appmenu_dbus.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class AppmenuDBus : public QObject, protected QDBusContext
4040
Q_OBJECT
4141

4242
public:
43-
AppmenuDBus(QObject*);
43+
explicit AppmenuDBus(QObject*);
4444
~AppmenuDBus() override;
4545

4646
bool connectToBus(const QString& service = QString(), const QString& path = QString());

Diff for: appmenu/menuimporter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class MenuImporter : public QObject, protected QDBusContext
4444
Q_OBJECT
4545

4646
public:
47-
MenuImporter(QObject*);
47+
explicit MenuImporter(QObject*);
4848
~MenuImporter() override;
4949

5050
bool connectToBus();

Diff for: appmenu/verticalmenu.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class VerticalMenu : public QMenu
3333
{
3434
Q_OBJECT
3535
public:
36-
VerticalMenu(QWidget * parent = nullptr);
36+
explicit VerticalMenu(QWidget * parent = nullptr);
3737
~VerticalMenu() override;
3838

3939
QString serviceName() const { return m_serviceName; }

Diff for: components/keyboardlayout/keyboardlayout.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class KeyboardLayout : public QObject
4444
NOTIFY layoutsChanged)
4545

4646
public:
47-
KeyboardLayout(QObject *parent = nullptr);
47+
explicit KeyboardLayout(QObject *parent = nullptr);
4848
~KeyboardLayout() override;
4949

5050
QString currentLayout() const;

Diff for: components/shellprivate/interactiveconsole/interactiveconsole.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class InteractiveConsole : public QDialog
5353
Q_OBJECT
5454

5555
public:
56-
InteractiveConsole(QWidget *parent = nullptr);
56+
explicit InteractiveConsole(QWidget *parent = nullptr);
5757
~InteractiveConsole() override;
5858

5959
enum ConsoleMode {

Diff for: components/shellprivate/widgetexplorer/kcategorizeditemsviewmodels_p.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class DefaultFilterModel : public QStandardItemModel
9494
FilterDataRole = Qt::UserRole+2,
9595
SeparatorRole = Qt::UserRole+3
9696
};
97-
DefaultFilterModel(QObject *parent = nullptr);
97+
explicit DefaultFilterModel(QObject *parent = nullptr);
9898

9999
QHash<int, QByteArray> roleNames() const override;
100100

@@ -131,7 +131,7 @@ class DefaultItemFilterProxyModel : public QSortFilterProxyModel
131131
Q_PROPERTY(int count READ count NOTIFY countChanged)
132132

133133
public:
134-
DefaultItemFilterProxyModel(QObject *parent = nullptr);
134+
explicit DefaultItemFilterProxyModel(QObject *parent = nullptr);
135135

136136
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
137137
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;

Diff for: components/shellprivate/widgetexplorer/openwidgetassistant_p.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class OpenWidgetAssistant : public KAssistantDialog
3535
Q_OBJECT
3636

3737
public:
38-
OpenWidgetAssistant(QWidget *parent);
38+
explicit OpenWidgetAssistant(QWidget *parent);
3939

4040
protected Q_SLOTS:
4141
void finished();

Diff for: components/shellprivate/widgetexplorer/plasmaappletitemmodel_p.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PlasmaAppletItemModel;
3232
class PlasmaAppletItem : public KCategorizedItemsViewModels::AbstractItem
3333
{
3434
public:
35-
PlasmaAppletItem(const KPluginInfo& info);
35+
explicit PlasmaAppletItem(const KPluginInfo& info);
3636

3737
QString pluginName() const;
3838
QString name() const override;

Diff for: components/shellprivate/widgetexplorer/widgetexplorer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class WidgetAction : public QAction
4444
Q_PROPERTY(bool separator READ isSeparator WRITE setSeparator NOTIFY separatorChanged)
4545

4646
public:
47-
WidgetAction(QObject *parent = nullptr);
47+
explicit WidgetAction(QObject *parent = nullptr);
4848
WidgetAction(const QIcon &icon, const QString &text, QObject *parent);
4949

5050
Q_SIGNALS:

Diff for: dataengines/applicationjobs/kuiserverengine.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class JobView : public Plasma::DataContainer
6969
Stopped = 2
7070
};
7171

72-
JobView(QObject *parent = nullptr);
72+
explicit JobView(QObject *parent = nullptr);
7373
~JobView() override;
7474

7575
uint jobId() const;

Diff for: dataengines/apps/appservice.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class AppService : public Plasma::Service
3535
Q_OBJECT
3636

3737
public:
38-
AppService(AppSource *source);
38+
explicit AppService(AppSource *source);
3939
~AppService() override;
4040

4141
protected:

Diff for: dataengines/devicenotifications/ksolidnotify.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class KSolidNotify : public QObject
4343
Q_OBJECT
4444

4545
public:
46-
KSolidNotify(QObject *parent);
46+
explicit KSolidNotify(QObject *parent);
4747

4848
signals:
4949
void notify(Solid::ErrorType solidError, const QString& error, const QString& errorDetails, const QString &udi);

Diff for: dataengines/geolocation/geolocationprovider.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class GEOLOCATION_EXPORT GeolocationProvider : public QObject
3636
enum UpdateTrigger { ForcedUpdate = 0, SourceEvent = 1, NetworkConnected = 2 };
3737
Q_DECLARE_FLAGS(UpdateTriggers, UpdateTrigger)
3838

39-
GeolocationProvider(QObject *parent = nullptr, const QVariantList &args = QVariantList());
39+
explicit GeolocationProvider(QObject *parent = nullptr, const QVariantList &args = QVariantList());
4040
void init(Plasma::DataEngine::Data *data, EntryAccuracy *accuracies);
4141

4242
UpdateTriggers updateTriggers() const;

Diff for: dataengines/geolocation/location_gps.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Gpsd : public QThread
2929
{
3030
Q_OBJECT
3131
public:
32-
Gpsd(gps_data_t* gpsdata);
32+
explicit Gpsd(gps_data_t* gpsdata);
3333
~Gpsd() override;
3434

3535
void update();

Diff for: dataengines/mpris2/multiplexedservice.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MultiplexedService : public Plasma::Service
3333
Q_OBJECT
3434

3535
public:
36-
MultiplexedService(Multiplexer *multiplexer, QObject *parent = nullptr);
36+
explicit MultiplexedService(Multiplexer *multiplexer, QObject *parent = nullptr);
3737

3838
protected:
3939
Plasma::ServiceJob *createJob(const QString &operation,

Diff for: dataengines/packagekit/packagekitservice.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class PackagekitService : public Plasma::Service
2828
{
2929
Q_OBJECT
3030
public:
31-
PackagekitService(QObject* parent = nullptr);
31+
explicit PackagekitService(QObject* parent = nullptr);
3232
Plasma::ServiceJob* createJob(const QString& operation, QMap< QString, QVariant >& parameters) override;
3333
};
3434

Diff for: dataengines/powermanagement/powermanagementservice.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PowerManagementService : public Plasma::Service
3232
Q_OBJECT
3333

3434
public:
35-
PowerManagementService(QObject *parent = nullptr);
35+
explicit PowerManagementService(QObject *parent = nullptr);
3636
ServiceJob *createJob(const QString &operation, QMap<QString, QVariant> &parameters) override;
3737
};
3838

Diff for: dataengines/share/packagestructure/share_package.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class SharePackage : public KPackage::PackageStructure
2626
{
2727
public:
28-
SharePackage(QObject *parent = nullptr, QVariantList args = QVariantList());
28+
explicit SharePackage(QObject *parent = nullptr, QVariantList args = QVariantList());
2929
void initPackage(KPackage::Package *package) override;
3030
};
3131

Diff for: dataengines/share/shareprovider.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ShareProvider : public QObject
3535
Q_OBJECT
3636

3737
public:
38-
ShareProvider(KJSEmbed::Engine* engine, QObject *parent = nullptr);
38+
explicit ShareProvider(KJSEmbed::Engine* engine, QObject *parent = nullptr);
3939

4040
QString method() const;
4141
void setMethod(const QString &method);

Diff for: dataengines/share/shareservice.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ShareService : public Plasma::Service
4141
Q_OBJECT
4242

4343
public:
44-
ShareService(ShareEngine *engine);
44+
explicit ShareService(ShareEngine *engine);
4545
Plasma::ServiceJob *createJob(const QString &operation,
4646
QMap<QString, QVariant> &parameters) override;
4747
};

Diff for: dataengines/soliddevice/devicesignalmapmanager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DeviceSignalMapManager : public QObject
2828
Q_OBJECT
2929

3030
public:
31-
DeviceSignalMapManager(QObject *parent = nullptr);
31+
explicit DeviceSignalMapManager(QObject *parent = nullptr);
3232
~DeviceSignalMapManager() override;
3333

3434
void mapDevice(Solid::Battery *battery, const QString &udi);

Diff for: dataengines/soliddevice/devicesignalmapper.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class DeviceSignalMapper : public QSignalMapper
4343
Q_OBJECT
4444

4545
public:
46-
DeviceSignalMapper(QObject *parent = nullptr);
46+
explicit DeviceSignalMapper(QObject *parent = nullptr);
4747
~DeviceSignalMapper() override;
4848

4949
void setMapping(QObject* device, const QString &udi);
@@ -60,7 +60,7 @@ class BatterySignalMapper : public DeviceSignalMapper
6060
Q_OBJECT
6161

6262
public:
63-
BatterySignalMapper(QObject *parent = nullptr);
63+
explicit BatterySignalMapper(QObject *parent = nullptr);
6464
~BatterySignalMapper() override;
6565

6666
public Q_SLOTS:
@@ -74,7 +74,7 @@ class StorageAccessSignalMapper : public DeviceSignalMapper
7474
Q_OBJECT
7575

7676
public:
77-
StorageAccessSignalMapper(QObject *parent = nullptr);
77+
explicit StorageAccessSignalMapper(QObject *parent = nullptr);
7878
~StorageAccessSignalMapper() override;
7979

8080
public Q_SLOTS:

Diff for: dataengines/soliddevice/hddtemp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class HddTemp : public QObject
3535
public:
3636
enum DataType {Temperature=0, Unit};
3737

38-
HddTemp(QObject *parent = nullptr);
38+
explicit HddTemp(QObject *parent = nullptr);
3939
~HddTemp() override;
4040
QStringList sources();
4141
QVariant data(const QString source, const DataType type) const;

Diff for: dataengines/statusnotifieritem/statusnotifieritemservice.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class StatusNotifierItemService : public Plasma::Service
3636
Q_OBJECT
3737

3838
public:
39-
StatusNotifierItemService(StatusNotifierItemSource *source);
39+
explicit StatusNotifierItemService(StatusNotifierItemSource *source);
4040
~StatusNotifierItemService() override;
4141

4242
protected:

Diff for: dataengines/time/solarsystem.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class Sun : public SolarSystemObject
110110
class Moon : public SolarSystemObject
111111
{
112112
public:
113-
Moon(Sun *sun);
113+
explicit Moon(Sun *sun);
114114
~Moon() override {}; // to not delete the Sun
115115

116116
void calcForDateTime(const QDateTime& local, int offset) override;

Diff for: klipper/historyimageitem.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
class HistoryImageItem : public HistoryItem
2929
{
3030
public:
31-
HistoryImageItem( const QPixmap& data );
31+
explicit HistoryImageItem( const QPixmap& data );
3232
~HistoryImageItem() override {}
3333
QString text() const override;
3434
bool operator==( const HistoryItem& rhs) const override {

Diff for: klipper/historyitem.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ typedef QSharedPointer<const HistoryItem> HistoryItemConstPtr;
3535
class HistoryItem
3636
{
3737
public:
38-
HistoryItem(const QByteArray& uuid);
38+
explicit HistoryItem(const QByteArray& uuid);
3939
virtual ~HistoryItem();
4040

4141
/**

Diff for: klipper/historystringitem.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
class HistoryStringItem : public HistoryItem
3030
{
3131
public:
32-
HistoryStringItem( const QString& data );
32+
explicit HistoryStringItem( const QString& data );
3333
~HistoryStringItem() override {}
3434
QString text() const override;
3535
bool operator==( const HistoryItem& rhs) const override {

Diff for: kuiserver/jobview.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class JobView : public QObject
6464
Stopped = 2
6565
};
6666

67-
JobView(uint jobId, QObject *parent = nullptr);
67+
explicit JobView(uint jobId, QObject *parent = nullptr);
6868
~JobView() override;
6969

7070
void terminate(const QString &errorMessage);

Diff for: kuiserver/uiserver_p.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class UIConfigurationDialog
3131
Q_OBJECT
3232

3333
public:
34-
UIConfigurationDialog(QWidget *parent);
34+
explicit UIConfigurationDialog(QWidget *parent);
3535
~UIConfigurationDialog() override;
3636
};
3737

Diff for: runners/bookmarks/browsers/chrome.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Chrome : public QObject, public Browser
3737
{
3838
Q_OBJECT
3939
public:
40-
Chrome(FindProfile *findProfile, QObject* parent = nullptr);
40+
explicit Chrome(FindProfile *findProfile, QObject* parent = nullptr);
4141
~Chrome() override;
4242
QList<BookmarkMatch> match(const QString &term, bool addEveryThing) override;
4343
public Q_SLOTS:

Diff for: runners/bookmarks/browsers/opera.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Opera : public QObject, public Browser
3232
{
3333
Q_OBJECT
3434
public:
35-
Opera(QObject* parent = nullptr);
35+
explicit Opera(QObject* parent = nullptr);
3636
QList<BookmarkMatch> match(const QString& term, bool addEverything) override;
3737
public Q_SLOTS:
3838
void prepare() override;

Diff for: runners/calculator/qalculate_engine.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class QalculateEngine : public QObject
2929
{
3030
Q_OBJECT
3131
public:
32-
QalculateEngine(QObject* parent = nullptr);
32+
explicit QalculateEngine(QObject* parent = nullptr);
3333
~QalculateEngine() override;
3434

3535
QString lastResult() const { return m_lastResult; }

Diff for: runners/places/placesrunner.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class PlacesRunnerHelper : public QObject
3131
Q_OBJECT
3232

3333
public:
34-
PlacesRunnerHelper(PlacesRunner *runner);
34+
explicit PlacesRunnerHelper(PlacesRunner *runner);
3535

3636
public Q_SLOTS:
3737
void match(Plasma::RunnerContext *context);

Diff for: runners/solid/devicewrapper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class DeviceWrapper : public QObject
3535
Q_OBJECT
3636

3737
public:
38-
DeviceWrapper(const QString& udi);
38+
explicit DeviceWrapper(const QString& udi);
3939
~DeviceWrapper();
4040

4141
QString id() const;

Diff for: shell/alternativeshelper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AlternativesHelper : public QObject
3232
Q_PROPERTY(QQuickItem *applet READ applet CONSTANT)
3333

3434
public:
35-
AlternativesHelper(Plasma::Applet *applet, QObject *parent = nullptr);
35+
explicit AlternativesHelper(Plasma::Applet *applet, QObject *parent = nullptr);
3636
~AlternativesHelper() override;
3737

3838
QQuickItem *applet() const;

Diff for: shell/containmentconfigview.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ContainmentConfigView : public PlasmaQuick::ConfigView
4848
Q_PROPERTY(QString containmentPlugin READ containmentPlugin WRITE setContainmentPlugin NOTIFY containmentPluginChanged)
4949

5050
public:
51-
ContainmentConfigView(Plasma::Containment *interface, QWindow *parent = nullptr);
51+
explicit ContainmentConfigView(Plasma::Containment *interface, QWindow *parent = nullptr);
5252
~ContainmentConfigView() override;
5353

5454
void init() override;

Diff for: shell/currentcontainmentactionsmodel.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class CurrentContainmentActionsModel : public QStandardItemModel
4545
HasConfigurationInterfaceRole
4646
};
4747

48-
CurrentContainmentActionsModel(Plasma::Containment *cotainment, QObject *parent = nullptr);
48+
explicit CurrentContainmentActionsModel(Plasma::Containment *cotainment, QObject *parent = nullptr);
4949
~CurrentContainmentActionsModel() override;
5050

5151
QHash<int, QByteArray> roleNames() const override;

Diff for: shell/screenpool.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ScreenPool : public QObject, public QAbstractNativeEventFilter
3434
Q_OBJECT
3535

3636
public:
37-
ScreenPool(KSharedConfig::Ptr config, QObject *parent = nullptr);
37+
explicit ScreenPool(KSharedConfig::Ptr config, QObject *parent = nullptr);
3838
void load();
3939
~ScreenPool() override;
4040

Diff for: shell/scripting/appinterface.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class AppInterface : public QObject
5858
Q_PROPERTY(QString languageId READ languageId)
5959

6060
public:
61-
AppInterface(ScriptEngine *env);
61+
explicit AppInterface(ScriptEngine *env);
6262

6363
bool hasBattery() const;
6464
int screenCount() const;

0 commit comments

Comments
 (0)