mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2024-11-15 12:15:43 +08:00
Add SingleApplication::currentUser()
This commit is contained in:
parent
49c282a64c
commit
5fff2202b5
@ -1,6 +1,11 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
__3.1.1a__
|
||||
----------
|
||||
|
||||
* Added currentUser() method that returns the user the current instance is running as.
|
||||
|
||||
__3.1.0a__
|
||||
----------
|
||||
|
||||
|
@ -214,6 +214,14 @@ QString SingleApplication::primaryUser()
|
||||
|
||||
Returns the username the primary instance is running as.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
QString SingleApplication::currentUser()
|
||||
```
|
||||
|
||||
Returns the username the current instance is running as.
|
||||
|
||||
### Signals
|
||||
|
||||
```cpp
|
||||
|
@ -178,6 +178,12 @@ QString SingleApplication::primaryUser()
|
||||
return d->primaryUser();
|
||||
}
|
||||
|
||||
QString SingleApplication::currentUser()
|
||||
{
|
||||
Q_D(SingleApplication);
|
||||
return d->getUsername();
|
||||
}
|
||||
|
||||
bool SingleApplication::sendMessage( QByteArray message, int timeout )
|
||||
{
|
||||
Q_D(SingleApplication);
|
||||
|
@ -118,6 +118,12 @@ public:
|
||||
*/
|
||||
QString primaryUser();
|
||||
|
||||
/**
|
||||
* @brief Returns the username of the current user
|
||||
* @returns {QString}
|
||||
*/
|
||||
QString currentUser();
|
||||
|
||||
/**
|
||||
* @brief Sends a message to the primary instance. Returns true on success.
|
||||
* @param {int} timeout - Timeout for connecting
|
||||
|
Loading…
Reference in New Issue
Block a user