chore: mark explicit methods

This commit is contained in:
sithlord48 2025-05-20 21:09:55 -04:00 committed by Nick Bolton
parent 293c5e394c
commit 04805d9a7e
31 changed files with 41 additions and 39 deletions

View file

@ -27,8 +27,8 @@ LOGC() provide convenient access.
class Log class Log
{ {
public: public:
Log(bool singleton = true); explicit Log(bool singleton = true);
Log(Log *src); explicit Log(Log *src);
Log(Log const &) = delete; Log(Log const &) = delete;
Log(Log &&) = delete; Log(Log &&) = delete;
~Log(); ~Log();

View file

@ -20,7 +20,7 @@ public:
//! Use getWhat() as the result of what() //! Use getWhat() as the result of what()
XBase(); XBase();
//! Use \c msg as the result of what() //! Use \c msg as the result of what()
XBase(const std::string &msg); explicit XBase(const std::string &msg);
~XBase() throw() override = default; ~XBase() throw() override = default;
//! Reason for exception //! Reason for exception

View file

@ -43,7 +43,7 @@ public:
class FailInfo class FailInfo
{ {
public: public:
FailInfo(const char *what) : m_retry(false), m_what(what) explicit FailInfo(const char *what) : m_retry(false), m_what(what)
{ {
// do nothing // do nothing
} }

View file

@ -21,7 +21,7 @@ class ArgParser
{ {
public: public:
ArgParser(App *app); explicit ArgParser(App *app);
bool parseServerArgs(deskflow::ServerArgs &args, int argc, const char *const *argv); bool parseServerArgs(deskflow::ServerArgs &args, int argc, const char *const *argv);
bool parseClientArgs(deskflow::ClientArgs &args, int argc, const char *const *argv); bool parseClientArgs(deskflow::ClientArgs &args, int argc, const char *const *argv);

View file

@ -12,7 +12,7 @@
class Chunk : public EventData class Chunk : public EventData
{ {
public: public:
Chunk(size_t size); explicit Chunk(size_t size);
Chunk(Chunk const &) = delete; Chunk(Chunk const &) = delete;
Chunk(Chunk &&) = delete; Chunk(Chunk &&) = delete;
~Chunk() override; ~Chunk() override;

View file

@ -23,7 +23,7 @@ class ISocketFactory;
class ClientApp : public App class ClientApp : public App
{ {
public: public:
ClientApp(IEventQueue *events); explicit ClientApp(IEventQueue *events);
~ClientApp() override = default; ~ClientApp() override = default;
// //

View file

@ -21,7 +21,7 @@ class IStream;
class ClipboardChunk : public Chunk class ClipboardChunk : public Chunk
{ {
public: public:
ClipboardChunk(size_t size); explicit ClipboardChunk(size_t size);
static ClipboardChunk *start(ClipboardID id, uint32_t sequence, const std::string &size); static ClipboardChunk *start(ClipboardID id, uint32_t sequence, const std::string &size);
static ClipboardChunk *data(ClipboardID id, uint32_t sequence, const std::string &data); static ClipboardChunk *data(ClipboardID id, uint32_t sequence, const std::string &data);

View file

@ -12,12 +12,12 @@
class DisplayInvalidException : public std::runtime_error class DisplayInvalidException : public std::runtime_error
{ {
public: public:
DisplayInvalidException(const char *msg) : std::runtime_error(msg) explicit DisplayInvalidException(const char *msg) : std::runtime_error(msg)
{ {
// do nothing // do nothing
} }
DisplayInvalidException(std::string msg) : std::runtime_error(msg) explicit DisplayInvalidException(std::string msg) : std::runtime_error(msg)
{ {
// do nothing // do nothing
} }

View file

@ -23,7 +23,7 @@ to synthesize key events.
class IKeyState : public IInterface class IKeyState : public IInterface
{ {
public: public:
IKeyState(IEventQueue *events); explicit IKeyState(IEventQueue *events);
enum enum
{ {

View file

@ -28,7 +28,7 @@ public:
//! @name manipulators //! @name manipulators
//@{ //@{
IPlatformScreen(IEventQueue *events) : IKeyState(events) explicit IPlatformScreen(IEventQueue *events) : IKeyState(events)
{ {
// do nothing // do nothing
} }

View file

@ -45,7 +45,7 @@ class ServerApp : public App
using ServerConfig = deskflow::server::Config; using ServerConfig = deskflow::server::Config;
public: public:
ServerApp(IEventQueue *events); explicit ServerApp(IEventQueue *events);
~ServerApp() override = default; ~ServerApp() override = default;
// //

View file

@ -65,7 +65,7 @@ a client that is already connected.
class XDuplicateClient : public XDeskflow class XDuplicateClient : public XDeskflow
{ {
public: public:
XDuplicateClient(const std::string &name); explicit XDuplicateClient(const std::string &name);
~XDuplicateClient() throw() override = default; ~XDuplicateClient() throw() override = default;
//! @name accessors //! @name accessors
@ -91,7 +91,7 @@ unknown to the server.
class XUnknownClient : public XDeskflow class XUnknownClient : public XDeskflow
{ {
public: public:
XUnknownClient(const std::string &name); explicit XUnknownClient(const std::string &name);
~XUnknownClient() throw() override = default; ~XUnknownClient() throw() override = default;
//! @name accessors //! @name accessors
@ -118,7 +118,7 @@ exit(int).
class XExitApp : public XDeskflow class XExitApp : public XDeskflow
{ {
public: public:
XExitApp(int code); explicit XExitApp(int code);
~XExitApp() throw() override = default; ~XExitApp() throw() override = default;
//! Get the exit code //! Get the exit code

View file

@ -36,7 +36,7 @@ public:
\c timeUntilRetry is the suggested time the caller should wait until \c timeUntilRetry is the suggested time the caller should wait until
trying to open the screen again. trying to open the screen again.
*/ */
XScreenUnavailable(double timeUntilRetry); explicit XScreenUnavailable(double timeUntilRetry);
~XScreenUnavailable() throw() override = default; ~XScreenUnavailable() throw() override = default;
//! @name manipulators //! @name manipulators

View file

@ -16,7 +16,7 @@ class IEventQueue;
class AppUtilUnix : public AppUtil class AppUtilUnix : public AppUtil
{ {
public: public:
AppUtilUnix(IEventQueue *events); explicit AppUtilUnix(IEventQueue *events);
~AppUtilUnix() override = default; ~AppUtilUnix() override = default;
int run(int argc, char **argv) override; int run(int argc, char **argv) override;

View file

@ -29,7 +29,7 @@ enum AppExitMode
class AppUtilWindows : public AppUtil class AppUtilWindows : public AppUtil
{ {
public: public:
AppUtilWindows(IEventQueue *events); explicit AppUtilWindows(IEventQueue *events);
~AppUtilWindows() override; ~AppUtilWindows() override;
static AppUtilWindows &instance(); static AppUtilWindows &instance();

View file

@ -17,7 +17,7 @@ class NewScreenWidget : public QLabel
Q_OBJECT Q_OBJECT
public: public:
NewScreenWidget(QWidget *parent); explicit NewScreenWidget(QWidget *parent);
protected: protected:
void mousePressEvent(QMouseEvent *event) override; void mousePressEvent(QMouseEvent *event) override;

View file

@ -23,7 +23,7 @@ class ScreenSetupView : public QTableView
Q_OBJECT Q_OBJECT
public: public:
ScreenSetupView(QWidget *parent); explicit ScreenSetupView(QWidget *parent);
public: public:
void setModel(QAbstractItemModel *model) override; void setModel(QAbstractItemModel *model) override;

View file

@ -18,7 +18,7 @@ class TrashScreenWidget : public QLabel
Q_OBJECT Q_OBJECT
public: public:
TrashScreenWidget(QWidget *parent) : QLabel(parent) explicit TrashScreenWidget(QWidget *parent) : QLabel(parent)
{ {
// do nothing // do nothing
} }

View file

@ -27,7 +27,7 @@ public:
associated mutex. The mutex needn't be unique to one condition associated mutex. The mutex needn't be unique to one condition
variable. variable.
*/ */
CondVarBase(Mutex *mutex); explicit CondVarBase(Mutex *mutex);
~CondVarBase(); ~CondVarBase();
//! @name manipulators //! @name manipulators

View file

@ -23,9 +23,9 @@ class Lock
{ {
public: public:
//! Lock the mutex \c mutex //! Lock the mutex \c mutex
Lock(const Mutex *mutex); explicit Lock(const Mutex *mutex);
//! Lock the condition variable \c cv //! Lock the condition variable \c cv
Lock(const CondVarBase *cv); explicit Lock(const CondVarBase *cv);
//! Unlock the mutex or condition variable //! Unlock the mutex or condition variable
~Lock(); ~Lock();

View file

@ -37,7 +37,7 @@ public:
Create and start a new thread executing the \c adoptedJob. The Create and start a new thread executing the \c adoptedJob. The
new thread takes ownership of \c adoptedJob and will delete it. new thread takes ownership of \c adoptedJob and will delete it.
*/ */
Thread(IJob *adoptedJob); explicit Thread(IJob *adoptedJob);
//! Duplicate a thread handle //! Duplicate a thread handle
/*! /*!
@ -190,7 +190,7 @@ public:
//@} //@}
private: private:
Thread(ArchThread); explicit Thread(ArchThread);
static void *threadFunc(void *); static void *threadFunc(void *);

View file

@ -19,7 +19,7 @@ class XThreadExit : public XThread
{ {
public: public:
//! \c result is the result of the thread //! \c result is the result of the thread
XThreadExit(void *result) : m_result(result) explicit XThreadExit(void *result) : m_result(result)
{ {
// do nothing // do nothing
} }

View file

@ -22,15 +22,16 @@ public:
class ConnectionFailedInfo class ConnectionFailedInfo
{ {
public: public:
ConnectionFailedInfo(const char *what) : m_what(what) explicit ConnectionFailedInfo(const char *what) : m_what(what)
{ {
// do nothing // do nothing
} }
std::string m_what; std::string m_what;
}; };
IDataSocket(IEventQueue *events) explicit IDataSocket(IEventQueue *events)
{ {
// do nothing
} }
//! @name manipulators //! @name manipulators

View file

@ -26,7 +26,7 @@ public:
Construct the wildcard address with the given port. \c port must Construct the wildcard address with the given port. \c port must
not be zero. not be zero.
*/ */
NetworkAddress(int port); explicit NetworkAddress(int port);
/*! /*!
Construct the network address for the given \c hostname and \c port. Construct the network address for the given \c hostname and \c port.

View file

@ -164,7 +164,7 @@ private:
class HotKeySet class HotKeySet
{ {
public: public:
HotKeySet(KeyID keyid); explicit HotKeySet(KeyID keyid);
KeyID keyid() const KeyID keyid() const
{ {
return id_; return id_;

View file

@ -13,7 +13,7 @@
class XWindowsClipboardBMPConverter : public IXWindowsClipboardConverter class XWindowsClipboardBMPConverter : public IXWindowsClipboardConverter
{ {
public: public:
XWindowsClipboardBMPConverter(Display *display); explicit XWindowsClipboardBMPConverter(Display *display);
~XWindowsClipboardBMPConverter() override = default; ~XWindowsClipboardBMPConverter() override = default;
// IXWindowsClipboardConverter overrides // IXWindowsClipboardConverter overrides

View file

@ -125,7 +125,7 @@ public:
/*! /*!
Ignore X11 errors. Ignore X11 errors.
*/ */
ErrorLock(Display *); explicit ErrorLock(Display *);
ErrorLock(ErrorLock const &) = delete; ErrorLock(ErrorLock const &) = delete;
ErrorLock(ErrorLock &&) = delete; ErrorLock(ErrorLock &&) = delete;

View file

@ -20,7 +20,7 @@ public:
/*! /*!
\c name is the name of the client. \c name is the name of the client.
*/ */
BaseClientProxy(const std::string &name); explicit BaseClientProxy(const std::string &name);
~BaseClientProxy() override = default; ~BaseClientProxy() override = default;
//! @name manipulators //! @name manipulators

View file

@ -201,7 +201,7 @@ public:
internal_const_iterator m_i; internal_const_iterator m_i;
}; };
Config(IEventQueue *events); explicit Config(IEventQueue *events);
virtual ~Config() = default; virtual ~Config() = default;
//! @name manipulators //! @name manipulators

View file

@ -301,7 +301,7 @@ public:
{ {
public: public:
Rule(); Rule();
Rule(Condition *adopted); explicit Rule(Condition *adopted);
Rule(const Rule &); Rule(const Rule &);
~Rule(); ~Rule();
@ -355,7 +355,7 @@ public:
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
using RuleList = std::vector<Rule>; using RuleList = std::vector<Rule>;
InputFilter(IEventQueue *events); explicit InputFilter(IEventQueue *events);
InputFilter(const InputFilter &); InputFilter(const InputFilter &);
virtual ~InputFilter(); virtual ~InputFilter();

View file

@ -86,8 +86,9 @@ public:
class ScreenConnectedInfo class ScreenConnectedInfo
{ {
public: public:
ScreenConnectedInfo(std::string screen) : m_screen(screen) explicit ScreenConnectedInfo(std::string screen) : m_screen(screen)
{ {
// do nothing
} }
public: public: