diff --git a/src/plugins/render/CMakeLists.txt b/src/plugins/render/CMakeLists.txt index e49ebdc2d..0da9208d3 100644 --- a/src/plugins/render/CMakeLists.txt +++ b/src/plugins/render/CMakeLists.txt @@ -1,55 +1,54 @@ # Example # add_subdirectory( test ) # Display a control or a screen box add_subdirectory( compass ) add_subdirectory( elevationprofilefloatitem ) # add_subdirectory( fileview ) add_subdirectory( gpsinfo ) add_subdirectory( license ) add_subdirectory( mapscale ) add_subdirectory( navigation ) add_subdirectory( overviewmap ) add_subdirectory( progress ) add_subdirectory( routing ) add_subdirectory( speedometer ) # Display geographical information on the map add_subdirectory( annotate ) add_subdirectory( crosshairs ) add_subdirectory( eclipses ) add_subdirectory( elevationprofilemarker ) add_subdirectory( graticule ) add_subdirectory( measure ) add_subdirectory( positionmarker ) add_subdirectory( atmosphere ) add_subdirectory( stars ) add_subdirectory( sun ) add_subdirectory( notes ) # Display online information add_subdirectory( earthquake ) add_subdirectory(foursquare) # Disabled for now until legal issues wrt to the API # and terms of service of opencaching are cleared up. #add_subdirectory( opencaching ) if(NOT MARBLE_NO_WEBKITWIDGETS) -add_subdirectory( opencachingcom ) add_subdirectory( opendesktop ) add_subdirectory( photo ) endif() # add_subdirectory( panoramio ) add_subdirectory( postalcode ) add_subdirectory( satellites ) # add_subdirectory ( twitter ) if(NOT MARBLE_NO_WEBKITWIDGETS) add_subdirectory( wikipedia ) add_subdirectory( weather ) endif() find_package( Perl ) marble_set_package_properties( Perl PROPERTIES URL "http://www.perl.org" ) marble_set_package_properties( Perl PROPERTIES TYPE OPTIONAL PURPOSE "generation of sources in the APRS plugin" ) if( PERL_FOUND AND NOT CMAKE_SYSTEM_NAME STREQUAL Android) add_subdirectory( aprs ) endif() diff --git a/src/plugins/render/opencachingcom/CMakeLists.txt b/src/plugins/render/opencachingcom/CMakeLists.txt deleted file mode 100644 index e377fd546..000000000 --- a/src/plugins/render/opencachingcom/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -PROJECT( OpenCachingComPlugin ) - -INCLUDE_DIRECTORIES( - ${CMAKE_BINARY_DIR}/src/plugins/render/opencachingcom -) - -SET( my_SRCS - OpenCachingComPlugin.cpp - OpenCachingComModel.cpp - OpenCachingComItem.cpp - ) -# SET( opencaching_UI OpenCachingConfigWidget.ui ) -SET( cachedetailsdialog_UI CacheDetailsDialog.ui ) - -# QT_WRAP_UI(my_SRCS ${opencaching_UI}) -QT_WRAP_UI(my_SRCS ${cachedetailsdialog_UI}) - -qt_add_resources(my_SRCS opencachingcom.qrc) - -MARBLE_ADD_PLUGIN( OpenCachingComPlugin ${my_SRCS} ) - diff --git a/src/plugins/render/opencachingcom/CacheDetailsDialog.ui b/src/plugins/render/opencachingcom/CacheDetailsDialog.ui deleted file mode 100644 index 12f2a2012..000000000 --- a/src/plugins/render/opencachingcom/CacheDetailsDialog.ui +++ /dev/null @@ -1,175 +0,0 @@ - - - CacheDetailsDialog - - - true - - - - 0 - 0 - 400 - 300 - - - - - - - - 0 - 0 - - - - - - - - - - - - 1 - 0 - - - - TextLabel - - - - - - - ... - - - - - - - true - - - 0 - - - - true - - - General - - - - - - - 1 - 0 - - - - TextLabel - - - - - - - Qt::Vertical - - - - 20 - 173 - - - - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - Description - - - - - - - - - - true - - - Hint - - - - - - - - - - Logs - - - - - - - - - - - - - Qt::Horizontal - - - - 294 - 20 - - - - - - - - &Close - - - - - - - - QWebView - QWidget -
QtWebKit/QWebView
-
- - Marble::MarbleWebView - QWebView -
MarbleWebView.h
-
-
- - -
diff --git a/src/plugins/render/opencachingcom/OpenCachingComItem.cpp b/src/plugins/render/opencachingcom/OpenCachingComItem.cpp deleted file mode 100644 index fc9bb011c..000000000 --- a/src/plugins/render/opencachingcom/OpenCachingComItem.cpp +++ /dev/null @@ -1,411 +0,0 @@ -// -// This file is part of the Marble Virtual Globe. -// -// This program is free software licensed under the GNU LGPL. You can -// find a copy of this license in LICENSE.txt in the top directory of -// the source code. -// -// Copyright 2012 Anders Lund -// Copyright 2014 Bernhard Beschow -// - -#include "OpenCachingComItem.h" -#include "GeoPainter.h" -#include "ViewportParams.h" -#include "MarbleModel.h" -#include "PositionTracking.h" -#include "MarbleMath.h" -#include "MarbleLocale.h" -#include "Planet.h" - -#include "ui_CacheDetailsDialog.h" -#include "OpenCachingComModel.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace Marble -{ - -OpenCachingComItem::OpenCachingComItem( const QVariantMap& cache, OpenCachingComModel *parent ) - : AbstractDataPluginItem( parent ) - , m_ui( 0 ) - , m_model( parent ) - , m_cache( cache ) - , m_action( new QAction( this ) ) -{ - setId( cache["oxcode"].toString() ); - setCoordinate( GeoDataCoordinates( cache["location"].toMap()["lon"].toReal(), cache["location"].toMap()["lat"].toReal(), 0.0, GeoDataCoordinates::Degree ) ); - - // Opencaching.Com does (in effect) this, so as do we.. - if (m_cache["type"].toString() == QLatin1String("Unknown Cache")) { - m_cache["type"] = QString("Puzzle"); - } - - updateTooltip(); - m_action->setText( m_cache["name"].toString() ); - - connect( action(), SIGNAL(triggered()), - this, SLOT(showInfoDialog()) ); - - setSize(QSizeF(24,24)); -} - -OpenCachingComItem::~OpenCachingComItem() -{ -} - -bool OpenCachingComItem::initialized() const -{ - return !id().isEmpty(); -} - -QAction *OpenCachingComItem::action() -{ - return m_action; -} - -void OpenCachingComItem::showInfoDialog() -{ - QDialog dialog; - - Ui::CacheDetailsDialog ui; - ui.setupUi( &dialog ); - - m_ui = &ui; - - dialog.setWindowTitle( tr("Cache Details for %1").arg(id() )); - - m_ui->labelIcon->setPixmap(QPixmap(QLatin1String(":/") + iconName() + QLatin1String(".png"))); - m_ui->labelHeader->setText(QLatin1String("") + m_cache["name"].toString() + QLatin1String("")); - - m_ui->buttonWww->setIcon(QIcon(QStringLiteral(":/internet.png"))); - m_ui->buttonWww->setToolTip( tr("Click to open this cache's page in a browser") ); - connect( m_ui->buttonWww, SIGNAL(clicked()), SLOT(openWww()) ); - - // basic details - QString details = QLatin1String("" - "" - "" - "" - "" - "" - "" - ""); - - // list of tags - // ### cache the translated cache string. Necessary?? - if (m_cache["strTags"].toString().isEmpty() ) - { - QStringList tags = m_cache["tags"].toStringList(); - QString strTags; - for (int i=0; i"); - } - - // "series" - name of a series that this cache belongs to - QString series = m_cache["series"].toString(); - if (!series.isEmpty()) - { - details += QLatin1String(""); - } - - // verification options translated - // these are ways to verify a visit to the cache - QVariantMap verifyOpts = m_cache["verification"].toMap(); - if (verifyOpts.count()) - { - QStringList verifyOptsStrings; - if (verifyOpts["number"].isValid()) - verifyOptsStrings << tr("number"); - if (verifyOpts["chirp"].isValid()) - verifyOptsStrings << tr("chirp"); - if (verifyOpts["qr"].isValid()) - verifyOptsStrings << tr("qr code"); - if (verifyOpts["code_phrase"].isValid()) - verifyOptsStrings << tr("code phrase"); - - details += QLatin1String(""); - } - - // show a distance to the cache, either from current position if we know, - // or from the "home" position - bool hasposition = false; - PositionTracking *tracking = m_model->marbleModel()->positionTracking(); - if (tracking) - { - GeoDataCoordinates location = tracking->currentLocation(); - if (location.isValid()) - { - QString dist = formatDistance( distanceSphere(location, coordinate()) ); - details += QLatin1String(""); - hasposition = true; - } - } - if (!hasposition) - { - GeoDataCoordinates homelocation = m_model->home(); - if ( homelocation.isValid() ) - { - QString dist = formatDistance( distanceSphere(homelocation, coordinate()) ); - details += QLatin1String(""); - } - } - - ui.labelGeneral->setText(details.append("
") + - tr(m_cache["type"].toString().toUtf8().constData()) + - QLatin1String("
") + id() + QLatin1String("
") + coordinate().toString() + QLatin1String("
") + tr("Size:") + QLatin1String(" ") + ratingNumberString(m_cache["size"]) + QLatin1String("
") + tr("Difficulty:") + QLatin1String(" ") + ratingNumberString(m_cache["difficulty"]) + QLatin1String("
") + tr("Terrain:") + QLatin1String(" ") + ratingNumberString(m_cache["terrain"]) + QLatin1String("
") + tr("Awsomeness:") + QLatin1String(" ") + ratingNumberString(m_cache["awsomeness"]) + QLatin1String("
") + tr("Hidden by:") + QLatin1String(" ") + m_cache["hidden_by"].toMap()["name"].toString() + QLatin1String("
") + tr("Hidden:") + QLatin1String(" ") + dateString(m_cache["hidden"]) + QLatin1String("
") + tr("Last found:") + QLatin1String(" ") + dateString(m_cache["last_found"]) + QLatin1String("
") + tr("Tags:") + QLatin1String(" ") + strTags + QLatin1String("
") + tr("Series:") + QLatin1String(" ") + series + QLatin1String("
") + tr("Verification:") + QLatin1String(" ") + verifyOptsStrings.join(QStringLiteral(", ")) + QLatin1String("
") + tr("Distance:") + QLatin1String(" ") + dist + QLatin1String("
") + tr("Distance from home:") + QLatin1String(" ") + dist + QLatin1String("
")); - - // tags represented as icons - int numtags = m_cache["tags"].toList().count(); - if (numtags) - { - QStringList tags = m_cache["tags"].toStringList(); - int tagrows = (numtags/6) + 1; - QString tagiconshtml; - for (int i=0; i") - .arg(tags.at(i).toLower().replace(QLatin1Char(' '),QLatin1Char('-'))).arg(tags.at(i)); - if (0 == (i+1)%tagrows) - { - tagiconshtml += QLatin1String("
"); - } - } - ui.labelTagIcons->setText(tagiconshtml); - } - - // Description tab - QString description = m_cache["description"].toString(); - if ( description.isEmpty() ) - { - const QUrl url(QLatin1String("http://www.opencaching.com/api/geocache/") + id() + QLatin1String("?Authorization=") + AUTHKEY); - m_model->fetchData( url, "description_and_logs", this ); - } else { - fillDialogTabs(); - } - - m_ui->textDescription->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); - m_ui->textLogs->setOpenExternalLinks(true); - - connect( ui.buttonClose, SIGNAL(clicked()), &dialog, SLOT(close()) ); - connect( ui.buttonClose, SIGNAL(clicked()), this, SLOT(dialogCloseClicked()) ); - - dialog.exec(); -} - -void OpenCachingComItem::paint( QPainter *painter ) -{ - QPixmap pm(QLatin1String(":/") + iconName() + QLatin1String("-m.png")); - painter->drawPixmap( 0, 0, pm ); -} - -void OpenCachingComItem::updateTooltip() -{ - if ( !id().isEmpty() ) { - // ### how do i update the tooltip on hover? -// QString strDist; -// bool hasposition = false; -// PositionTracking *tracking = m_model->marbleModel()->positionTracking(); -// if (tracking) -// { -// GeoDataCoordinates location = tracking->currentLocation(); -// if (location.isValid()) -// { -// QString dist = formatDistance( distanceSphere(location, coordinate()) ); -// strDist = tr("Distance: ") + dist; -// hasposition = true; -// } -// } -// if (!hasposition) -// { -// GeoDataCoordinates homelocation = m_model->home(); -// if ( homelocation.isValid() ) -// { -// QString dist = formatDistance( distanceSphere(homelocation, coordinate()) ); -// strDist = tr("Distance from home: ") + dist; -// } -// } - - const QString html = QLatin1String("" - "" - "" - "" -// + "" - "
" - "
") + m_cache["name"].toString() + QLatin1String("
") + - tr(m_cache["type"].toString().toUtf8().constData()) + - QLatin1String("
") + tr("by ") + m_cache["hidden_by"].toMap()["name"].toString() + QLatin1String("" - "
") + coordinate().lonToString() + - QLatin1String("
") + coordinate().latToString() + - QLatin1String("
") + - tr( "Difficulty") + QLatin1String(":  ") + ratingNumberString(m_cache["difficulty"]) + QLatin1String(" " - "
") + tr("Terrain") + QLatin1String(":  ") + ratingNumberString(m_cache["terrain"]) + QLatin1String(" " - "
") + tr("Awsomeness") + QLatin1String(":  ") + ratingNumberString(m_cache["awsomeness"]) + QLatin1String(" " - "
") + tr("Size") + QLatin1String(":  ") + ratingNumberString(m_cache["size"]) + QLatin1String(" 
") + tr("Last found: ") + dateString(m_cache["last_found"]) + QLatin1String("
" + strDist + "
"); - setToolTip( html ); - } -} - -bool OpenCachingComItem::operator<( const AbstractDataPluginItem *other ) const -{ - return id() < other->id(); -} - -void OpenCachingComItem::addDownloadedFile( const QString &url, const QString &type ) -{ - if (type == QLatin1String("description_and_logs")) { - QFile file( url ); - if (! file.open( QIODevice::ReadOnly | QIODevice::Text ) ) - { - return; - } - - QJsonDocument jsonDoc = QJsonDocument::fromJson(file.readAll()); - QVariantMap cache = jsonDoc.toVariant().toMap(); - - m_cache["description"] = cache["description"]; - m_cache["logs"] = cache["logs"]; - m_cache["hint"] = cache["hint"]; - - QVariantList images = m_cache["images"].toList(); - for (int i = 0; i < images.size(); i++) { - QVariantMap image = images.at(i).toMap(); - const QString url = QLatin1String("http://www.opencaching.com/api/geocache/") + id() + QLatin1Char('/') + image["caption"].toString(); -// qDebug()<<"Adding image: "<marbleModel()->planet()->radius() * spheredistance; - - MarbleLocale *locale = MarbleGlobal::getInstance()->locale(); - const MarbleLocale::MeasurementSystem measurementSystem = locale->measurementSystem(); - MarbleLocale::MeasureUnit unit; - qreal convertedMeters; - locale->meterToTargetUnit(distance, measurementSystem, convertedMeters, unit); - QString unitString = locale->unitAbbreviation(unit); - - return QString("%L1 %2").arg(convertedMeters, 8, 'f', 1, QLatin1Char(' ')) - .arg(unitString); -} - -void OpenCachingComItem::fillDialogTabs() -{ - if (m_ui) - { - QString html = m_cache["description"].toString(); - - // images - for (int i = 0; i < m_images.size(); i++) - { - if (m_images.size() > i) - { - // ### what about spoiler images? (don't display, but then what?) - html += - QLatin1String("


") + - m_cache["images"].toList().at(i).toMap()["name"].toString() + - QLatin1String("

"); - } - } - - m_ui->textDescription->setHtml(html); - - QString hint = m_cache["hint"].toString().trimmed(); - if (! hint.isEmpty()) - { - m_ui->textHint->setText(hint); - } - m_ui->tabWidget->setTabEnabled(2, !hint.isEmpty()); - - QVariantList logs = m_cache["logs"].toList(); - QString logtext; - for (int i = 0; i < logs.size(); ++i) - { - QVariantMap log = logs.at(i).toMap(); - if ( i ) - { - logtext += QLatin1String("
"); - } - logtext += - tr("User: ") + log["user"].toMap()["name"].toString() + QLatin1String("
") + - tr("Type: ") + log["type"].toString() + QLatin1String("
") + - tr("Date: ") + dateString(log["log_time"]) + QLatin1String("

") + - log["comment"].toString() + QLatin1String("
"); - - // TODO images - } - m_ui->textLogs->setText(logtext); - } -} - -void OpenCachingComItem::openWww() -{ - QDesktopServices::openUrl(QUrl(QLatin1String("http://www.opencaching.com/#!geocache/") + m_cache[QStringLiteral("oxcode")].toString())); -} - -} // namespace Marble - -#include "moc_OpenCachingComItem.cpp" diff --git a/src/plugins/render/opencachingcom/OpenCachingComItem.h b/src/plugins/render/opencachingcom/OpenCachingComItem.h deleted file mode 100644 index 15b36239f..000000000 --- a/src/plugins/render/opencachingcom/OpenCachingComItem.h +++ /dev/null @@ -1,77 +0,0 @@ -// -// This file is part of the Marble Virtual Globe. -// -// This program is free software licensed under the GNU LGPL. You can -// find a copy of this license in LICENSE.txt in the top directory of -// the source code. -// -// Copyright 2012 Anders Lund -// - -#ifndef OPENCACHINGCOMITEM_H -#define OPENCACHINGCOMITEM_H - -#include "AbstractDataPluginItem.h" -// #include "OpenCachingComCache.h" - -#include - -class QAction; - -namespace Ui { - class CacheDetailsDialog; -} - -namespace Marble -{ - -class OpenCachingComModel; - -class OpenCachingComItem : public AbstractDataPluginItem -{ - Q_OBJECT - -public: - OpenCachingComItem( const QVariantMap& cache, OpenCachingComModel *parent ); - - ~OpenCachingComItem() override; - - bool initialized() const override; - - void paint( QPainter *painter ) override; - - QAction *action() override; - - bool operator<( const AbstractDataPluginItem *other ) const override; - - void addDownloadedFile( const QString &url, const QString &type ) override; - -public Q_SLOTS: - void showInfoDialog(); - -private Q_SLOTS: - void dialogCloseClicked(); - void openWww(); - -private: - void updateTooltip(); - - QString iconName() const; - - static QString dateString(const QVariant& ms); ///< create a date string from millisecondssinceepoch in a qvariant - - static const QString ratingNumberString(const QVariant& number); ///< "1" -> "1.0" - - QString formatDistance(qreal spheredistance) const; ///< nice string from a Marble::distanceSphere() - - void fillDialogTabs(); ///< loads description, hint and logs into the dialog tabs - - Ui::CacheDetailsDialog *m_ui; ///< 0 unless dialog exists - OpenCachingComModel *const m_model; - QVariantMap m_cache; - QAction *const m_action; - QStringList m_images; -}; - -} -#endif // OPENCACHINGCOMITEM_H diff --git a/src/plugins/render/opencachingcom/OpenCachingComModel.cpp b/src/plugins/render/opencachingcom/OpenCachingComModel.cpp deleted file mode 100644 index ce1a82cc1..000000000 --- a/src/plugins/render/opencachingcom/OpenCachingComModel.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// -// This file is part of the Marble Virtual Globe. -// -// This program is free software licensed under the GNU LGPL. You can -// find a copy of this license in LICENSE.txt in the top directory of -// the source code. -// -// Copyright 2012 Anders Lund -// - -#include "OpenCachingComModel.h" -#include "OpenCachingComItem.h" - -#include "MarbleGlobal.h" -#include "MarbleModel.h" -#include "GeoDataCoordinates.h" -#include "MarbleDebug.h" - -#include -#include -#include -#include - -namespace Marble { - -OpenCachingComModel::OpenCachingComModel( const MarbleModel *marbleModel, QObject *parent ) - : AbstractDataPluginModel( "opencachingcom", marbleModel, parent ) -{ - // translate known values for tags and cache types - // What would be a nice place for this??? Put here, since this object is only - // constructed once. - // note to translators: "cache" in this context means "geocache", - // please refer to opencaching.com and wikipedia if in doubt. - tr("Boat required"); - tr("Chirp"); - tr("Diving"); - tr("Exclusive"); - tr("Historic site"); - tr("Letterbox"); - tr("Night"); - tr("Tree climbing"); - tr("UV light"); - - tr("Traditional Cache"); - tr("Multi-cache"); - tr("Virtual Cache"); - tr("Puzzle Cache"); - tr("Unknown Cache"); -} - -OpenCachingComModel::~OpenCachingComModel() -{ -} - -void OpenCachingComModel::getAdditionalItems( const GeoDataLatLonAltBox& box, qint32 number ) -{ - if (marbleModel()->planetId() != QLatin1String("earth")) { - return; - } - - if ( m_previousbox.contains( box ) ) - { - return; - } - - QString url("http://www.opencaching.com/api/geocache/?Authorization="); - url += AUTHKEY + QStringLiteral("&bbox=%1,%2,%3,%4") - .arg( box.south( GeoDataCoordinates::Degree ) ) - .arg( box.west(GeoDataCoordinates::Degree ) ) - .arg( box.north(GeoDataCoordinates::Degree ) ) - .arg( box.east(GeoDataCoordinates::Degree ) ); - if(!m_previousbox.isNull()) - { - url += QStringLiteral("&exclude_bbox=%1,%2,%3,%4") - .arg( m_previousbox.south( GeoDataCoordinates::Degree ) ) - .arg( m_previousbox.west(GeoDataCoordinates::Degree ) ) - .arg( m_previousbox.north(GeoDataCoordinates::Degree ) ) - .arg( m_previousbox.east(GeoDataCoordinates::Degree ) ); - } - url += QLatin1String("&limit=") + QString::number(number); - // TODO Limit to user set tags/types/difficulty - when there is a config dialog... - - m_previousbox = box; - -// qDebug()<<"Fetching more caches: "< items; - while (!caches.isEmpty()) - { - QVariantMap map = caches.takeFirst().toMap(); - if ( !findItem( map["oxcode"].toString() ) ) - { - items << new OpenCachingComItem( map, this ); - } - } - addItemsToList(items); -} - -void OpenCachingComModel::fetchData(const QUrl& url, const QString &type, OpenCachingComItem *item) -{ - downloadItem(url, type, item); -} - -const GeoDataCoordinates OpenCachingComModel::home() const -{ - qreal lon, lat; - int zoom; - marbleModel()->home( lon, lat, zoom ); - return GeoDataCoordinates(lon, lat, 0, GeoDataCoordinates::Degree); -} - -} // namespace Marble - -#include "moc_OpenCachingComModel.cpp" diff --git a/src/plugins/render/opencachingcom/OpenCachingComModel.h b/src/plugins/render/opencachingcom/OpenCachingComModel.h deleted file mode 100644 index 2c00228fb..000000000 --- a/src/plugins/render/opencachingcom/OpenCachingComModel.h +++ /dev/null @@ -1,67 +0,0 @@ -// -// This file is part of the Marble Virtual Globe. -// -// This program is free software licensed under the GNU LGPL. You can -// find a copy of this license in LICENSE.txt in the top directory of -// the source code. -// -// Copyright 2012 Anders Lund -// - -#ifndef OPENCACHINGCOMMODEL_H -#define OPENCACHINGCOMMODEL_H - -#include "AbstractDataPluginModel.h" -#include "GeoDataLatLonAltBox.h" - -// Please note and respect that this key is for use ONLY within this plugin. -#define AUTHKEY "mJg2Q5fD3qczP7M8" - -namespace Marble -{ - -class MarbleModel; - -class OpenCachingComItem; - -namespace { -// The maximum number of items we want to show on the screen. -const quint32 numberOfItemsOnScreen = 100; -} - -class OpenCachingComModel : public AbstractDataPluginModel -{ - Q_OBJECT - -public: - explicit OpenCachingComModel( const MarbleModel *marbleModel, QObject *parent = 0 ); - ~OpenCachingComModel() override; - - - /// Fetch a file for a cache - void fetchData(const QUrl &url, const QString &type, OpenCachingComItem *item); - - /// home location - const GeoDataCoordinates home() const; - -protected: - /** - * Generates the download url for the description file from the web service depending on - * the @p box surrounding the view and the @p number of files to show. - **/ - void getAdditionalItems( const GeoDataLatLonAltBox& box, - qint32 number = numberOfItemsOnScreen ) override; - - /** - * Parses the @p file which getAdditionalItems downloads and - * prepares the data for usage. - **/ - void parseFile( const QByteArray& file ) override; - -private: - GeoDataLatLonAltBox m_previousbox; -}; - -} - -#endif // OPENCACHINGCOMMODEL_H diff --git a/src/plugins/render/opencachingcom/OpenCachingComPlugin.cpp b/src/plugins/render/opencachingcom/OpenCachingComPlugin.cpp deleted file mode 100644 index 19912870f..000000000 --- a/src/plugins/render/opencachingcom/OpenCachingComPlugin.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// -// This file is part of the Marble Virtual Globe. -// -// This program is free software licensed under the GNU LGPL. You can -// find a copy of this license in LICENSE.txt in the top directory of -// the source code. -// -// Copyright 2012 Anders Lund -// - -#include "OpenCachingComPlugin.h" -#include "OpenCachingComModel.h" - -#include - -namespace Marble { - -OpenCachingComPlugin::OpenCachingComPlugin() - : AbstractDataPlugin( 0 ) - , m_isInitialized( false ) -{ -} - -OpenCachingComPlugin::OpenCachingComPlugin(const MarbleModel *marbleModel) - : AbstractDataPlugin( marbleModel ) - , m_isInitialized( false ) -{ - setEnabled( true ); // Plugin is enabled by default - setVisible( false ); // Plugin is invisible by default -} - -void OpenCachingComPlugin::initialize() -{ - OpenCachingComModel *model = new OpenCachingComModel( marbleModel(), this ); - setModel( model ); - setNumberOfItems( numberOfItemsOnScreen ); - m_isInitialized = true; -} - -bool OpenCachingComPlugin::isInitialized() const -{ - return m_isInitialized; -} - -QStringList OpenCachingComPlugin::backendTypes() const -{ - return QStringList(QStringLiteral("opencaching.com")); -} - -QString OpenCachingComPlugin::name() const -{ - return tr( "OpenCaching.Com" ); -} - -QString OpenCachingComPlugin::guiString() const -{ - return tr( "&OpenCaching.Com" ); -} - -QString OpenCachingComPlugin::nameId() const -{ - return QStringLiteral("opencaching.com"); -} - -QString OpenCachingComPlugin::version() const -{ - return QStringLiteral("1.0"); -} - -QString OpenCachingComPlugin::description() const -{ - return tr( "Shows caches from OpenCaching.com on the map." ); -} - -QString OpenCachingComPlugin::copyrightYears() const -{ - return QStringLiteral("2012"); -} - -QVector OpenCachingComPlugin::pluginAuthors() const -{ - return QVector() - << PluginAuthor(QStringLiteral("Anders Lund"), QStringLiteral("anders@alweb.dk")); -} - -QIcon OpenCachingComPlugin::icon() const -{ - return QIcon(QStringLiteral(":/occlogo.png")); -} - -} - -#include "moc_OpenCachingComPlugin.cpp" diff --git a/src/plugins/render/opencachingcom/OpenCachingComPlugin.h b/src/plugins/render/opencachingcom/OpenCachingComPlugin.h deleted file mode 100644 index 3ae59c0d6..000000000 --- a/src/plugins/render/opencachingcom/OpenCachingComPlugin.h +++ /dev/null @@ -1,71 +0,0 @@ -// -// This file is part of the Marble Virtual Globe. -// -// This program is free software licensed under the GNU LGPL. You can -// find a copy of this license in LICENSE.txt in the top directory of -// the source code. -// -// Copyright 2012 Anders Lund -// - -#ifndef OPENCACHINGCOMPLUGIN_H -#define OPENCACHINGCOMPLUGIN_H - -#include "AbstractDataPlugin.h" - -namespace Ui -{ -// class OpenCachingConfigWidget; -} - -namespace Marble -{ - -/** - * Plugin to display geocaches from opencaching.com on the map. - */ -class OpenCachingComPlugin : public AbstractDataPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.kde.marble.OpenCachingComPlugin") - - Q_INTERFACES( Marble::RenderPluginInterface ) - - MARBLE_PLUGIN( OpenCachingComPlugin ) - -public: - OpenCachingComPlugin(); - explicit OpenCachingComPlugin(const MarbleModel *marbleModel); - - void initialize() override; - - bool isInitialized() const override; - - QStringList backendTypes() const override; - - QString name() const override; - - QString guiString() const override; - - QString nameId() const override; - - QString version() const override; - - QString description() const override; - - QString copyrightYears() const override; - - QVector pluginAuthors() const override; - - QIcon icon() const override; - - QDialog *configDialog(); - -private: - bool m_isInitialized; - -}; - -} - -#endif // OPENCACHINGCOMPLUGIN_H diff --git a/src/plugins/render/opencachingcom/boat-required.png b/src/plugins/render/opencachingcom/boat-required.png deleted file mode 100644 index b16d87369..000000000 Binary files a/src/plugins/render/opencachingcom/boat-required.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/chirp.png b/src/plugins/render/opencachingcom/chirp.png deleted file mode 100644 index 90d8c9ade..000000000 Binary files a/src/plugins/render/opencachingcom/chirp.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/diving.png b/src/plugins/render/opencachingcom/diving.png deleted file mode 100644 index 63c103e25..000000000 Binary files a/src/plugins/render/opencachingcom/diving.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/exclusive.png b/src/plugins/render/opencachingcom/exclusive.png deleted file mode 100644 index f8f8e1527..000000000 Binary files a/src/plugins/render/opencachingcom/exclusive.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/historic-site.png b/src/plugins/render/opencachingcom/historic-site.png deleted file mode 100644 index 11ecddb59..000000000 Binary files a/src/plugins/render/opencachingcom/historic-site.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/internet.png b/src/plugins/render/opencachingcom/internet.png deleted file mode 100644 index a9a9d2e97..000000000 Binary files a/src/plugins/render/opencachingcom/internet.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/letterbox.png b/src/plugins/render/opencachingcom/letterbox.png deleted file mode 100644 index d724a520c..000000000 Binary files a/src/plugins/render/opencachingcom/letterbox.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/multi-cache-m.png b/src/plugins/render/opencachingcom/multi-cache-m.png deleted file mode 100644 index 36ddf2cf0..000000000 Binary files a/src/plugins/render/opencachingcom/multi-cache-m.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/multi-cache.png b/src/plugins/render/opencachingcom/multi-cache.png deleted file mode 100644 index 5e2386bd7..000000000 Binary files a/src/plugins/render/opencachingcom/multi-cache.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/night.png b/src/plugins/render/opencachingcom/night.png deleted file mode 100644 index 0c29c5bb2..000000000 Binary files a/src/plugins/render/opencachingcom/night.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/occlogo.png b/src/plugins/render/opencachingcom/occlogo.png deleted file mode 100644 index f911570ea..000000000 Binary files a/src/plugins/render/opencachingcom/occlogo.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/opencachingcom.qrc b/src/plugins/render/opencachingcom/opencachingcom.qrc deleted file mode 100644 index e64236cc2..000000000 --- a/src/plugins/render/opencachingcom/opencachingcom.qrc +++ /dev/null @@ -1,26 +0,0 @@ - - - traditional.png - traditional-m.png - multi-cache.png - multi-cache-m.png - puzzle.png - puzzle-m.png - virtual.png - virtual-m.png - unknown.png - unknown-m.png - boat-required.png - chirp.png - diving.png - exclusive.png - historic-site.png - letterbox.png - night.png - tree-climbing.png - uv-light.png - verifiable.png - occlogo.png - internet.png - - \ No newline at end of file diff --git a/src/plugins/render/opencachingcom/puzzle-m.png b/src/plugins/render/opencachingcom/puzzle-m.png deleted file mode 100644 index dff90d005..000000000 Binary files a/src/plugins/render/opencachingcom/puzzle-m.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/puzzle.png b/src/plugins/render/opencachingcom/puzzle.png deleted file mode 100644 index 66c764d21..000000000 Binary files a/src/plugins/render/opencachingcom/puzzle.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/traditional-m.png b/src/plugins/render/opencachingcom/traditional-m.png deleted file mode 100644 index a571dcc6c..000000000 Binary files a/src/plugins/render/opencachingcom/traditional-m.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/traditional.png b/src/plugins/render/opencachingcom/traditional.png deleted file mode 100644 index b30476281..000000000 Binary files a/src/plugins/render/opencachingcom/traditional.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/tree-climbing.png b/src/plugins/render/opencachingcom/tree-climbing.png deleted file mode 100644 index e1638d1e5..000000000 Binary files a/src/plugins/render/opencachingcom/tree-climbing.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/unknown-m.png b/src/plugins/render/opencachingcom/unknown-m.png deleted file mode 100644 index 98c8e4b26..000000000 Binary files a/src/plugins/render/opencachingcom/unknown-m.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/unknown.png b/src/plugins/render/opencachingcom/unknown.png deleted file mode 100644 index b023b29cd..000000000 Binary files a/src/plugins/render/opencachingcom/unknown.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/uv-light.png b/src/plugins/render/opencachingcom/uv-light.png deleted file mode 100644 index 4accac995..000000000 Binary files a/src/plugins/render/opencachingcom/uv-light.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/verifiable.png b/src/plugins/render/opencachingcom/verifiable.png deleted file mode 100644 index 503db6ee7..000000000 Binary files a/src/plugins/render/opencachingcom/verifiable.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/virtual-m.png b/src/plugins/render/opencachingcom/virtual-m.png deleted file mode 100644 index 642f98080..000000000 Binary files a/src/plugins/render/opencachingcom/virtual-m.png and /dev/null differ diff --git a/src/plugins/render/opencachingcom/virtual.png b/src/plugins/render/opencachingcom/virtual.png deleted file mode 100644 index 048fe2971..000000000 Binary files a/src/plugins/render/opencachingcom/virtual.png and /dev/null differ