Пример #1
0
void SystemMonitor::initialize()
{
    d = new SystemMonitorPrivate(this);
    QAbstractEventDispatcher::instance()->installNativeEventFilter(d);

    connect(&d->network, SIGNAL(online()), this, SIGNAL(online()));
    connect(&d->network, SIGNAL(offline()), this, SIGNAL(offline()));

    connect(&d->screen, SIGNAL(screenLocked()), this, SIGNAL(screenLocked()));
    connect(&d->screen, SIGNAL(screenUnlocked()), this, SIGNAL(screenUnlocked()));
    connect(&d->screen, SIGNAL(screenSaverStarted()), this, SIGNAL(screenSaverStarted()));
    connect(&d->screen, SIGNAL(screenSaverStopped()), this, SIGNAL(screenSaverStopped()));
}
void ApplicationEventHandler::removeObserver(IApplicationEventHandlerObserver* _observer) {
  QObject* observer = dynamic_cast<QObject*>(_observer);
  disconnect(this, SIGNAL(urlReceivedSignal(QUrl)), observer, SLOT(urlReceived(QUrl)));
  disconnect(this, SIGNAL(screenLockedSignal()), observer, SLOT(screenLocked()));
  disconnect(this, SIGNAL(screenUnlockedSignal()), observer, SLOT(screenUnlocked()));
}