Keeps track of which server plug-ins should be enabled.
More...
#include <ServerActivator.h>
|
void | serverEnabled (const QString &aServerName) |
| Signal emitted when a server should be enabled.
|
|
void | serverDisabled (const QString &aServerName) |
| Signal emitted when a server should be disabled.
|
|
|
| ServerActivator (ProfileManager &aProfileManager, TransportTracker &aTransportTracker, QObject *aParent=0) |
| Constructor.
|
|
virtual | ~ServerActivator () |
| Destructor.
|
|
int | addRef (const QString &aServerName, bool emitSignal=true) |
| Adds a reference to the given server.
|
|
int | removeRef (const QString &aServerName, bool emitSignal=true) |
| Removes a reference from the given server.
|
|
QStringList | enabledServers () const |
| Gets the list of enabled server.
|
|
Keeps track of which server plug-ins should be enabled.
Finds out from server profiles which transports each server plug-in uses and concludes the enabled/disabled state based on the transport states. A server is enabled if any of the transports it uses is enabled or if there are any references left to the server. Each matching and enabled transport creates one reference to the server. References can be added and removed also externally, so that a server won't become disabled if it is still in use but all its transports are disabled. A signal is emitted when a server is enabled or disabled. This class does not control the actual server plug-ins, it only gives information about when a server plug-in should be enabled or disabled.
◆ ServerActivator()
Constructor.
- Parameters
-
aProfileManager | Profile manager for accessing server profiles |
aTransportTracker | Transport tracker |
aParent | Parent object |
◆ addRef()
int ServerActivator::addRef |
( |
const QString & |
aServerName, |
|
|
bool |
emitSignal = true |
|
) |
| |
Adds a reference to the given server.
If the reference count was zero, emits the serverEnabled signal, if the emit signal paramater is true
- Parameters
-
aServerName | Server profile name |
emitSignal | Controls the emission of the serverEnabled signal |
- Returns
- Number of references after the addition
◆ enabledServers()
Gets the list of enabled server.
- Returns
- Server profile names
◆ onConnectivityStateChanged
void ServerActivator::onConnectivityStateChanged |
( |
Sync::ConnectivityType |
aType, |
|
|
bool |
aState |
|
) |
| |
|
slot |
Called when transport state changes.
- Parameters
-
aType | Connectivity type |
aState | New state |
◆ removeRef()
int ServerActivator::removeRef |
( |
const QString & |
aServerName, |
|
|
bool |
emitSignal = true |
|
) |
| |
Removes a reference from the given server.
If the reference count reaches zero, emits the serverDisabled signal, if the emitSignal parameter is true
- Parameters
-
aServerName | Server profile name |
emitSignal | Controls the emission of the serverDisabled signal |
- Returns
- Number of references after the remove
◆ serverDisabled
void Buteo::ServerActivator::serverDisabled |
( |
const QString & |
aServerName | ) |
|
|
signal |
Signal emitted when a server should be disabled.
- Parameters
-
aServerName | Server profile name |
◆ serverEnabled
void Buteo::ServerActivator::serverEnabled |
( |
const QString & |
aServerName | ) |
|
|
signal |
Signal emitted when a server should be enabled.
- Parameters
-
aServerName | Server profile name |
The documentation for this class was generated from the following files: