Commit 16aed080 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

No need to use MarbleWidgetInputHandler in KoRdfLocationEditWidget

also prevents breakage due to recent API change in Marble

thanks to Dennis Nienhüser for the basic patch
parent f42aa4dc
......@@ -24,7 +24,6 @@
#ifdef CAN_USE_MARBLE
#include <marble/LatLonEdit.h>
#include <marble/MarbleWidget.h>
#include <marble/MarbleWidgetInputHandler.h>
#endif
// KDE
#include <kdebug.h>
......@@ -37,7 +36,6 @@ public:
Marble::LatLonEdit* xlat;
Marble::LatLonEdit* xlong;
Marble::MarbleWidget* map;
#else
#endif
};
......@@ -53,10 +51,10 @@ KoRdfLocationEditWidget::~KoRdfLocationEditWidget()
delete d;
}
void KoRdfLocationEditWidget::mouseMoveGeoPosition(const QString &s)
{
kDebug(30015) << "KoRdfLocationEditWidget::mouseMoveGeoPosition() str:" << s;
#ifdef CAN_USE_MARBLE
void KoRdfLocationEditWidget::mouseMoveGeoPosition()
{
kDebug(30015) << "KoRdfLocationEditWidget::mouseMoveGeoPosition()";
if(d->map)
{
kDebug(30015) << "lat:" << d->map->centerLatitude() << " long:" << d->map->centerLongitude();
......@@ -64,10 +62,8 @@ void KoRdfLocationEditWidget::mouseMoveGeoPosition(const QString &s)
d->xlat->setValue( d->map->centerLatitude());
d->xlong->setValue(d->map->centerLongitude());
}
#endif
}
#ifdef CAN_USE_MARBLE
void KoRdfLocationEditWidget::setupMap( Marble::MarbleWidget* _map,
Marble::LatLonEdit* _xlat,
Marble::LatLonEdit* _xlong)
......@@ -77,21 +73,6 @@ void KoRdfLocationEditWidget::setupMap( Marble::MarbleWidget* _map,
d->xlong = _xlong;
kDebug(30015) << " map:" << d->map;
#if MARBLE_VERSION >= 0x000c00
Marble::MarbleWidgetDefaultInputHandler *handler = new Marble::MarbleWidgetDefaultInputHandler(d->map);
#else
Marble::MarbleWidgetDefaultInputHandler *handler = new Marble::MarbleWidgetDefaultInputHandler();
#endif
// handler->setLeftMouseButtonPopup( false );
handler->setPositionSignalConnected(true);
connect(handler, SIGNAL(mouseMoveGeoPosition(QString)),
this, SLOT(mouseMoveGeoPosition(QString)));
d->map->setInputHandler(handler);
#if MARBLE_VERSION < 0x000c00
handler->init(d->map);
#endif
connect(d->map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SLOT(mouseMoveGeoPosition()));
}
#endif
......@@ -20,7 +20,6 @@
#ifndef __rdf_KoRdfLocationEditWidget_h__
#define __rdf_KoRdfLocationEditWidget_h__
#include <QObject>
#include <QWidget>
class KoRdfLocationEditWidgetPrivate;
......@@ -50,10 +49,10 @@ public:
#ifdef CAN_USE_MARBLE
void setupMap(Marble::MarbleWidget* map, Marble::LatLonEdit* xlat, Marble::LatLonEdit* xlong);
#endif
public slots:
void mouseMoveGeoPosition(const QString&);
private slots:
void mouseMoveGeoPosition();
#endif
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment