[Marble-devel] dbus interface to Marble, some questions

Arnd Baecker arnd.baecker at web.de
Mon Mar 2 08:56:40 CET 2009


On Sat, 28 Feb 2009, Torsten Rahn wrote:
[ ... ]
> On Friday 27 February 2009 09:02:21 Arnd Baecker wrote:
[ ... ]

> > Now my main question: Is there any way, to get the
> > lon,lat,zoom of the center of the current view as return parameters
> > using a dbus call?
>
> yes, currently I've just "exported" all slots. You are right that we need to
> markt the getters (which do exist in the C++ API - but don't get prefixed with
> "get" according to Qt standards) as scriptable to export them to the d-bus
> interface.

As pointed out on IRC by pinotree, exporting all properties will do
the trick.
I.e. adding
| QDBusConnection::ExportAllProperties
in src/lib/MarbleWidget.cpp   and src/lib/MarbleMap.cpp
exposes them.

Then one can use
  marble_pid="$(pidof marble)"
  alias CALL='qdbus org.kde.marble-${marble_pid} /MarbleWidget'
  CALL org.freedesktop.DBus.Properties.Get org.kde.MarbleWidget latitude
to get the current latitude (or longitude or zoom, etc.).

Note that one has to go through org.freedesktop.DBus.Properties.Get
as this latitude is not a method, but a property.

So with this, all works fine!!

Thanks a lot,

Arnd


More information about the Marble-devel mailing list