• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • plugins
  • positionprovider
  • geoclue
  • GeoCute
Provider.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2009 Eckhart Wörner <ewoerner@kde.org>
9 //
10 
11 #include "Provider_p.h"
12 
13 
14 
15 using namespace GeoCute;
16 
17 Provider::Private::Private(Provider& parent, const QString& service,
18  const QString& path)
19  : currentStatus(StatusUnavailable),
20  interface(service, path, interfaceName),
21  parent(parent)
22 
23 {
24  // Make sure the provider stays available as long as needed
25  interface.asyncCall("AddReference");
26  // Get an initial status
27  interface.callWithCallback("GetStatus", QList<QVariant>(), &parent,
28  SLOT(statusChangedCall(int)), 0);
29  // Stay informed about future status updates
30  interface.connect("StatusChanged", &parent, SLOT(statusChangedCall(int)));
31 }
32 
33 Provider::Private::~Private()
34 {
35  interface.asyncCall("RemoveReference");
36 }
37 
38 void Provider::Private::statusChangedCall(int status)
39 {
40  const Status newStatus = static_cast<Status>(status);
41  if (newStatus != currentStatus) {
42  currentStatus = newStatus;
43  // FIXME: Re-enable
44  emit parent.statusChanged(newStatus);
45  }
46 }
47 
48 
49 
50 Provider::Provider(const QString& service, const QString& path,
51  QObject* parent)
52  : QObject(parent), d(new Private(*this, service, path))
53 {
54 }
55 
56 Provider::~Provider()
57 {
58  delete d;
59 }
60 
61 Status Provider::status() const
62 {
63  return d->currentStatus;
64 }
65 
66 
67 
68 #include "Provider.moc"
interfaceName
static const QString interfaceName
Definition: MasterClient_p.h:23
GeoCute::Provider::Private
Definition: Provider_p.h:24
GeoCute::Provider::Private::currentStatus
Status currentStatus
Definition: Provider_p.h:32
GeoCute::Provider::status
Status status() const
Definition: Provider.cpp:61
GeoCute::Provider::Private::interface
SimpleDBusInterface interface
Definition: Provider_p.h:33
GeoCute::Provider::Provider
Provider(const QString &service, const QString &path, QObject *parent=0)
Definition: Provider.cpp:50
GeoCute::Status
Status
Definition: Status.h:19
QObject
GeoCute::SimpleDBusInterface::connect
void connect(const QString &name, QObject *receiver, const char *slot)
Definition: SimpleDBusInterface.cpp:70
GeoCute::Provider::Private::statusChangedCall
void statusChangedCall(int status)
Definition: Provider.cpp:38
Provider_p.h
QString
QList< QVariant >
GeoCute::Provider::Private::Private
Private(Provider &parent, const QString &service, const QString &path)
Definition: Provider.cpp:17
GeoCute::Provider::Private::~Private
~Private()
Definition: Provider.cpp:33
GeoCute::SimpleDBusInterface::asyncCall
QDBusPendingCall asyncCall(const QString &method) const
Definition: SimpleDBusInterface.cpp:25
GeoCute::Provider::~Provider
virtual ~Provider()
Definition: Provider.cpp:56
GeoCute::StatusUnavailable
Definition: Status.h:21
GeoCute::Provider
Definition: Provider.h:24
QObject::parent
QObject * parent() const
GeoCute::SimpleDBusInterface::callWithCallback
void callWithCallback(const QString &message, const QList< QVariant > &args, QObject *receiver, const char *returnMethod, const char *errorMethod) const
Definition: SimpleDBusInterface.cpp:60
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal