Exemplo n.º 1
0
void WeatherEngine::init()
{
    // Get the list of available plugins but don't load them
    Solid::Networking::Status status = Solid::Networking::status();
    m_networkAvailable = (status == Solid::Networking::Connected ||
                             status == Solid::Networking::Unknown);
    connect(Solid::Networking::notifier(), SIGNAL(statusChanged(Solid::Networking::Status)),
            this, SLOT(networkStatusChanged(Solid::Networking::Status)));
    connect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), this, SLOT(updateIonList()));

    updateIonList();
    kDebug() << "init()";
}
Exemplo n.º 2
0
// Constructor
WeatherEngine::WeatherEngine(QObject *parent, const QVariantList& args)
        :  Plasma::DataEngine(parent, args)
{
    m_reconnectTimer.setSingleShot(true);
    connect(&m_reconnectTimer, &QTimer::timeout, this, &WeatherEngine::startReconnect);

    // Globally notify all plugins to remove their sources (and unload plugin)
    connect(this, &Plasma::DataEngine::sourceRemoved, this, &WeatherEngine::removeIonSource);

    connect(&m_networkConfigurationManager, &QNetworkConfigurationManager::onlineStateChanged,
            this, &WeatherEngine::onOnlineStateChanged);

    // Get the list of available plugins but don't load them
    connect(KSycoca::self(), static_cast<void (KSycoca::*)(const QStringList&)>(&KSycoca::databaseChanged),
            this, &WeatherEngine::updateIonList);

    updateIonList();
}