Commit 15229ebe authored by Kevin Funk's avatar Kevin Funk
Browse files

Use explicit constructors where possible

parent 83fb87ed
......@@ -43,7 +43,7 @@ class Job : public KDevelop::OutputExecuteJob
Q_OBJECT
public:
Job(const Parameters& params, QObject* parent = nullptr);
explicit Job(const Parameters& params, QObject* parent = nullptr);
~Job() override;
void start() override;
......
......@@ -42,7 +42,7 @@ class Plugin : public KDevelop::IPlugin
Q_OBJECT
public:
Plugin(QObject* parent, const QVariantList& = QVariantList());
explicit Plugin(QObject* parent, const QVariantList& = QVariantList());
~Plugin() override;
......
......@@ -39,7 +39,7 @@ public:
* Parses a file path argument and determines its line number and column and full path
* @param path path passed on e.g. command line to parse into an URL
*/
UrlInfo(QString path = QString())
explicit UrlInfo(QString path = QString())
: cursor(KTextEditor::Cursor::invalid())
{
/**
......
......@@ -32,7 +32,7 @@ class ProcessSelectionDialog : public QDialog
{
Q_OBJECT
public:
ProcessSelectionDialog( QWidget *parent=nullptr );
explicit ProcessSelectionDialog( QWidget *parent=nullptr );
~ProcessSelectionDialog() override;
long int pidSelected();
QSize sizeHint() const override;
......
......@@ -32,7 +32,7 @@ namespace KDevMI {
class SelectCoreDialog : public QDialog
{
public:
SelectCoreDialog(QWidget *parent = nullptr);
explicit SelectCoreDialog(QWidget *parent = nullptr);
QUrl binary() const;
QUrl core() const;
......
......@@ -250,7 +250,7 @@ namespace KDevMI { namespace MI {
struct StringLiteralValue : public Value
{
StringLiteralValue(const QString &lit)
explicit StringLiteralValue(const QString &lit)
: literal_(lit) { Value::kind = StringLiteral; }
public: // Value overrides
......@@ -305,7 +305,7 @@ namespace KDevMI { namespace MI {
struct ResultRecord : public TupleRecord
{
ResultRecord(const QString& reason)
explicit ResultRecord(const QString& reason)
: token(0)
, reason(reason)
{
......@@ -357,7 +357,7 @@ namespace KDevMI { namespace MI {
Log
};
StreamRecord(Subkind subkind)
explicit StreamRecord(Subkind subkind)
: subkind(subkind)
{
Record::kind = Stream;
......
......@@ -82,7 +82,7 @@ class FunctionCommandHandler : public MICommandHandler {
public:
typedef std::function<void (const ResultRecord&)> Function;
FunctionCommandHandler(const Function& callback, CommandFlags flags = nullptr);
explicit FunctionCommandHandler(const Function& callback, CommandFlags flags = nullptr);
void handle(const ResultRecord&) override;
bool handlesError() override;
......@@ -99,7 +99,7 @@ private:
class MICommand
{
protected:
MICommand(CommandType type, const QString& arguments = QString(), CommandFlags flags = nullptr);
explicit MICommand(CommandType type, const QString& arguments = QString(), CommandFlags flags = nullptr);
friend class KDevMI::MIDebugSession;
public:
......@@ -280,7 +280,7 @@ public:
};
}
SentinelCommand(const Function& handler, CommandFlags flags = nullptr)
explicit SentinelCommand(const Function& handler, CommandFlags flags = nullptr)
: MICommand(NonMI, QString(), flags)
, handler(handler)
{
......
......@@ -167,7 +167,7 @@ struct MIBreakpointController::DeleteHandler : MIBreakpointController::Handler {
};
struct MIBreakpointController::IgnoreChanges {
IgnoreChanges(MIBreakpointController& controller)
explicit IgnoreChanges(MIBreakpointController& controller)
: controller(controller)
{
++controller.m_ignoreChanges;
......
......@@ -64,7 +64,7 @@ class MIBreakpointController : public KDevelop::IBreakpointController
{
Q_OBJECT
public:
MIBreakpointController(MIDebugSession* parent);
explicit MIBreakpointController(MIDebugSession* parent);
using IBreakpointController::breakpointModel;
......
......@@ -66,7 +66,7 @@ class MIExamineCoreJob : public KJob
{
Q_OBJECT
public:
MIExamineCoreJob(MIDebuggerPlugin *plugin, QObject *parent = nullptr);
explicit MIExamineCoreJob(MIDebuggerPlugin *plugin, QObject *parent = nullptr);
void start() override;
......
......@@ -34,7 +34,7 @@ class MIDebugSession;
class MIFrameStackModel : public KDevelop::FrameStackModel
{
public:
MIFrameStackModel( MIDebugSession* session);
explicit MIFrameStackModel( MIDebugSession* session);
MIDebugSession* session();
......
......@@ -321,7 +321,7 @@ QString MIVariable::enquotedExpression() const
class SetFormatHandler : public MICommandHandler
{
public:
SetFormatHandler(MIVariable *var)
explicit SetFormatHandler(MIVariable *var)
: m_variable(var)
{}
......
......@@ -110,7 +110,7 @@ void MIVariableController::handleVarUpdate(const ResultRecord& r)
class StackListArgumentsHandler : public MICommandHandler
{
public:
StackListArgumentsHandler(QStringList localsName)
explicit StackListArgumentsHandler(QStringList localsName)
: m_localsName(localsName)
{}
......@@ -139,7 +139,7 @@ private:
class StackListLocalsHandler : public MICommandHandler
{
public:
StackListLocalsHandler(MIDebugSession *session)
explicit StackListLocalsHandler(MIDebugSession *session)
: m_session(session)
{}
......
......@@ -42,7 +42,7 @@ class MIVariableController : public KDevelop::IVariableController
Q_OBJECT
public:
MIVariableController( MIDebugSession* parent);
explicit MIVariableController( MIDebugSession* parent);
KDevelop::Variable* createVariable(KDevelop::TreeModel* model, KDevelop::TreeItem* parent,
const QString& expression,
......
......@@ -157,7 +157,7 @@ public slots:
virtual void setRegisterValue(const Register& reg);
protected:
IRegisterController(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr);
explicit IRegisterController(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr);
///Returns registers from the @p group, or empty registers group if @p group is invalid.
virtual RegistersGroup registersFromGroup(const GroupsName& group) const = 0;
......
......@@ -31,7 +31,7 @@ class RegisterController_Arm : public IRegisterController
{
public:
RegisterController_Arm(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr);
explicit RegisterController_Arm(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr);
QVector<GroupsName> namesOfRegisterGroups() const override;
......
......@@ -36,7 +36,7 @@ public slots:
void updateRegisters(const GroupsName& group = GroupsName()) override;
protected:
RegisterControllerGeneral_x86(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr);
explicit RegisterControllerGeneral_x86(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr);
RegistersGroup registersFromGroup(const GroupsName& group) const override;
......@@ -71,7 +71,7 @@ class RegisterController_x86 : public RegisterControllerGeneral_x86
{
public:
RegisterController_x86(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr);
explicit RegisterController_x86(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr);
private:
void initRegisterNames();
......@@ -81,7 +81,7 @@ class RegisterController_x86_64 : public RegisterControllerGeneral_x86
{
public:
RegisterController_x86_64(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr);
explicit RegisterController_x86_64(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr);
private:
void initRegisterNames();
......
......@@ -46,7 +46,7 @@ class ArchitectureParser : public QObject
public:
ArchitectureParser(QObject* parent);
explicit ArchitectureParser(QObject* parent);
///Asynchronously determines current architecture. emits @p architectureParsed when ready.
void determineArchitecture(MIDebugSession* debugSession);
......@@ -68,7 +68,7 @@ class RegistersManager : public QObject
Q_OBJECT
public:
RegistersManager(QWidget* parent);
explicit RegistersManager(QWidget* parent);
public Q_SLOTS:
void setSession(MIDebugSession* debugSession);
......
......@@ -38,7 +38,7 @@ class RegistersView : public QWidget, private Ui::RegistersView
Q_OBJECT
public:
RegistersView(QWidget* p = nullptr);
explicit RegistersView(QWidget* p = nullptr);
void enable(bool enabled);
......
......@@ -39,7 +39,7 @@ class STTY : public QObject
Q_OBJECT
public:
STTY(bool ext=false, const QString &termAppName=QString());
explicit STTY(bool ext=false, const QString &termAppName=QString());
~STTY() override;
///Call it if getSlave returns an empty string.
......
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