~ubuntu-branches/ubuntu/trusty/kde-workspace/trusty

« back to all changes in this revision

Viewing changes to plasma/generic/dataengines/geolocation/geolocation.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2014-01-09 10:16:29 UTC
  • mfrom: (1.6.4)
  • Revision ID: package-import@ubuntu.com-20140109101629-i07ge8av1l6wrbci
Tags: 4:4.11.5-0ubuntu1
* New upstream release 
  - refresh kubuntu_kdewallpapers_install.diff 
  - drop upstream_Fix-traceback-in-Python-runner-plugins.patch and
    upstream_Do-not-crash-when-failing-to-load-a-theme-but-instea.patch,
    fixed upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
static const char SOURCE[] = "location";
26
26
 
27
27
Geolocation::Geolocation(QObject* parent, const QVariantList& args)
28
 
    : Plasma::DataEngine(parent, args),
29
 
      m_networkStatus(false)
 
28
    : Plasma::DataEngine(parent, args)
30
29
{
31
30
    Q_UNUSED(args)
32
31
    setMinimumPollingInterval(500);
39
38
 
40
39
void Geolocation::init()
41
40
{
42
 
    m_networkStatus = Solid::Networking::status();
43
 
 
44
41
    //TODO: should this be delayed even further, e.g. when the source is requested?
45
42
    const KService::List offers = KServiceTypeTrader::self()->query("Plasma/GeolocationProvider");
46
43
    QVariantList args;
110
107
void Geolocation::networkStatusChanged()
111
108
{
112
109
    kDebug() << "network status changed";
113
 
    m_networkStatus = Solid::Networking::status();
114
 
    if ((m_networkStatus == Solid::Networking::Connected) ||
115
 
        (m_networkStatus == Solid::Networking::Unknown)) {
 
110
    const Solid::Networking::Status netStatus = Solid::Networking::status();
 
111
    if ((netStatus == Solid::Networking::Connected) || (netStatus == Solid::Networking::Unknown)) {
116
112
        updatePlugins(GeolocationProvider::NetworkConnected);
117
113
    }
118
114
}