mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2025-04-21 04:24:43 +08:00
Mark getters as const
This commit is contained in:
parent
e99b8df38f
commit
4aeac8fa3e
@ -172,9 +172,9 @@ 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()
|
bool SingleApplication::isPrimary() const
|
||||||
{
|
{
|
||||||
Q_D( SingleApplication );
|
Q_D( const SingleApplication );
|
||||||
return d->server != nullptr;
|
return d->server != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,9 +182,9 @@ bool SingleApplication::isPrimary()
|
|||||||
* 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()
|
bool SingleApplication::isSecondary() const
|
||||||
{
|
{
|
||||||
Q_D( SingleApplication );
|
Q_D( const SingleApplication );
|
||||||
return d->server == nullptr;
|
return d->server == nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,9 +194,9 @@ bool SingleApplication::isSecondary()
|
|||||||
* only incremented afterwards.
|
* only incremented afterwards.
|
||||||
* @return Returns a unique instance id.
|
* @return Returns a unique instance id.
|
||||||
*/
|
*/
|
||||||
quint32 SingleApplication::instanceId()
|
quint32 SingleApplication::instanceId() const
|
||||||
{
|
{
|
||||||
Q_D( SingleApplication );
|
Q_D( const SingleApplication );
|
||||||
return d->instanceNumber;
|
return d->instanceNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,9 +206,9 @@ quint32 SingleApplication::instanceId()
|
|||||||
* specific APIs.
|
* specific APIs.
|
||||||
* @return Returns the primary instance PID.
|
* @return Returns the primary instance PID.
|
||||||
*/
|
*/
|
||||||
qint64 SingleApplication::primaryPid()
|
qint64 SingleApplication::primaryPid() const
|
||||||
{
|
{
|
||||||
Q_D( SingleApplication );
|
Q_D( const SingleApplication );
|
||||||
return d->primaryPid();
|
return d->primaryPid();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,9 +216,9 @@ qint64 SingleApplication::primaryPid()
|
|||||||
* 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()
|
QString SingleApplication::primaryUser() const
|
||||||
{
|
{
|
||||||
Q_D( SingleApplication );
|
Q_D( const SingleApplication );
|
||||||
return d->primaryUser();
|
return d->primaryUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ QString SingleApplication::primaryUser()
|
|||||||
* 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()
|
QString SingleApplication::currentUser() const
|
||||||
{
|
{
|
||||||
return SingleApplicationPrivate::getUsername();
|
return SingleApplicationPrivate::getUsername();
|
||||||
}
|
}
|
||||||
@ -267,8 +267,8 @@ void SingleApplication::abortSafely()
|
|||||||
::exit( EXIT_FAILURE );
|
::exit( EXIT_FAILURE );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList SingleApplication::userData()
|
QStringList SingleApplication::userData() const
|
||||||
{
|
{
|
||||||
Q_D( SingleApplication );
|
Q_D( const SingleApplication );
|
||||||
return d->appData();
|
return d->appData();
|
||||||
}
|
}
|
||||||
|
@ -92,37 +92,37 @@ public:
|
|||||||
* @brief Returns if the instance is the primary instance
|
* @brief Returns if the instance is the primary instance
|
||||||
* @returns {bool}
|
* @returns {bool}
|
||||||
*/
|
*/
|
||||||
bool isPrimary();
|
bool isPrimary() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns if the instance is a secondary instance
|
* @brief Returns if the instance is a secondary instance
|
||||||
* @returns {bool}
|
* @returns {bool}
|
||||||
*/
|
*/
|
||||||
bool isSecondary();
|
bool isSecondary() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns a unique identifier for the current instance
|
* @brief Returns a unique identifier for the current instance
|
||||||
* @returns {qint32}
|
* @returns {qint32}
|
||||||
*/
|
*/
|
||||||
quint32 instanceId();
|
quint32 instanceId() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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();
|
qint64 primaryPid() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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();
|
QString primaryUser() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the username of the current user
|
* @brief Returns the username of the current user
|
||||||
* @returns {QString}
|
* @returns {QString}
|
||||||
*/
|
*/
|
||||||
QString currentUser();
|
QString currentUser() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sends a message to the primary instance. Returns true on success.
|
* @brief Sends a message to the primary instance. Returns true on success.
|
||||||
@ -137,7 +137,7 @@ public:
|
|||||||
* @brief Get the set user data.
|
* @brief Get the set user data.
|
||||||
* @returns {QStringList}
|
* @returns {QStringList}
|
||||||
*/
|
*/
|
||||||
QStringList userData();
|
QStringList userData() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void instanceStarted();
|
void instanceStarted();
|
||||||
|
Loading…
Reference in New Issue
Block a user