Remove const from SingleApplication methods

This commit is contained in:
Jonas Kvinge
2021-06-22 16:15:04 +02:00
parent f66aca2164
commit d614a94203
4 changed files with 24 additions and 24 deletions

View File

@@ -178,7 +178,7 @@ SingleApplication::~SingleApplication() {
* Checks if the current application instance is primary. * Checks if the current application instance is primary.
* @return Returns true if the instance is primary, false otherwise. * @return Returns true if the instance is primary, false otherwise.
*/ */
bool SingleApplication::isPrimary() const { bool SingleApplication::isPrimary() {
Q_D(SingleApplication); Q_D(SingleApplication);
return d->server_ != nullptr; return d->server_ != nullptr;
} }
@@ -187,7 +187,7 @@ bool SingleApplication::isPrimary() const {
* Checks if the current application instance is secondary. * Checks if the current application instance is secondary.
* @return Returns true if the instance is secondary, false otherwise. * @return Returns true if the instance is secondary, false otherwise.
*/ */
bool SingleApplication::isSecondary() const { bool SingleApplication::isSecondary() {
Q_D(SingleApplication); Q_D(SingleApplication);
return d->server_ == nullptr; return d->server_ == nullptr;
} }
@@ -197,7 +197,7 @@ bool SingleApplication::isSecondary() const {
* It is reset when the first (primary) instance of your app starts and only incremented afterwards. * It is reset when the first (primary) instance of your app starts and only incremented afterwards.
* @return Returns a unique instance id. * @return Returns a unique instance id.
*/ */
quint32 SingleApplication::instanceId() const { quint32 SingleApplication::instanceId() {
Q_D(SingleApplication); Q_D(SingleApplication);
return d->instanceNumber_; return d->instanceNumber_;
} }
@@ -207,7 +207,7 @@ quint32 SingleApplication::instanceId() const {
* Especially useful when SingleApplication is coupled with OS. specific APIs. * Especially useful when SingleApplication is coupled with OS. specific APIs.
* @return Returns the primary instance PID. * @return Returns the primary instance PID.
*/ */
qint64 SingleApplication::primaryPid() const { qint64 SingleApplication::primaryPid() {
Q_D(SingleApplication); Q_D(SingleApplication);
return d->primaryPid(); return d->primaryPid();
} }
@@ -216,7 +216,7 @@ qint64 SingleApplication::primaryPid() const {
* Returns the username the primary instance is running as. * Returns the username the primary instance is running as.
* @return Returns the username the primary instance is running as. * @return Returns the username the primary instance is running as.
*/ */
QString SingleApplication::primaryUser() const { QString SingleApplication::primaryUser() {
Q_D(SingleApplication); Q_D(SingleApplication);
return d->primaryUser(); return d->primaryUser();
} }
@@ -225,7 +225,7 @@ QString SingleApplication::primaryUser() const {
* Returns the username the current instance is running as. * Returns the username the current instance is running as.
* @return Returns the username the current instance is running as. * @return Returns the username the current instance is running as.
*/ */
QString SingleApplication::currentUser() const { QString SingleApplication::currentUser() {
Q_D(SingleApplication); Q_D(SingleApplication);
return d->getUsername(); return d->getUsername();
} }

View File

@@ -97,37 +97,37 @@ class SingleApplication : public QApplication { // clazy:exclude=ctor-missing-p
* @brief Returns if the instance is the primary instance * @brief Returns if the instance is the primary instance
* @returns {bool} * @returns {bool}
*/ */
bool isPrimary() const; bool isPrimary();
/** /**
* @brief Returns if the instance is a secondary instance * @brief Returns if the instance is a secondary instance
* @returns {bool} * @returns {bool}
*/ */
bool isSecondary() const; bool isSecondary();
/** /**
* @brief Returns a unique identifier for the current instance * @brief Returns a unique identifier for the current instance
* @returns {qint32} * @returns {qint32}
*/ */
quint32 instanceId() const; quint32 instanceId();
/** /**
* @brief Returns the process ID (PID) of the primary instance * @brief Returns the process ID (PID) of the primary instance
* @returns {qint64} * @returns {qint64}
*/ */
qint64 primaryPid() const; qint64 primaryPid();
/** /**
* @brief Returns the username of the user running the primary instance * @brief Returns the username of the user running the primary instance
* @returns {QString} * @returns {QString}
*/ */
QString primaryUser() const; QString primaryUser();
/** /**
* @brief Returns the username of the current user * @brief Returns the username of the current user
* @returns {QString} * @returns {QString}
*/ */
QString currentUser() const; QString currentUser();
/** /**
* @brief Sends a message to the primary instance. Returns true on success. * @brief Sends a message to the primary instance. Returns true on success.

View File

@@ -178,7 +178,7 @@ SingleCoreApplication::~SingleCoreApplication() {
* Checks if the current application instance is primary. * Checks if the current application instance is primary.
* @return Returns true if the instance is primary, false otherwise. * @return Returns true if the instance is primary, false otherwise.
*/ */
bool SingleCoreApplication::isPrimary() const { bool SingleCoreApplication::isPrimary() {
Q_D(SingleCoreApplication); Q_D(SingleCoreApplication);
return d->server_ != nullptr; return d->server_ != nullptr;
} }
@@ -187,7 +187,7 @@ bool SingleCoreApplication::isPrimary() const {
* Checks if the current application instance is secondary. * Checks if the current application instance is secondary.
* @return Returns true if the instance is secondary, false otherwise. * @return Returns true if the instance is secondary, false otherwise.
*/ */
bool SingleCoreApplication::isSecondary() const { bool SingleCoreApplication::isSecondary() {
Q_D(SingleCoreApplication); Q_D(SingleCoreApplication);
return d->server_ == nullptr; return d->server_ == nullptr;
} }
@@ -197,7 +197,7 @@ bool SingleCoreApplication::isSecondary() const {
* It is reset when the first (primary) instance of your app starts and only incremented afterwards. * It is reset when the first (primary) instance of your app starts and only incremented afterwards.
* @return Returns a unique instance id. * @return Returns a unique instance id.
*/ */
quint32 SingleCoreApplication::instanceId() const { quint32 SingleCoreApplication::instanceId() {
Q_D(SingleCoreApplication); Q_D(SingleCoreApplication);
return d->instanceNumber_; return d->instanceNumber_;
} }
@@ -207,7 +207,7 @@ quint32 SingleCoreApplication::instanceId() const {
* Especially useful when SingleCoreApplication is coupled with OS. specific APIs. * Especially useful when SingleCoreApplication is coupled with OS. specific APIs.
* @return Returns the primary instance PID. * @return Returns the primary instance PID.
*/ */
qint64 SingleCoreApplication::primaryPid() const { qint64 SingleCoreApplication::primaryPid() {
Q_D(SingleCoreApplication); Q_D(SingleCoreApplication);
return d->primaryPid(); return d->primaryPid();
} }
@@ -216,7 +216,7 @@ qint64 SingleCoreApplication::primaryPid() const {
* Returns the username the primary instance is running as. * Returns the username the primary instance is running as.
* @return Returns the username the primary instance is running as. * @return Returns the username the primary instance is running as.
*/ */
QString SingleCoreApplication::primaryUser() const { QString SingleCoreApplication::primaryUser() {
Q_D(SingleCoreApplication); Q_D(SingleCoreApplication);
return d->primaryUser(); return d->primaryUser();
} }
@@ -225,7 +225,7 @@ QString SingleCoreApplication::primaryUser() const {
* Returns the username the current instance is running as. * Returns the username the current instance is running as.
* @return Returns the username the current instance is running as. * @return Returns the username the current instance is running as.
*/ */
QString SingleCoreApplication::currentUser() const { QString SingleCoreApplication::currentUser() {
Q_D(SingleCoreApplication); Q_D(SingleCoreApplication);
return d->getUsername(); return d->getUsername();
} }

View File

@@ -96,37 +96,37 @@ class SingleCoreApplication : public QCoreApplication {
* @brief Returns if the instance is the primary instance * @brief Returns if the instance is the primary instance
* @returns {bool} * @returns {bool}
*/ */
bool isPrimary() const; bool isPrimary();
/** /**
* @brief Returns if the instance is a secondary instance * @brief Returns if the instance is a secondary instance
* @returns {bool} * @returns {bool}
*/ */
bool isSecondary() const; bool isSecondary();
/** /**
* @brief Returns a unique identifier for the current instance * @brief Returns a unique identifier for the current instance
* @returns {qint32} * @returns {qint32}
*/ */
quint32 instanceId() const; quint32 instanceId();
/** /**
* @brief Returns the process ID (PID) of the primary instance * @brief Returns the process ID (PID) of the primary instance
* @returns {qint64} * @returns {qint64}
*/ */
qint64 primaryPid() const; qint64 primaryPid();
/** /**
* @brief Returns the username of the user running the primary instance * @brief Returns the username of the user running the primary instance
* @returns {QString} * @returns {QString}
*/ */
QString primaryUser() const; QString primaryUser();
/** /**
* @brief Returns the username of the current user * @brief Returns the username of the current user
* @returns {QString} * @returns {QString}
*/ */
QString currentUser() const; QString currentUser();
/** /**
* @brief Sends a message to the primary instance. Returns true on success. * @brief Sends a message to the primary instance. Returns true on success.