[-]
[+]
|
Changed |
marble.spec
|
|
[-]
[+]
|
Deleted |
marble-1.12.20_sfos_151125.tar.xz/src/lib/marble/MarbleControlBox.cpp
^
|
@@ -1,256 +0,0 @@
-/* This file is part of the KDE project
- *
- * Copyright 2004-2007 Torsten Rahn <tackat@kde.org>
- * Copyright 2007 Inge Wallin <ingwa@kde.org>
- * Copyright 2007 Thomas Zander <zander@kde.org>
- * Copyright 2010 Bastian Holst <bastianholst@gmx.de>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-// Self
-#include "MarbleControlBox.h"
-
-// Tabs
-#include "CurrentLocationWidget.h"
-#include "NavigationWidget.h"
-#include "FileViewWidget.h"
-#include "LegendWidget.h"
-#include "MapViewWidget.h"
-#include "RoutingWidget.h"
-
-// Marble
-#include "MapThemeManager.h"
-#include "MarbleGlobal.h"
-#include "MarbleWidget.h"
-#include "MarbleModel.h"
-#include "GeoSceneDocument.h"
-#include "GeoSceneHead.h"
-#include "MarbleDebug.h"
-
-
-namespace Marble
-{
-
-class MarbleControlBoxPrivate
-{
- public:
- MarbleControlBoxPrivate();
-
- MapThemeManager m_mapThemeManager;
-
- MarbleWidget *m_widget;
-
- NavigationWidget *m_navigationWidget;
- LegendWidget *m_legendWidget;
- MapViewWidget *m_mapViewWidget;
-
- CurrentLocationWidget *m_currentLocationWidget;
-
- FileViewWidget *m_fileViewWidget;
-
- RoutingWidget *m_routingWidget;
-};
-
-MarbleControlBoxPrivate::MarbleControlBoxPrivate()
- : m_widget( 0 ),
- m_navigationWidget( 0 ),
- m_legendWidget( 0 ),
- m_mapViewWidget( 0 ),
- m_currentLocationWidget( 0 ),
- m_fileViewWidget( 0 ),
- m_routingWidget( 0 )
-{
-}
-
-// ================================================================
-
-
-MarbleControlBox::MarbleControlBox(QWidget *parent)
- : QToolBox( parent ),
- d( new MarbleControlBoxPrivate )
-{
- d->m_widget = 0;
-
- setFocusPolicy( Qt::NoFocus );
-// setFocusProxy( d->uiWidget.searchLineEdit );
-
- // Iterate through all of the Side Widget values //
- d->m_navigationWidget = new NavigationWidget( this );
- addItem( d->m_navigationWidget, d->m_navigationWidget->windowTitle() );
-
- d->m_legendWidget = new LegendWidget( this );
- addItem( d->m_legendWidget, d->m_legendWidget->windowTitle() );
-
- d->m_mapViewWidget = new MapViewWidget( this );
- addItem( d->m_mapViewWidget, d->m_mapViewWidget->windowTitle() );
-
- d->m_fileViewWidget = new FileViewWidget( this );
- addItem( d->m_fileViewWidget, d->m_fileViewWidget->windowTitle() );
-
- d->m_currentLocationWidget = new CurrentLocationWidget( this );
-
- addItem( d->m_currentLocationWidget, d->m_currentLocationWidget->windowTitle() );
-
- setCurrentIndex(0);
-
- //default
- setCurrentLocationTabShown( true );
- setFileViewTabShown( false );
-
- connect( d->m_mapViewWidget, SIGNAL(showMapWizard()), this, SIGNAL(showMapWizard()) );
- connect( d->m_mapViewWidget, SIGNAL(showUploadDialog()), this, SIGNAL(showUploadDialog()) );
- connect( d->m_mapViewWidget, SIGNAL(celestialBodyChanged(QString)),
- d->m_navigationWidget, SLOT(clearSearch()) );
- connect( d->m_navigationWidget, SIGNAL(searchFinished()), this, SIGNAL(searchFinished()) );
-}
-
-MarbleControlBox::~MarbleControlBox()
-{
- delete d;
-}
-
-void MarbleControlBox::setMarbleWidget(MarbleWidget *widget)
-{
- d->m_widget = widget;
-
- bool const smallScreen = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen;
- if ( !smallScreen ) {
- d->m_routingWidget = new RoutingWidget( widget, this );
- addItem( d->m_routingWidget, tr( "Routing" ) );
- }
-
- d->m_fileViewWidget->setMarbleWidget( widget );
- d->m_legendWidget->setMarbleModel( widget->model() );
- d->m_navigationWidget->setMarbleWidget( widget );
- d->m_mapViewWidget->setMarbleWidget( widget, &d->m_mapThemeManager );
- d->m_currentLocationWidget->setMarbleWidget( widget );
-
- connect( d->m_legendWidget, SIGNAL(propertyValueChanged(QString,bool)),
- widget, SLOT(setPropertyValue(QString,bool)) );
-
- connect( d->m_widget, SIGNAL(themeChanged(QString)),
- this, SLOT(selectTheme(QString)) );
-}
-
-void MarbleControlBox::setWidgetTabShown( QWidget * widget,
- int insertIndex, bool show,
- QString &text )
-{
- int index = indexOf( widget );
-
- if( show ) {
- if ( !(index >= 0) ){
- if ( insertIndex < count() ) {
- insertItem( insertIndex, widget, text );
- } else {
- insertItem( 3 ,widget, text );
- }
- widget->show();
- }
- } else {
- if ( index >= 0 ) {
- widget->hide();
- removeItem( index );
- }
- }
-}
-
-void MarbleControlBox::setNavigationTabShown( bool show )
-{
- QString title = tr( "Navigation" );
- setWidgetTabShown( d->m_navigationWidget, 0, show, title);
-}
-
-void MarbleControlBox::setLegendTabShown( bool show )
-{
- QString title = tr( "Legend" );
- setWidgetTabShown( d->m_legendWidget, 1, show, title );
-}
-
-void MarbleControlBox::setMapViewTabShown( bool show )
-{
- QString title = tr( "Map View" );
- setWidgetTabShown( d->m_mapViewWidget, 2, show, title );
-}
-
-void MarbleControlBox::setFileViewTabShown( bool show )
-{
- QString title = tr( "File View" );
- setWidgetTabShown( d->m_fileViewWidget, 3, show, title );
-}
-
-void MarbleControlBox::setCurrentLocationTabShown( bool show )
-{
- QString title = tr( "Current Location" );
- setWidgetTabShown( d->m_currentLocationWidget, 4, show, title );
|
[-]
[+]
|
Deleted |
marble-1.12.20_sfos_151125.tar.xz/src/lib/marble/MarbleControlBox.h
^
|
@@ -1,158 +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 2004-2007 Torsten Rahn <tackat@kde.org>
-// Copyright 2007 Inge Wallin <ingwa@kde.org>
-// Copyright 2007 Thomas Zander <zander@kde.org>
-//
-
-#ifndef MARBLE_MARBLECONTROLBOX_H
-#define MARBLE_MARBLECONTROLBOX_H
-
-
-#include "marble_export.h"
-
-#include <QToolBox>
-
-#include "MarbleGlobal.h"
-
-
-/** @file
- * This file contains the header for MarbleControlBox.
- *
- * @author Torsten Rahn <tackat@kde.org>
- * @author Inge Wallin <inge@lysator.liu.se>
- */
-
-class QResizeEvent;
-class QString;
-class QStandardItemModel;
-
-namespace Marble
-{
-
-class MarbleWidget;
-class MarbleControlBoxPrivate;
-class AutoNavigation;
-class CurrentLocationWidget;
-
-/**
- * @short A widget class that contains advanced controls for a
- * MarbleWidget.
- *
- * This widget lets the user control an instance of MarbleWidget. The
- * widget contains a ToolBox with 3 pages: a <b>Navigation</b> page
- * with a search tool for cities and other names, a <b>Legend</b> page
- * with a legend for the symbols on the map, and a <b>Map View</b>
- * page with a choice of themes / datasets.
- *
- * The <b>Navigation</b> page lets the user navigate around the globe by
- * using buttons for panning and a slider for zooming. There is also
- * a "Home" button that lets the user go back to a predefined point at
- * the earth, not unlike the home page in a web browser. In addition
- * there is a search tool that lets the user search for names of
- * points of interest (cities, mountains, glaciers, etc).
- *
- * The <b>Legend</b> page does not contain any controls, but displays
- * a legend of the symbols that are displayed on the globe.
- *
- * The <b>Map View</b> page gives the user a choice of different
- * datasets to display, which can also be thought of as different
- * visual themes. The default datasets are a standard Atlas view, a
- * Night view, and a Satellite view.
- *
- * @see MarbleWidget
- * @see MarbleNavigator
- */
-
-class MARBLE_EXPORT MarbleControlBox : public QToolBox
-{
- Q_OBJECT
-
- public:
- /**
- * @brief Construct a new MarbleControlBox
- * @param parent the parent widget
- */
- explicit MarbleControlBox( QWidget *parent = 0 );
- ~MarbleControlBox();
-
- /**
- * @brief Set the MarbleWidget to be controlled by this widget.
- * @param widget the MarbleWidget to be controlled.
- *
- * Sets a MarbleWidget so that it will be controlled by this
- * widget. This call create all the connections of signals and
- * slots that are necessary to have full control of the
- * MarbleWidget, and thereby frees the programmer from doing it.
- */
- void setMarbleWidget( MarbleWidget *widget );
-
- /**
- * Toggle offline mode of download manager and runners.
- */
- void setWorkOffline(bool offline);
-
- /** Provides access to the current location widget for session restoring */
- CurrentLocationWidget * currentLocationWidget();
-
- /**
- * Brings the navigation tab to the front and initiates a search for the given term
- */
- void search( const QString &searchTerm, SearchMode searchMode );
-
- public Q_SLOTS:
- void selectTheme( const QString & );
-
- /**
- * @brief Control whether the Navigation tab is shown.
- * @param show boolean that controls if the Navigation tab is shown.
- */
- void setNavigationTabShown( bool show );
- /**
- * @brief Control whether the Legend tab is shown.
- * @param show boolean that controls if the Legend tab is shown.
- */
- void setLegendTabShown( bool show );
- /**
- * @brief Control whether the Map View tab is shown.
- * @param show boolean that controls if the Map View tab is shown.
- */
- void setMapViewTabShown( bool show );
- /**
- * @brief Control whether the Current Location tab is shown.
- * @param show boolean that controls if the Current Location tab is shown.
- */
- void setCurrentLocationTabShown( bool show );
- /**
- * @brief Control whether the File View tab is shown.
- * @param show boolean that controls if the File View tab is shown.
- */
- void setFileViewTabShown( bool show );
-
- /**
- * @brief Control whether the Routing tab is shown.
- * @param show boolean that controls if the Routing tab is shown.
- */
- void setRoutingTabShown( bool show );
-
-Q_SIGNALS:
- void showMapWizard();
- void showUploadDialog();
- void searchFinished();
-
- private:
- void setWidgetTabShown( QWidget * widget, int insertIndex,
- bool show, QString &text );
-
- Q_DISABLE_COPY( MarbleControlBox )
- MarbleControlBoxPrivate * const d;
-};
-
-}
-
-#endif
|
[-]
[+]
|
Deleted |
marble-1.12.20_sfos_151125.tar.xz/src/lib/marble/NavigationWidget.cpp
^
|
@@ -1,335 +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 2004-2007 Torsten Rahn <tackat@kde.org>
-// Copyright 2007 Inge Wallin <ingwa@kde.org>
-// Copyright 2007 Thomas Zander <zander@kde.org>
-// Copyright 2010 Bastian Holst <bastianholst@gmx.de>
-//
-
-// Self
-#include "NavigationWidget.h"
-
-// Marble
-#include "MarbleDebug.h"
-#include "MarbleModel.h"
-#include "MarbleWidget.h"
-#include "MarblePlacemarkModel.h"
-#include "BranchFilterProxyModel.h"
-#include "GeoDataDocument.h"
-#include "GeoDataTreeModel.h"
-#include "GeoSceneDocument.h"
-#include "GeoSceneHead.h"
-#include "SearchRunnerManager.h"
-#include "ViewportParams.h"
-
-// Qt
-#include <QTime>
-#include <QTimer>
-#include <QSortFilterProxyModel>
-
-using namespace Marble;
-
-#include "ui_NavigationWidget.h"
-
-namespace Marble
-{
-
-class NavigationWidgetPrivate
-{
- public:
- NavigationWidgetPrivate();
-
- void updateButtons( int );
-
- void mapCenterOnSignal( const QModelIndex & );
-
- void adjustForAnimation();
- void adjustForStill();
-
- /**
- * @brief Set a list/set of placemark names for the search widget.
- * @param locations the QAbstractitemModel containing the placemarks
- *
- * This function is called to display a potentially large number
- * of placemark names in a widget and let the user search between
- * them.
- * @see centerOn
- */
- void setSearchResult( QVector<GeoDataPlacemark*> locations );
-
- Ui::NavigationWidget m_navigationUi;
- MarbleWidget *m_widget;
- BranchFilterProxyModel m_branchfilter;
- QSortFilterProxyModel *m_sortproxy;
- QString m_searchTerm;
- SearchRunnerManager *m_runnerManager;
- GeoDataDocument *m_document;
-};
-
-NavigationWidgetPrivate::NavigationWidgetPrivate()
- : m_widget( 0 ), m_sortproxy( 0 ), m_runnerManager( 0 ),
- m_document( new GeoDataDocument ) {
- m_document->setDocumentRole( SearchResultDocument );
- m_document->setName( "Search Results" );
-}
-
-
-NavigationWidget::NavigationWidget( QWidget *parent, Qt::WindowFlags f )
- : QWidget( parent, f ),
- d( new NavigationWidgetPrivate() )
-{
- d->m_searchTerm.clear();
- d->m_widget = 0;
-
- d->m_navigationUi.setupUi( this );
- d->m_navigationUi.m_splitter->setStretchFactor( 0, 1 );
- d->m_navigationUi.m_splitter->setStretchFactor( 1, 2 );
- d->m_navigationUi.locationListView->setVisible( false );
-
- d->m_sortproxy = new QSortFilterProxyModel( this );
- d->m_navigationUi.locationListView->setModel( d->m_sortproxy );
- connect( d->m_navigationUi.goHomeButton, SIGNAL(clicked()),
- this, SIGNAL(goHome()) );
- connect( d->m_navigationUi.zoomSlider, SIGNAL(valueChanged(int)),
- this, SIGNAL(zoomChanged(int)) );
- connect( d->m_navigationUi.zoomInButton, SIGNAL(clicked()),
- this, SIGNAL(zoomIn()) );
- connect( d->m_navigationUi.zoomOutButton, SIGNAL(clicked()),
- this, SIGNAL(zoomOut()) );
-
- connect( d->m_navigationUi.zoomSlider, SIGNAL(valueChanged(int)),
- this, SLOT(updateButtons(int)) );
-
- connect( d->m_navigationUi.moveLeftButton, SIGNAL(clicked()),
- this, SIGNAL(moveLeft()) );
- connect( d->m_navigationUi.moveRightButton, SIGNAL(clicked()),
- this, SIGNAL(moveRight()) );
- connect( d->m_navigationUi.moveUpButton, SIGNAL(clicked()),
- this, SIGNAL(moveUp()) );
- connect( d->m_navigationUi.moveDownButton, SIGNAL(clicked()),
- this, SIGNAL(moveDown()) );
-
- connect( d->m_navigationUi.locationListView, SIGNAL(activated(QModelIndex)),
- this, SLOT(mapCenterOnSignal(QModelIndex)) );
-
- connect( d->m_navigationUi.zoomSlider, SIGNAL(sliderPressed()),
- this, SLOT(adjustForAnimation()) );
- connect( d->m_navigationUi.zoomSlider, SIGNAL(sliderReleased()),
- this, SLOT(adjustForStill()) );
-}
-
-NavigationWidget::~NavigationWidget()
-{
- delete d;
-}
-
-void NavigationWidget::setMarbleWidget( MarbleWidget *widget )
-{
- GeoDataTreeModel *treeModel;
-
- d->m_runnerManager = new SearchRunnerManager( widget->model(), this );
- connect( d->m_runnerManager, SIGNAL(searchResultChanged(QVector<GeoDataPlacemark*>)),
- this, SLOT(setSearchResult(QVector<GeoDataPlacemark*>)) );
- connect( d->m_runnerManager, SIGNAL(searchFinished(QString)), this, SIGNAL(searchFinished()) );
-
- d->m_widget = widget;
- treeModel = d->m_widget->model()->treeModel();
- treeModel->addDocument( d->m_document );
-
- d->m_branchfilter.setSourceModel( treeModel );
- d->m_branchfilter.setBranchIndex( treeModel, treeModel->index( d->m_document ) );
- d->m_sortproxy->setSortRole( MarblePlacemarkModel::PopularityIndexRole );
- d->m_sortproxy->sort( 0, Qt::AscendingOrder );
- d->m_sortproxy->setDynamicSortFilter( true );
- d->m_sortproxy->setSourceModel( &d->m_branchfilter );
- d->m_navigationUi.locationListView->setRootIndex(
- d->m_sortproxy->mapFromSource(
- d->m_branchfilter.mapFromSource( treeModel->index( d->m_document ) ) ) );
-
- // Connect necessary signals.
- connect( this, SIGNAL(goHome()), d->m_widget, SLOT(goHome()) );
- connect( this, SIGNAL(zoomChanged(int)), d->m_widget, SLOT(setZoom(int)) );
- connect( this, SIGNAL(zoomIn()), d->m_widget, SLOT(zoomIn()) );
- connect( this, SIGNAL(zoomOut()), d->m_widget, SLOT(zoomOut()) );
-
- connect( this, SIGNAL(moveLeft()), d->m_widget, SLOT(moveLeft()) );
- connect( this, SIGNAL(moveRight()), d->m_widget, SLOT(moveRight()) );
- connect( this, SIGNAL(moveUp()), d->m_widget, SLOT(moveUp()) );
- connect( this, SIGNAL(moveDown()), d->m_widget, SLOT(moveDown()) );
-
- connect( d->m_widget, SIGNAL(zoomChanged(int)),
- this, SLOT(changeZoom(int)) );
-
- connect( d->m_widget, SIGNAL(themeChanged(QString)),
- this, SLOT(selectTheme(QString)) );
-}
-
-void NavigationWidget::search(const QString &searchTerm, SearchMode searchMode )
-{
- d->m_searchTerm = searchTerm;
-
- if( searchTerm.isEmpty() ) {
- clearSearch();
- } else {
- d->m_navigationUi.locationListView->setVisible( true );
- if ( searchMode == AreaSearch ) {
- d->m_runnerManager->findPlacemarks( d->m_searchTerm, d->m_widget->viewport()->viewLatLonAltBox() );
- } else {
- d->m_runnerManager->findPlacemarks( d->m_searchTerm );
- }
- }
-}
-
-void NavigationWidget::changeZoom( int zoom )
-{
- // There exists a circular signal/slot connection between MarbleWidget and this widget's
- // zoom slider. MarbleWidget prevents recursion, but it still loops one time unless
- // blocked here. Note that it would be possible to only connect the sliders
- // sliderMoved signal instead of its valueChanged signal above to break up the loop.
- // This however means that the slider cannot be operated with the mouse wheel, as this
- // does not emit the sliderMoved signal for some reason. Therefore the signal is blocked
- // below before calling setValue on the slider to avoid that it calls back to MarbleWidget,
- // and then un-blocked again to make user interaction possible.
-
- d->m_navigationUi.zoomSlider->blockSignals( true );
|
[-]
[+]
|
Deleted |
marble-1.12.20_sfos_151125.tar.xz/src/lib/marble/NavigationWidget.h
^
|
@@ -1,132 +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 2004-2007 Torsten Rahn <tackat@kde.org>
-// Copyright 2007 Inge Wallin <ingwa@kde.org>
-// Copyright 2007 Thomas Zander <zander@kde.org>
-// Copyright 2010 Bastian Holst <bastianholst@gmx.de>
-//
-
-#ifndef MARBLE_NAVIGATIONWIDGET_H
-#define MARBLE_NAVIGATIONWIDGET_H
-
-// Marble
-#include "marble_export.h"
-#include "MarbleGlobal.h"
-
-// Qt
-#include <QWidget>
-
-class QModelIndex;
-class QAbstractItemModel;
-
-namespace Marble
-{
-
-class NavigationWidgetPrivate;
-
-class MarbleWidget;
-class GeoDataPlacemark;
-
-class MARBLE_EXPORT NavigationWidget : public QWidget
-{
- Q_OBJECT
-
- public:
- explicit NavigationWidget( QWidget *parent = 0, Qt::WindowFlags f = 0 );
- ~NavigationWidget();
-
- /**
- * @brief Set a MarbleWidget associated to this widget.
- * @param widget the MarbleWidget to be set.
- */
- void setMarbleWidget( MarbleWidget *widget );
-
- void search( const QString &searchTerm, SearchMode searchMode );
-
- Q_SIGNALS:
- /**
- * @brief Signal emitted when the Home button has been pressed.
- */
- void goHome();
- /**
- * @brief Signal emitted when the Zoom In button has been pressed.
- */
- void zoomIn();
- /**
- * @brief Signal emitted when the Zoom Out button has been pressed.
- */
- void zoomOut();
- /**
- * @brief Signal emitted when the zoom slider has been moved.
- * @param zoom The new zoom value.
- */
- void zoomChanged( int zoom );
-
- /**
- * @brief Signal emitted when the Move Left button has been pressed.
- */
- void moveLeft();
- /**
- * @brief Signal emitted when the Move Right button has been pressed.
- */
- void moveRight();
- /**
- * @brief Signal emitted when the Move Up button has been pressed.
- */
- void moveUp();
- /**
- * @brief Signal emitted when the Move Down button has been pressed.
- */
- void moveDown();
-
- void searchFinished();
-
- public Q_SLOTS:
- void selectTheme( const QString & );
-
- /**
- * @brief Sets the value of the slider.
- * @param zoom The new zoom value.
- *
- * This slot should be called when the zoom value is changed from
- * the widget itself, e.g. by using the scroll wheel. It sets the
- * value of the slider, but nothing more. In particular it
- * doesn't emit the zoomChanged signal.
- */
- void changeZoom( int zoom );
-
- /**
- * @brief Clear all previous search results
- */
- void clearSearch();
-
- protected:
- /**
- * @brief Reimplementation of the resizeEvent() of the widget.
- *
- * If the MarbleControlBox gets shrunk enough, the slider in the
- * Navigation tab will be hidden, leaving only the Zoom Up and
- * Zoom Down buttons.
- */
- void resizeEvent( QResizeEvent * );
-
- private:
- Q_PRIVATE_SLOT( d, void updateButtons( int ) )
- Q_PRIVATE_SLOT( d, void mapCenterOnSignal( const QModelIndex & ) )
- Q_PRIVATE_SLOT( d, void adjustForAnimation() )
- Q_PRIVATE_SLOT( d, void adjustForStill() )
- Q_PRIVATE_SLOT( d, void setSearchResult( QVector<GeoDataPlacemark*> locations ) )
-
- Q_DISABLE_COPY( NavigationWidget )
-
- NavigationWidgetPrivate * const d;
-};
-
-}
-
-#endif
|
[-]
[+]
|
Deleted |
marble-1.12.20_sfos_151125.tar.xz/src/lib/marble/NavigationWidget.ui
^
|
@@ -1,325 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>NavigationWidget</class>
- <widget class="QWidget" name="NavigationWidget">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>137</width>
- <height>446</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Navigation</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QSplitter" name="m_splitter">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <widget class="QWidget" name="verticalLayoutWidget">
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QListView" name="locationListView">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>75</height>
- </size>
- </property>
- <property name="focusPolicy">
- <enum>Qt::WheelFocus</enum>
- </property>
- <property name="toolTip">
- <string>Location Browser</string>
- </property>
- <property name="whatsThis">
- <string>Double click an entry of this list to get it displayed on the map.</string>
- </property>
- <property name="horizontalScrollBarPolicy">
- <enum>Qt::ScrollBarAlwaysOff</enum>
- </property>
- <property name="editTriggers">
- <set>QAbstractItemView::NoEditTriggers</set>
- </property>
- <property name="alternatingRowColors">
- <bool>false</bool>
- </property>
- <property name="iconSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- <property name="layoutMode">
- <enum>QListView::Batched</enum>
- </property>
- <property name="viewMode">
- <enum>QListView::ListMode</enum>
- </property>
- <property name="uniformItemSizes">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="layoutWidget">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::MinimumExpanding</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>5</width>
- <height>5</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QGridLayout" name="_3">
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="5" column="1">
- <widget class="QToolButton" name="zoomOutButton">
- <property name="toolTip">
- <string>Zoom Out</string>
- </property>
- <property name="whatsThis">
- <string>Zoom out by pressing this button to see less detail.</string>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="icon">
- <iconset resource="../marble.qrc">
- <normaloff>:/icons/zoom-out.png</normaloff>:/icons/zoom-out.png</iconset>
- </property>
- <property name="shortcut">
- <string>-</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QToolButton" name="goHomeButton">
- <property name="toolTip">
- <string>Navigate to your 'Home Location'</string>
- </property>
- <property name="whatsThis">
- <string>Click this button to restore the original zoom level and view angle.</string>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="icon">
- <iconset resource="../marble.qrc">
- <normaloff>:/icons/go-home.png</normaloff>:/icons/go-home.png</iconset>
- </property>
- <property name="shortcut">
- <string>Home</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QToolButton" name="moveRightButton">
- <property name="toolTip">
- <string>Right</string>
- </property>
- <property name="whatsThis">
- <string>Rotates the globe clockwise around its axis.</string>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="icon">
- <iconset resource="../marble.qrc">
- <normaloff>:/icons/arrow-right.png</normaloff>:/icons/arrow-right.png</iconset>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QToolButton" name="moveUpButton">
- <property name="toolTip">
- <string>Up</string>
- </property>
- <property name="whatsThis">
- <string>Tilts the globe's axis towards the user.</string>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="icon">
- <iconset resource="../marble.qrc">
- <normaloff>:/icons/arrow-up.png</normaloff>:/icons/arrow-up.png</iconset>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="QSlider" name="zoomSlider">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="MinimumExpanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip">
- <string>Zoom Slider</string>
- </property>
- <property name="whatsThis">
- <string>Use this slider to adjust the zoom level of the map.</string>
- </property>
- <property name="minimum">
- <number>900</number>
- </property>
- <property name="maximum">
- <number>2400</number>
- </property>
- <property name="value">
- <number>1050</number>
- </property>
- <property name="sliderPosition">
- <number>1050</number>
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/.arcconfig
^
|
@@ -0,0 +1,4 @@
+{
+ "phabricator.uri" : "https://phabricator.kde.org/",
+ "project.name" : "Marble"
+}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/CMakeLists.txt
^
|
@@ -170,17 +170,17 @@
set(plugin_dir "${CMAKE_INSTALL_PREFIX}/assets/plugins")
set(data_dir "${CMAKE_INSTALL_PREFIX}/assets/data")
else() # Linux / bsd etc...
- set(data_dir ${CMAKE_INSTALL_PREFIX}/share/marble/data)
+ set(data_dir ${CMAKE_INSTALL_FULL_DATAROOTDIR}/marble/data)
set(plugin_dir ${CMAKE_INSTALL_FULL_LIBDIR}/marble/plugins)
- set(CMAKE_MODULES_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/marble/cmake)
+ set(CMAKE_MODULES_INSTALL_PATH ${CMAKE_INSTALL_FULL_DATAROOTDIR}/marble/cmake)
endif()
if(NOT ICON_INSTALL_DIR)
- set(ICON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/icons)
+ set(ICON_INSTALL_DIR ${CMAKE_INSTALL_FULL_DATAROOTDIR}/icons)
endif(NOT ICON_INSTALL_DIR)
if(NOT APPS_INSTALL_DIR)
- set(APPS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications)
+ set(APPS_INSTALL_DIR ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications)
endif(NOT APPS_INSTALL_DIR)
if (NOT MARBLE_DATA_PATH)
@@ -298,7 +298,7 @@
####################################################
# Install extra files
install(FILES LICENSE.txt DESTINATION ${MARBLE_DATA_INSTALL_PATH})
-install(FILES marble.appdata.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/appdata/)
+install(FILES marble.appdata.xml DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/appdata/)
####################################################
# Install CMake module
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/CODING
^
|
@@ -111,28 +111,6 @@
The Marble coding style has a couple of exceptions to the foundation.
-Spaces and Parenthesis
-- - - - - - - - - - -
-
-Due to historic reasons, the coding style of Marble has one
-exception to the kdelibs style. That exception is that we use the Qt
-way of using parenthesis, with a space inside both opening and closing
-parenthesis. For example
-
-Correct:
-
- if ( width > 100 ) {
- setHeight( 200 );
- }
-
-
-Wrong:
-
- if (width > 100) {
- setHeight(200);
- }
-
-
Braces After Multi-line Expressions
- - - - - - - - - - - - - - - - - -
@@ -142,8 +120,8 @@
Correct:
- if ( very_long_sub_expression
- && another_very_long_sub_expression )
+ if (very_long_sub_expression
+ && another_very_long_sub_expression)
{
doSomething();
doSomethingElse();
@@ -151,8 +129,8 @@
Wrong:
- if ( very_long_sub_expression
- && another_very_long_sub_expression ) {
+ if (very_long_sub_expression
+ && another_very_long_sub_expression) {
doSomething();
doSomethingElse();
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/data/maps/earth/srtm/srtm.dgml
^
|
@@ -63,12 +63,10 @@
</geodata>
<geodata name="lake" property="waterbodies" colorize="sea">
<sourcefile> naturalearth/ne_50m_lakes.pn2 </sourcefile>
- <brush color="f00e0eff" />
<pen color="transparent" style="nopen"/>
</geodata>
<geodata name="glacier" property="ice" colorize="sea">
<sourcefile> naturalearth/ne_50m_glaciated_areas.pn2 </sourcefile>
- <brush color="ffffffff" />
<pen color="transparent" style="nopen"/>
</geodata>
</layer>
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/data/maps/earth/srtm2/srtm2.dgml
^
|
@@ -36,7 +36,6 @@
<texture name="srtm2_data"><!-- type="texture"-->
<sourcedir format="PNG"> earth/srtm2 </sourcedir>
<storageLayout maximumTileLevel="9"/>
- <downloadUrl protocol="https" host="files.kde.org" path="marble/" />
<downloadPolicy usage="Browse" maximumConnections="20" />
<downloadPolicy usage="Bulk" maximumConnections="2" />
</texture>
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/data/maps/earth/vectorosm/0/0/0.o5m
^
|
@@ -0,0 +1,2 @@
+ÿào5m2Üì®ÐÞ
+þ
\ No newline at end of file
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/data/maps/earth/vectorosm/vectorosm.dgml
^
|
@@ -52,7 +52,7 @@
</layer>
<layer name="vectorosm" backend="vectortile" >
<vectortile name="geojson_data" expire="604800" >
- <sourcedir format="OSM.ZIP"> earth/vectorosm </sourcedir>
+ <sourcedir format="O5M"> earth/vectorosm </sourcedir>
<tileSize width="256" height="256" />
<storageLayout levelZeroColumns="1" levelZeroRows="1" tileLevels="13,15,17" mode="OpenStreetMap" />
<projection name="Mercator" />
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/data/mimetypes/geo.xml
^
|
@@ -8,6 +8,7 @@
<mime-type type="application/x-gpx+xml">
<!-- prevent txt/plain thumbnailer <sub-class-of type="application/xml"/> -->
<comment>GPX geographic data</comment>
+ <comment xml:lang="ast">Datos xeográficos GPX</comment>
<comment xml:lang="bg">Географски данни GPX</comment>
<comment xml:lang="bs">GPX geografski podaci</comment>
<comment xml:lang="ca">Dades geogràfiques GPX</comment>
@@ -63,7 +64,7 @@
<mime-type type="application/x-osm+xml">
<!-- prevent txt/plain thumbnailer <sub-class-of type="application/xml"/> -->
<comment>OSM Data</comment>
- <comment xml:lang="ast">Datos OSM</comment>
+ <comment xml:lang="ast">Datos d'OSM</comment>
<comment xml:lang="bg">Данни OSM</comment>
<comment xml:lang="bs">OSM podaci</comment>
<comment xml:lang="ca">Dades OSM</comment>
@@ -116,6 +117,7 @@
<mime-type type="application/x-esri-shape">
<generic-icon name="application-vnd-google-earth-kml"/>
<comment>ESRI Shapefile</comment>
+ <comment xml:lang="ast">Ficheru de formes ESRI</comment>
<comment xml:lang="bg">Файл с форми ESRI</comment>
<comment xml:lang="bs">ESRI datoteka s likovima</comment>
<comment xml:lang="ca">Fitxers de formes ESRI</comment>
@@ -159,6 +161,7 @@
</mime-type>
<mime-type type="application/x-esri-shape-index">
<comment>ESRI Shapefile Index</comment>
+ <comment xml:lang="ast">Índiz de ficheros de formes ESRI</comment>
<comment xml:lang="bg">Индекс на файл с форми ESRI</comment>
<comment xml:lang="bs">ESRI indeks datoteka s likovima</comment>
<comment xml:lang="ca">Índex del fitxer de formes ESRI</comment>
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/CMakeLists.txt
^
|
@@ -2,7 +2,7 @@
# and change #include statements to use <marble/...> and "..." includes only
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/lib)
-set( MARBLE_EXAMPLES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/apps/marble/examples )
+set( MARBLE_EXAMPLES_INSTALL_DIR ${CMAKE_INSTALL_FULL_DATAROOTDIR}/apps/marble/examples )
add_subdirectory( hello-marble )
add_subdirectory( map-properties )
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/animation-video/CMakeLists.txt.external
^
|
@@ -2,12 +2,19 @@
SET (TARGET animation-video)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.6.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Core REQUIRED)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
FIND_PACKAGE (OpenCV REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES} ${OpenCV_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Core_INCLUDE_DIRS}
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+${OpenCV_INCLUDE_DIRS}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${OpenCV_LIBRARIES})
ADD_EXECUTABLE (${TARGET} main.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/basic-routing/CMakeLists.txt.external
^
|
@@ -2,11 +2,15 @@
SET (TARGET basic-routing)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.6.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Widgets_LIBRARIES})
ADD_EXECUTABLE (${TARGET} main.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/custom-layers/CMakeLists.txt.external
^
|
@@ -2,11 +2,17 @@
SET (TARGET custom-layers)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.6.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Core REQUIRED)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Core_INCLUDE_DIRS}
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES})
ADD_EXECUTABLE (${TARGET} main.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/geopainter/CMakeLists.txt.external
^
|
@@ -2,11 +2,15 @@
SET (TARGET geopainter)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.6.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Widgets_LIBRARIES})
ADD_EXECUTABLE (${TARGET} main.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/hello-marble/CMakeLists.txt.external
^
|
@@ -2,11 +2,15 @@
SET (TARGET hello-marble)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.6.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Widgets_LIBRARIES})
ADD_EXECUTABLE (${TARGET} main.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/kml-inspector/CMakeLists.txt.external
^
|
@@ -2,11 +2,17 @@
SET (TARGET kml-inspector)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.6.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Core REQUIRED)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Core_INCLUDE_DIRS}
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES})
ADD_EXECUTABLE (${TARGET} main.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/map-controls/CMakeLists.txt.external
^
|
@@ -2,11 +2,15 @@
SET (TARGET map-controls)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.6.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Widgets_LIBRARIES})
ADD_EXECUTABLE (${TARGET} main.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/map-properties/CMakeLists.txt.external
^
|
@@ -2,11 +2,15 @@
SET (TARGET map-properties)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.6.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Widgets_LIBRARIES})
ADD_EXECUTABLE (${TARGET} main.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/marble-game/CMakeLists.txt.external
^
|
@@ -2,15 +2,23 @@
SET (TARGET marble-game)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.6.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Core REQUIRED)
+FIND_PACKAGE (Qt5Gui REQUIRED)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Core_INCLUDE_DIRS}
+${Qt5Gui_INCLUDE_DIRS}
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Gui_Widgets} ${Qt5Widgets_LIBRARIES})
ADD_EXECUTABLE (
${TARGET}
- gamemain.cpp
+ gamemain.cpp
GameMainWindow.cpp
CountryByShape.cpp
CountryByFlag.cpp
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/marble-game/GameOptions.qml
^
|
@@ -35,11 +35,7 @@
id: gameOptionsPanel
objectName: "gameOptionsPanel"
- width: 200
- height: 600
-
color: "#d3d7cf"
-
state: "GAMES_VIEW_HIDDEN"
Column {
@@ -197,6 +193,7 @@
labelText: qsTr("OK")
labelSize: parent.width/8
+ enabled: slider.value > 0
onButtonClick: {
gamesView.setMaximumQuestionsCounts( slider.value );
gameOptionsPanel.state = "GAMES_VIEW_VISIBLE";
@@ -207,13 +204,13 @@
* number of questions he/she wants
* to attempt.
*/
- if ( gamesView.currentIndex == 0 && slider.value > 0 ) {
+ if ( gamesView.currentIndex == 0) {
countryByShapeGameRequested();
}
- if ( gamesView.currentIndex == 1 && slider.value > 0 ) {
+ if ( gamesView.currentIndex == 1) {
countryByFlagGameRequested();
}
- if ( gamesView.currentIndex == 2 && slider.value > 0 ) {
+ if ( gamesView.currentIndex == 2) {
clickOnThatGameRequested();
}
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/marble-game/Window.qml
^
|
@@ -10,11 +10,9 @@
import QtQuick 2.0
+import QtQuick.Controls 1.4
Rectangle {
- property real partition: 1/4
- property real spacingFraction: 1/10
-
property bool showInitialMenu: true
property bool showGameOptions: false
@@ -27,100 +25,39 @@
width: leftPanelWidth
height: leftPanelHeight
- state: "GAME_OPTIONS_HIDDEN"
+ StackView {
+ id: stackContainer
+ anchors.fill: parent
+ initialItem: buttonArea
+ }
- /*
- * Provides two initial options
- * "Browse Map" and "Play Game"
- */
- Rectangle {
+ InitialMenu {
id: buttonArea
objectName: "buttonArea"
- width: leftPanelWidth
- height: leftPanelHeight
- color: "#d3d7cf"
-
- anchors.centerIn:leftPanel
-
- visible: showInitialMenu
-
- Column {
- anchors.centerIn: buttonArea
- spacing: buttonArea.height*spacingFraction
-
- CustomButton {
- id: browseMapButton
- buttonWidth: leftPanel.width*4/5
- normalColor: "#114269"
- borderColor: "#000000"
- labelText: qsTr("Browse Map")
- labelColor: "white"
-
- onButtonClick: {
- browseMapButtonClicked();
- }
- }
-
- CustomButton {
- id: gameButton
- buttonWidth: leftPanel.width*4/5
- normalColor: "#114730"
- borderColor: "#000000"
- labelText: qsTr("Play Game")
- labelColor: "white"
-
- onButtonClick: {
- if ( leftPanel.state == "GAME_OPTIONS_HIDDEN" ) {
- leftPanel.state = "GAME_OPTIONS_VISIBLE"
- }
- }
- }
+
+ onGameMenuButtonClicked: {
+ stackContainer.push(gameOptions);
+ }
+ onBrowseButtonClicked: {
+ browseMapButtonClicked();
+ stackContainer.pop(gameOptions);
}
}
// This element contains the game menu
GameOptions {
- id: "gameOptions"
+ id: gameOptions
objectName: "gameOptions"
- gameOptionsPanelWidth: leftPanelWidth
- gameOptionsPanelHeight: leftPanelHeight
-
- anchors.centerIn: leftPanel
- visible: showGameOptions
onBackButtonClick: {
- if ( leftPanel.state == "GAME_OPTIONS_VISIBLE" ) {
- leftPanel.state = "GAME_OPTIONS_HIDDEN"
- }
+ stackContainer.pop(buttonArea);
}
}
- states: [
- /*
- * State when game menu is visible.
- * At this point we remove the two
- * initial options "Browse Map" and
- * "Play Game".
- */
- State {
- name: "GAME_OPTIONS_VISIBLE"
- PropertyChanges { target: gameOptions; width: leftPanelWidth; height: leftPanelHeight; visible: true }
- PropertyChanges { target: buttonArea; width:0; height: 0; visible: false }
- },
-
- /*
- * State hides the game menu and takes
- * the user to initial menu. It can be
- * achieved by clicking on "Main Menu"
- * button in game menu
- */
- State {
- name: "GAME_OPTIONS_HIDDEN"
- PropertyChanges { target: buttonArea; width: leftPanelWidth; height: leftPanelHeight; visible: true }
- PropertyChanges { target: gameOptions; width:0; height: 0; visible: false }
- }
- ]
-
+ Component.onCompleted: {
+ stackContainer.push(buttonArea);
+ }
+
transitions: [
Transition {
to: "*"
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/marble-game/marbleGame.qrc
^
|
@@ -8,6 +8,7 @@
<file>ClickOnThat.qml</file>
<file>CustomButton.qml</file>
<file>CustomRadioButton.qml</file>
+ <file>InitialMenu.qml</file>
<file>../../../data/flags/flag_cr.svg</file>
<file>../../../data/flags/flag_id.svg</file>
<file>../../../data/flags/flag_ms.svg</file>
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/marbleQuick2/CMakeLists.txt.external
^
|
@@ -2,13 +2,19 @@
SET (TARGET marbleQuick)
PROJECT (${TARGET})
-find_package(Qt5Widgets REQUIRED)
-find_package(Qt5Quick REQUIRED)
-
+FIND_PACKAGE(Qt5Core REQUIRED)
+FIND_PACKAGE(Qt5Widgets REQUIRED)
+FIND_PACKAGE(Qt5Quick REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${MARBLE_INCLUDE_DIR}
+${Qt5Core_INCLUDE_DIRS}
+${Qt5Widgets_INCLUDE_DIRS}
+${Qt5Quick_INCLUDE_DIRS}
+)
+
+SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_LIBRARIES} ${Qt5Quick_LIBRARIES})
ADD_EXECUTABLE (${TARGET} main.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
-
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/overlay-rendering/CMakeLists.txt.external
^
|
@@ -2,11 +2,19 @@
SET (TARGET overlay-rendering)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.6.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Core REQUIRED)
+FIND_PACKAGE (Qt5Gui REQUIRED)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Core_INCLUDE_DIRS}
+${Qt5Gui_INCLUDE_DIRS}
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Gui_Widgets} ${Qt5Widgets_LIBRARIES})
ADD_EXECUTABLE (${TARGET} main.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/reverse-geocoding/CMakeLists.txt.external
^
|
@@ -2,11 +2,17 @@
SET (TARGET reverse-geocoding)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.6.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Core REQUIRED)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Core_INCLUDE_DIRS}
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES})
ADD_EXECUTABLE (${TARGET} main.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/search/CMakeLists.txt.external
^
|
@@ -2,11 +2,17 @@
SET (TARGET search)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.6.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Core REQUIRED)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Core_INCLUDE_DIRS}
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES})
ADD_EXECUTABLE (${TARGET} main.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/examples/cpp/tour-preview/CMakeLists.txt.external
^
|
@@ -2,12 +2,19 @@
SET (TARGET tour-preview)
PROJECT (${TARGET})
-FIND_PACKAGE (Qt4 4.7.0 REQUIRED QtCore QtGui)
+FIND_PACKAGE (Qt5Core REQUIRED)
+FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Marble REQUIRED)
FIND_PACKAGE (OpenCV REQUIRED)
-INCLUDE (${QT_USE_FILE})
-INCLUDE_DIRECTORIES (${MARBLE_INCLUDE_DIR})
-SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES} ${OpenCV_LIBRARIES})
+
+INCLUDE_DIRECTORIES (
+${Qt5Core_INCLUDE_DIRS}
+${Qt5Widgets_INCLUDE_DIRS}
+${MARBLE_INCLUDE_DIR}
+${OpenCV_INCLUDE_DIRS}
+)
+
+SET (LIBS ${MARBLE_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${OpenCV_LIBRARIES})
ADD_EXECUTABLE (${TARGET} tour-preview.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/marble.appdata.xml
^
|
@@ -4,6 +4,7 @@
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL</project_license>
<name>Marble</name>
+ <name xml:lang="ast">Marble</name>
<name xml:lang="bs">Marble</name>
<name xml:lang="ca">Marble</name>
<name xml:lang="ca-valencia">Marble</name>
@@ -40,6 +41,7 @@
<summary xml:lang="ca">Globus terraqüi virtual</summary>
<summary xml:lang="ca-valencia">Globus terraqüi virtual</summary>
<summary xml:lang="cs">Virtuální glóbus</summary>
+ <summary xml:lang="da">Virtuel globus</summary>
<summary xml:lang="de">Virtueller Globus</summary>
<summary xml:lang="en-GB">Virtual Globe</summary>
<summary xml:lang="eo">Virtuala Globuso</summary>
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/behaim/create-apk.py
^
|
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-kde/CMakeLists.txt
^
|
@@ -6,7 +6,7 @@
include(KDECMakeSettings)
include(ECMInstallIcons)
endif()
-macro_optional_find_package(KF5 QUIET COMPONENTS Crash Wallet NewStuff Parts CoreAddons I18n)
+macro_optional_find_package(KF5 QUIET COMPONENTS Crash NewStuff Parts CoreAddons I18n)
if (NOT KF5_FOUND)
return()
@@ -25,7 +25,6 @@
set_target_properties(marble_part PROPERTIES PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
target_link_libraries(marble_part marbleui ${MARBLEWIDGET}
KF5::NewStuff
- KF5::Wallet
KF5::Parts
KF5::CoreAddons
KF5::I18n
@@ -56,7 +55,6 @@
${MARBLEWIDGET}
astro
KF5::NewStuff
- KF5::Wallet
KF5::Parts
KF5::Crash
KF5::CoreAddons
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-kde/marble.desktop
^
|
@@ -3,24 +3,30 @@
TryExec=marble
Exec=marble %F
Name=KDE Marble
+Name[ast]=Marble KDE
Name[ca]=Marble del KDE
Name[ca@valencia]=Marble del KDE
Name[cs]=KDE Marble
+Name[da]=KDE Marble
Name[de]=KDE-Marble
Name[en_GB]=KDE Marble
Name[es]=KDE Marble
+Name[et]=KDE Marble
Name[fi]=KDE Marble
Name[gl]=KDE Marble
+Name[it]=Marble KDE
Name[nl]=KDE Marble
Name[pl]=KDE Marble
Name[pt]=Marble do KDE
Name[pt_BR]=KDE Marble
Name[sk]=KDE Marble
+Name[sl]=KDE Marble
Name[sv]=KDE Marble
Name[tr]=KDE Marble
Name[uk]=Marble KDE
Name[x-test]=xxKDE Marblexx
GenericName=Virtual Globe
+GenericName[ast]=Globu virtual
GenericName[bg]=Настолен глобус
GenericName[bs]=Virtualni globus
GenericName[ca]=Globus virtual
@@ -57,18 +63,23 @@
GenericName[x-test]=xxVirtual Globexx
GenericName[zh_TW]=虛擬地球儀
Comment=Navigation and Maps
+Comment[ast]=Navegación y mapes
Comment[ca]=Navegació i mapes
Comment[ca@valencia]=Navegació i mapes
+Comment[da]=Navigation og kort
Comment[de]=Navigation und Karten
Comment[en_GB]=Navigation and Maps
Comment[es]=Navegación y mapas
+Comment[et]=Liikumine ja kaardid
Comment[fi]=Navigointi ja kartat
Comment[gl]=Navegación e mapas
+Comment[it]=Navigazione e mappe
Comment[nl]=Navigatie en kaarten
Comment[pl]=Nawigacja i mapy
Comment[pt]=Navegação e Mapas
Comment[pt_BR]=Navegação e mapas
Comment[sk]=Navigácia a mapy
+Comment[sl]=Krmarjenje in karte
Comment[sv]=Navigering och kartor
Comment[tr]=Gezinti ve Haritalar
Comment[uk]=Навігація і карти
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-kde/marble.kcfg
^
|
@@ -338,8 +338,5 @@
<entry name="owncloudPassword" type="String">
<default></default>
</entry>
- <entry name="accessKWallet" type="Bool">
- <default>true</default>
- </entry>
</group>
</kcfg>
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-kde/marble_part.cpp
^
|
@@ -46,7 +46,6 @@
#include <kstandardaction.h>
#include <ktoggleaction.h>
#include <ktogglefullscreenaction.h>
-#include <KWallet/kwallet.h>
#include <kns3/knewstuffaction.h>
#include <kns3/uploaddialog.h>
@@ -130,7 +129,6 @@
m_stopRecordingAction( 0 ),
m_recentFilesAction( 0 ),
m_configDialog( 0 ),
- m_wallet( 0 ),
m_position( i18n( NOT_AVAILABLE ) ),
m_tileZoomLevel( i18n( NOT_AVAILABLE ) ),
m_positionLabel( 0 ),
@@ -250,18 +248,17 @@
continue;
const QStringList fileExtensions = plugin->fileExtensions().replaceInStrings( QRegExp( "^" ), "*." );
- const QString filter = QString( "%1|%2" ).arg( fileExtensions.join( " " ) ).arg( plugin->fileFormatDescription() );
+ const QString filter = QString( "%1 (%2)" ).arg( plugin->fileFormatDescription() ).arg( fileExtensions.join( " " ) );
filters << filter;
-
allFileExtensions << fileExtensions;
}
- allFileExtensions.sort();
- const QString allFileTypes = QString( "%1|%2" ).arg( allFileExtensions.join( " " ) ).arg( i18n( "All Supported Files" ) );
+ allFileExtensions.sort(); // sort since file extensions are visible under Windows
+ const QString allFileTypes = QString( "%1 (%2)" ).arg( i18n( "All Supported Files" ) ).arg( allFileExtensions.join( " " ) );
filters.sort();
filters.prepend( allFileTypes );
- const QString filter = filters.join( "\n" );
+ const QString filter = filters.join( ";;" );
QStringList fileNames = QFileDialog::getOpenFileNames( widget(), i18n("Open File"),
m_lastFileOpenPath, filter );
@@ -272,7 +269,7 @@
}
foreach( const QString &fileName, fileNames ) {
- openUrl( fileName );
+ openUrl( QUrl::fromLocalFile(fileName) );
}
return true;
@@ -436,47 +433,6 @@
{
qDebug() << "Start: MarblePart::readSettings()";
- // Open a wallet.
- QString m_walletFolderName="Marble";
- m_wallet = KWallet::Wallet::openWallet( KWallet::Wallet::NetworkWallet(), m_controlView->marbleWidget()->winId() );
- if ( m_wallet == 0 ) {
- if ( MarbleSettings::accessKWallet() ) {
- QMessageBox::StandardButton const answer = QMessageBox::question(
- m_controlView,
- i18n( "Please allow access to KWallet." ),
- i18n( "You haven't allowed Marble to use KWallet yet.\n"
- "This is dangerous since Marble will store your password without encryption.\n"
- "Are you sure?" ),
- QMessageBox::Yes | QMessageBox::No );
- if ( answer == QMessageBox::Yes ) {
- // User wants to save his password in plain text.
- MarbleSettings::setAccessKWallet( false );
- }
- else {
- m_wallet = KWallet::Wallet::openWallet( KWallet::Wallet::NetworkWallet(), m_controlView->marbleWidget()->winId() );
- if ( m_wallet == 0 ) {
- // Show dialog and ask why user don't allowed.
- // If user didn't see KWallet dialog it means that he deny forever.
- // Show instructions how to disable the block.
- QMessageBox::information( m_controlView,
- i18n( "KWallet Access in Marble" ),
- i18n( "You still don't allow Marble to use KWallet.\n"
- "If you haven't seen the KWallet dialog asking to allow access, it means that you have disabled it.\n"
- "If you would like to change this see System Information -> Account Details -> KDE Wallet -> Access Control.\n"
- "Choose your wallet and allow Marble to use it." ) );
- // User wants to save his passwords in plain text.
- MarbleSettings::setAccessKWallet( false );
- }
- }
- }
- }
- if ( m_wallet ) {
- if ( !m_wallet->hasFolder( m_walletFolderName ) ) {
- m_wallet->createFolder( m_walletFolderName );
- }
- m_wallet->setFolder( m_walletFolderName );
- }
-
// Set home position
m_controlView->marbleModel()->setHome( MarbleSettings::homeLongitude(),
MarbleSettings::homeLatitude(),
@@ -587,17 +543,6 @@
m_controlView->setExternalMapEditor( m_externalEditorMapping[MarbleSettings::externalMapEditor()] );
- if ( m_wallet ) {
- // Read settings from kwallet and store it in MarbleSettings for using in kconfigdialog.
- QMap<QString, QString> owncloudAuth;
- m_wallet->readMap( "OwncloudServer", owncloudAuth );
- if ( owncloudAuth.contains( "Username" ) ) {
- MarbleSettings::setOwncloudUsername( owncloudAuth[ "Username" ] );
- }
- if ( owncloudAuth.contains( "Password" ) ) {
- MarbleSettings::setOwncloudPassword( owncloudAuth[ "Password" ] );
- }
- }
CloudSyncManager* cloudSyncManager = m_controlView->cloudSyncManager();
cloudSyncManager->setOwncloudCredentials( MarbleSettings::owncloudServer(),
MarbleSettings::owncloudUsername(),
@@ -655,17 +600,6 @@
MarbleSettings::setQuitLatitude( quitLat );
MarbleSettings::setQuitRange( quitRange );
- if ( m_wallet ) {
- // Write changes to kwallet...
- QMap<QString, QString> owncloudAuth;
- owncloudAuth.insert( "Username", MarbleSettings::owncloudUsername() );
- owncloudAuth.insert( "Password", MarbleSettings::owncloudPassword() );
- m_wallet->writeMap( "OwncloudServer",owncloudAuth );
- // Remove username and password form config file (they were saved in kwallet).
- MarbleSettings::setOwncloudUsername( QString() );
- MarbleSettings::setOwncloudPassword( QString() );
- }
-
// Get the 'home' values from the widget and store them in the settings.
qreal homeLon = 0;
qreal homeLat = 0;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-kde/marble_part.desktop
^
|
@@ -14,7 +14,7 @@
Name[en_GB]=Marble Part
Name[eo]=Marble Part
Name[es]=Part Marble
-Name[et]=Marble konponent
+Name[et]=Marble komponent
Name[eu]=Marmolaren zatia
Name[fi]=Marble-osa
Name[fr]=Composant Marble
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-kde/marble_part.h
^
|
@@ -20,7 +20,6 @@
#include "MarbleGlobal.h"
#include "cloudsync/CloudSyncManager.h"
#include <krecentfilesaction.h>
-#include <KWallet/kwallet.h>
#include <QDomNode>
#include "ui_MarbleCloudSyncSettingsWidget.h"
@@ -248,8 +247,6 @@
QHash<QString, int> m_pluginEnabled;
- KWallet::Wallet *m_wallet;
-
QString m_position;
QString m_clock;
QString m_tileZoomLevel;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-maps/MarbleMaps.cpp
^
|
@@ -9,9 +9,9 @@
//
#include "MarbleMaps.h"
+#include <FileManager.h>
#include <MarbleModel.h>
-
#include <QGuiApplication>
#ifdef Q_OS_ANDROID
@@ -42,6 +42,7 @@
QAndroidJniObject const path = data.callObjectMethod("getPath", "()Ljava/lang/String;");
if (path.isValid()) {
model()->addGeoDataFile(path.toString());
+ connect( model()->fileManager(), SIGNAL(centeredDocument(GeoDataLatLonBox)), this, SLOT(centerOn(GeoDataLatLonBox)) );
}
}
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-maps/MarbleMaps.qrc
^
|
@@ -48,5 +48,6 @@
<file alias="ic_place_via.png">../../../data/android/drawable-xxxhdpi/ic_place_via.png</file>
<file alias="add.png">../../../data/android/drawable-xxxhdpi/ic_add_black_48dp.png</file>
<file>RouteProfileRadioButton.qml</file>
+ <file>ScrollBar.qml</file>
</qresource>
</RCC>
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-maps/RouteEditor.qml
^
|
@@ -158,6 +158,12 @@
}
}
}
+
+ ScrollBar {
+ id: scrollBar
+ anchors.left: waypointList.right-12
+ flickableItem: waypointList
+ }
}
}
}
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-maps/ScrollBar.qml
^
|
@@ -0,0 +1,38 @@
+//
+// 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 2015 Imran Tatriev <itatriev@gmail.com>
+//
+
+import QtQuick 2.3
+import QtQuick.Window 2.2
+
+Item {
+ id: scrollBarItem
+
+ property Flickable flickableItem: null
+ property real position: flickableItem.visibleArea.yPosition
+ property real pageSize: flickableItem.visibleArea.heightRatio
+
+ width: Screen.pixelDensity * 1.5
+ height: flickableItem.height
+ anchors.right: flickableItem.right
+
+ opacity: flickableItem.movingVertically ? 1 : 0
+ clip: true
+
+ Rectangle {
+ id: indicator
+ y: scrollBarItem.position * (scrollBarItem.height-2) + 1
+ width: parent.width-2
+ height: scrollBarItem.pageSize * (scrollBarItem.height-2)
+ radius: width/2 - 1
+ color: "lightgray"
+ }
+
+ Behavior on opacity { NumberAnimation { duration: 125 } }
+}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-maps/SearchResults.qml
^
|
@@ -88,4 +88,9 @@
}
}
}
+
+ ScrollBar {
+ id: scrollBar
+ flickableItem: view
+ }
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-maps/create-apk.py
^
|
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-maps/org.kde.marble.maps.desktop
^
|
@@ -3,54 +3,69 @@
TryExec=marble-maps
Exec=marble-maps %F
Name=Marble Maps
+Name[ast]=Mapes Marble
Name[ca]=Mapes del Marble
Name[ca@valencia]=Mapes del Marble
Name[cs]=Mapy Marble
+Name[da]=Marble Maps
Name[de]=Marble-Karten
Name[en_GB]=Marble Maps
Name[es]=Mapas de Marble
+Name[et]=Marble kaardid
Name[fi]=Marble-kartat
Name[gl]=Mapas de Marble
+Name[it]=Mappe di Marble
Name[nl]=Kaarten van Marble
Name[pl]=Mapy Marble
Name[pt]=Mapas do Marble
Name[pt_BR]=Mapas do Marble
Name[sk]=Marble mapy
+Name[sl]=Karte Marble
Name[sv]=Marble-kartor
Name[tr]=Marble Haritaları
Name[uk]=Карти Marble
Name[x-test]=xxMarble Mapsxx
GenericName=OpenStreetMap Navigation
+GenericName[ast]=Navegación d'OpenStreetMap
GenericName[ca]=Navegació de l'OpenStreetMap
GenericName[ca@valencia]=Navegació de l'OpenStreetMap
GenericName[cs]=Navigace OpenStreetMap
+GenericName[da]=OpenStreetMap-navigation
GenericName[de]=OpenStreetMap-Navigation
GenericName[en_GB]=OpenStreetMap Navigation
GenericName[es]=Navegación de OpenStreetMap
+GenericName[et]=OpenStreetMapi liikumine
GenericName[fi]=OpenStreetMap-navigointi
GenericName[gl]=Navegación con OpenStreetMap
+GenericName[it]=Navigazione con OpenStreetMap
GenericName[nl]=Navigatie met OpenStreetMap
GenericName[pl]=Nawigacja OpenStreetMap
GenericName[pt]=Navegação com o OpenStreetMap
GenericName[pt_BR]=Navegação com o OpenStreetMap
GenericName[sk]=Navigácia OpenStreetMap
+GenericName[sl]=Krmarjenje z OpenStreetMap
GenericName[sv]=Navigering med OpenStreetMap
GenericName[tr]=OpenStreetMap Gezintisi
GenericName[uk]=Навігація OpenStreetMap
GenericName[x-test]=xxOpenStreetMap Navigationxx
Comment=Find your way
+Comment[ast]=Alcuentra'l to camín
Comment[ca]=Trobeu el camí
Comment[ca@valencia]=Trobeu el camí
+Comment[da]=Find vej
Comment[de]=Routenplanung
Comment[en_GB]=Find your way
Comment[es]=Encuentre su ruta
+Comment[et]=Oma teekonna leidmine
Comment[fi]=Löydä perille
Comment[gl]=Atopa o teu camiño
+Comment[it]=Trova la via
Comment[nl]=Uw weg vinden
Comment[pl]=Znajdź swoją drogę
Comment[pt]=Descubra o seu caminho
Comment[pt_BR]=Descubra o seu caminho
Comment[sk]=Nájdite svoju cestu
+Comment[sl]=Najdite vašo pot
Comment[sv]=Hitta rätt
Comment[tr]=Yolunuzu bulun
Comment[uk]=Знайдіть ваш шлях
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-maps/package/AndroidManifest.xml
^
|
@@ -13,9 +13,9 @@
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
- <data android:scheme="file" host="*" android:mimeType="*/*" android:pathPattern=".*\\.kml"/>
- <data android:scheme="file" host="*" android:mimeType="*/*" android:pathPattern=".*\\.gpx"/>
- <data android:scheme="file" host="*" android:mimeType="*/*" android:pathPattern=".*\\.osm"/>
+ <data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.kml"/>
+ <data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.gpx"/>
+ <data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.osm"/>
</intent-filter>
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-qt/marble-qt.desktop
^
|
@@ -59,6 +59,7 @@
Name[zh_CN]=Marble
Name[zh_TW]=地理_Marble
GenericName=Virtual Globe
+GenericName[ast]=Globu virtual
GenericName[bg]=Настолен глобус
GenericName[bs]=Virtualni globus
GenericName[ca]=Globus virtual
@@ -95,18 +96,23 @@
GenericName[x-test]=xxVirtual Globexx
GenericName[zh_TW]=虛擬地球儀
Comment=Navigation and Maps
+Comment[ast]=Navegación y mapes
Comment[ca]=Navegació i mapes
Comment[ca@valencia]=Navegació i mapes
+Comment[da]=Navigation og kort
Comment[de]=Navigation und Karten
Comment[en_GB]=Navigation and Maps
Comment[es]=Navegación y mapas
+Comment[et]=Liikumine ja kaardid
Comment[fi]=Navigointi ja kartat
Comment[gl]=Navegación e mapas
+Comment[it]=Navigazione e mappe
Comment[nl]=Navigatie en kaarten
Comment[pl]=Nawigacja i mapy
Comment[pt]=Navegação e Mapas
Comment[pt_BR]=Navegação e mapas
Comment[sk]=Navigácia a mapy
+Comment[sl]=Krmarjenje in karte
Comment[sv]=Navigering och kartor
Comment[tr]=Gezinti ve Haritalar
Comment[uk]=Навігація і карти
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/apps/marble-ui/ControlView.cpp
^
|
@@ -130,7 +130,7 @@
QString ControlView::applicationVersion()
{
- return "1.12.20 (1.13 development version)";
+ return "1.14.21 (2.0 development version)";
}
MapThemeManager *ControlView::mapThemeManager()
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/astro/astr2lib.cpp
^
|
@@ -1515,7 +1515,7 @@
d = 36525.0*t + 40452.0;
dt = d / 365.25;
tt = 5.0616*(((36525*t + 18262.577000)/365.25)+1950.0-1866.06);
- tt = M_PI / 180.0;
+ tt *= M_PI / 180.0;
a = 0.00124171;
n = 381.994516;
ecc = 0.01986;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/astro/attlib.h
^
|
@@ -66,7 +66,7 @@
public:
double m[3][3];
- Mat3(double x=0);
+ explicit Mat3(double x=0);
Mat3 (const Mat3& c);
void assign (double x11, double x12, double x13, double x21, double x22,
double x23, double x31, double x32, double x33);
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/AbstractWorkerThread.cpp
^
|
@@ -24,7 +24,7 @@
class AbstractWorkerThreadPrivate
{
public:
- AbstractWorkerThreadPrivate( AbstractWorkerThread *parent )
+ explicit AbstractWorkerThreadPrivate( AbstractWorkerThread *parent )
: m_running( false ),
m_end( false ),
m_parent( parent )
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/AddLinkDialog.h
^
|
@@ -23,7 +23,7 @@
Q_OBJECT
public:
- AddLinkDialog(QWidget *parent = 0 );
+ explicit AddLinkDialog(QWidget *parent = 0 );
~AddLinkDialog();
QString name() const;
QString url() const;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/AnimatedUpdateTrack.h
^
|
@@ -24,7 +24,7 @@
Q_OBJECT
public:
- AnimatedUpdateTrack( PlaybackAnimatedUpdateItem* item );
+ explicit AnimatedUpdateTrack( PlaybackAnimatedUpdateItem* item );
void setDelayBeforeTrackStarts( double delay );
double delayBeforeTrackStarts() const;
void play();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/CMakeLists.txt
^
|
@@ -36,8 +36,8 @@
INCLUDE(osm/CMakeLists.txt)
if(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
-set(GENERIC_LIB_VERSION "0.22.20")
-set(GENERIC_LIB_SOVERSION "23")
+set(GENERIC_LIB_VERSION "0.24.21")
+set(GENERIC_LIB_SOVERSION "25")
endif()
# link_directories (${QT_LIBRARY_DIR})
@@ -63,9 +63,7 @@
MarbleAbstractPresenter.cpp
MarbleModel.cpp
MarbleMap.cpp
- MarbleControlBox.cpp
MarbleColors.cpp
- NavigationWidget.cpp
MapViewWidget.cpp
CelestialSortFilterProxyModel.cpp
FileViewWidget.cpp
@@ -305,7 +303,6 @@
set (marblewidget_UI
${osm_UIS}
LatLonBoxWidget.ui
- NavigationWidget.ui
MapViewWidget.ui
CurrentLocationWidget.ui
FileViewWidget.ui
@@ -446,8 +443,6 @@
MarbleWidget.h
MarbleMap.h
MarbleModel.h
- MarbleControlBox.h
- NavigationWidget.h
MapViewWidget.h
CelestialSortFilterProxyModel.h
LegendWidget.h
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/ClipPainter.cpp
^
|
@@ -24,7 +24,7 @@
class ClipPainterPrivate
{
public:
- ClipPainterPrivate( ClipPainter * parent );
+ explicit ClipPainterPrivate( ClipPainter * parent );
ClipPainter * q;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/EditBookmarkDialog.cpp
^
|
@@ -161,7 +161,7 @@
const GeoDataCoordinates::Notation notation =
(defaultAngleUnit == DecimalDegree) ? GeoDataCoordinates::Decimal :
(defaultAngleUnit == DMSDegree) ? GeoDataCoordinates::DMS :
- /* else, UTM */ GeoDataCoordinates::DMS;
+ /* else, UTM */ GeoDataCoordinates::UTM;
d->m_ui.m_header->setNotation(notation);
d->m_manager = new ReverseGeocodingRunnerManager( d->m_widget->model(), this );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/EditPlacemarkDialog.cpp
^
|
@@ -134,7 +134,7 @@
const GeoDataCoordinates::Notation notation =
(defaultAngleUnit == DecimalDegree) ? GeoDataCoordinates::Decimal :
(defaultAngleUnit == DMSDegree) ? GeoDataCoordinates::DMS :
- /* else, UTM */ GeoDataCoordinates::DMS;
+ /* else, UTM */ GeoDataCoordinates::UTM;
d->m_header->setNotation( notation );
}
connect( d->m_header, SIGNAL(valueChanged()), this, SLOT(
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/FileLoader.cpp
^
|
@@ -25,6 +25,7 @@
#include "GeoDataStyleMap.h"
#include "GeoDataPolyStyle.h"
#include "GeoDataLineStyle.h"
+#include "GeoDataPolygon.h"
#include "GeoDataStyle.h"
#include "GeoDataTypes.h"
#include "MarbleDirs.h"
@@ -39,7 +40,7 @@
{
public:
FileLoaderPrivate( FileLoader* parent, const PluginManager *pluginManager, bool recenter,
- const QString& file, const QString& property, const GeoDataStyle::Ptr &style, DocumentRole role )
+ const QString& file, const QString& property, const GeoDataStyle::Ptr &style, DocumentRole role, int renderOrder )
: q( parent),
m_runner( pluginManager ),
m_recenter( recenter ),
@@ -48,7 +49,8 @@
m_style( style ),
m_documentRole ( role ),
m_styleMap( new GeoDataStyleMap ),
- m_document( 0 )
+ m_document( 0 ),
+ m_renderOrder( renderOrder )
{
if( m_style ) {
m_styleMap->setId("default-map");
@@ -92,12 +94,13 @@
GeoDataStyleMap* m_styleMap;
GeoDataDocument *m_document;
QString m_error;
+ int m_renderOrder;
};
-FileLoader::FileLoader( QObject* parent, const PluginManager *pluginManager, bool recenter,
- const QString& file, const QString& property, const GeoDataStyle::Ptr &style, DocumentRole role )
+FileLoader::FileLoader( QObject* parent, const PluginManager *pluginManager, bool recenter, const QString& file,
+ const QString& property, const GeoDataStyle::Ptr &style, DocumentRole role, int renderOrder )
: QThread( parent ),
- d( new FileLoaderPrivate( this, pluginManager, recenter, file, property, style, role ) )
+ d( new FileLoaderPrivate( this, pluginManager, recenter, file, property, style, role, renderOrder ) )
{
}
@@ -220,6 +223,15 @@
doc->addStyle( m_style );
}
+ if (m_renderOrder != 0) {
+ foreach (GeoDataPlacemark* placemark, doc->placemarkList()) {
+ if (placemark->geometry() && placemark->geometry()->nodeType() == GeoDataTypes::GeoDataPolygonType) {
+ GeoDataPolygon *polygon = static_cast<GeoDataPolygon*>(placemark->geometry());
+ polygon->setRenderOrder(m_renderOrder);
+ }
+ }
+ }
+
createFilterProperties( doc );
emit q->newGeoDataDocumentAdded( m_document );
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/FileLoader.h
^
|
@@ -26,8 +26,8 @@
{
Q_OBJECT
public:
- FileLoader(QObject* parent, const PluginManager *pluginManager, bool recenter,
- const QString& file, const QString& property, const GeoDataStyle::Ptr &style, DocumentRole role );
+ FileLoader(QObject* parent, const PluginManager *pluginManager, bool recenter, const QString& file,
+ const QString& property, const GeoDataStyle::Ptr &style, DocumentRole role, int renderOrder );
FileLoader( QObject* parent, const PluginManager *pluginManager,
const QString& contents, const QString& name, DocumentRole role );
virtual ~FileLoader();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/FileManager.cpp
^
|
@@ -78,7 +78,7 @@
delete d;
}
-void FileManager::addFile( const QString& filepath, const QString& property, const GeoDataStyle::Ptr &style, DocumentRole role, bool recenter )
+void FileManager::addFile( const QString& filepath, const QString& property, const GeoDataStyle::Ptr &style, DocumentRole role, int renderOrder, bool recenter )
{
if( d->m_fileItemHash.contains( filepath ) ) {
return; // already loaded
@@ -92,7 +92,7 @@
mDebug() << "adding container:" << filepath;
mDebug() << "Starting placemark loading timer";
d->m_timer.start();
- FileLoader* loader = new FileLoader( this, d->m_pluginManager, recenter, filepath, property, style, role );
+ FileLoader* loader = new FileLoader( this, d->m_pluginManager, recenter, filepath, property, style, role, renderOrder );
d->appendLoader( loader );
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/FileManager.h
^
|
@@ -54,7 +54,7 @@
/**
* Loads a new file into the manager.
*/
- void addFile(const QString &fileName, const QString &property, const GeoDataStyle::Ptr &style, DocumentRole role, bool recenter = false );
+ void addFile(const QString &fileName, const QString &property, const GeoDataStyle::Ptr &style, DocumentRole role, int renderOrder = 0, bool recenter = false );
/**
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/FileViewWidget.cpp
^
|
@@ -40,7 +40,7 @@
{
public:
- FileViewWidgetPrivate( FileViewWidget *parent );
+ explicit FileViewWidgetPrivate( FileViewWidget *parent );
void setTreeModel( GeoDataTreeModel *model );
void setFileManager( FileManager *manager );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/FlyToEditWidget.cpp
^
|
@@ -105,12 +105,7 @@
void FlyToEditWidget::setFirstFlyTo(const QPersistentModelIndex &index)
{
if( m_index.internalPointer() == index.internalPointer() ) {
- m_durationSpin->setEnabled( false );
- } else {
- if( !m_durationSpin->isEnabled() )
- {
- m_durationSpin->setEnabled( true );
- }
+ m_durationSpin->setValue(0);
}
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/GenericScanlineTextureMapper.h
^
|
@@ -28,7 +28,7 @@
class GenericScanlineTextureMapper : public TextureMapperInterface
{
public:
- GenericScanlineTextureMapper( StackedTileLoader *tileLoader );
+ explicit GenericScanlineTextureMapper( StackedTileLoader *tileLoader );
virtual void mapTexture( GeoPainter *painter,
const ViewportParams *viewport,
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/GeoGraphicsScene.cpp
^
|
@@ -32,7 +32,7 @@
{
public:
GeoGraphicsScene *q;
- GeoGraphicsScenePrivate(GeoGraphicsScene *parent) :
+ explicit GeoGraphicsScenePrivate(GeoGraphicsScene *parent) :
q(parent)
{
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/LatLonEdit.cpp
^
|
@@ -40,7 +40,7 @@
class AbstractInputHandler // TODO: better name
{
protected:
- AbstractInputHandler(LatLonEditPrivate *ui) : m_ui(ui) {}
+ explicit AbstractInputHandler(LatLonEditPrivate *ui) : m_ui(ui) {}
public:
virtual ~AbstractInputHandler() {}
@@ -60,7 +60,7 @@
class DecimalInputHandler : public AbstractInputHandler
{
public:
- DecimalInputHandler(LatLonEditPrivate *ui) : AbstractInputHandler(ui) {}
+ explicit DecimalInputHandler(LatLonEditPrivate *ui) : AbstractInputHandler(ui) {}
public: // AbstractInputHandler API
virtual void setupUi();
virtual void setupMinMax(Dimension dimension);
@@ -74,7 +74,7 @@
class DMSInputHandler : public AbstractInputHandler
{
public:
- DMSInputHandler(LatLonEditPrivate *ui) : AbstractInputHandler(ui) {}
+ explicit DMSInputHandler(LatLonEditPrivate *ui) : AbstractInputHandler(ui) {}
public: // AbstractInputHandler API
virtual void setupUi();
virtual void setupMinMax(Dimension dimension);
@@ -88,7 +88,7 @@
class DMInputHandler : public AbstractInputHandler
{
public:
- DMInputHandler(LatLonEditPrivate *ui) : AbstractInputHandler(ui) {}
+ explicit DMInputHandler(LatLonEditPrivate *ui) : AbstractInputHandler(ui) {}
public: // AbstractInputHandler API
virtual void setupUi();
virtual void setupMinMax(Dimension dimension);
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MapThemeDownloadDialog.cpp
^
|
@@ -75,7 +75,7 @@
d->setupUi( this );
d->m_model.setTargetDirectory( MarbleDirs::localPath() + "/maps" );
- d->m_model.setProvider( "http://edu.kde.org/marble/newstuff/maps-4.5.xml" );
+ d->m_model.setProvider( "https://marble.kde.org/maps-v3.xml" );
d->m_model.setRegistryFile( MarbleDirs::localPath() + "/newstuff/marble-map-themes.knsregistry", Marble::NewstuffModel::NameTag );
d->listView->setIconSize( QSize( 130, 130 ) );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MapThemeSortFilterProxyModel.cpp
^
|
@@ -38,11 +38,6 @@
return false;
}
}
- if( isFavorite( left ) && isFavorite( right ) ) {
- if( favoriteDateTime( left ) != favoriteDateTime( right ) ) {
- return favoriteDateTime( left ) > favoriteDateTime( right );
- }
- }
return sourceModel()->data( left ).toString() < sourceModel()->data( right ).toString();;
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MapViewItemDelegate.h
^
|
@@ -31,7 +31,7 @@
Q_OBJECT
public:
- MapViewItemDelegate( QListView* view );
+ explicit MapViewItemDelegate( QListView* view );
void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const;
QSize sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MapViewWidget.cpp
^
|
@@ -234,9 +234,10 @@
void toggleFavorite();
void toggleIconSize();
- bool isCurrentFavorite();
+ bool isCurrentFavorite() const;
QString currentThemeName() const;
QString currentThemePath() const;
+ QString favoriteKey(const QModelIndex &index) const;
MapViewWidget *const q;
@@ -631,6 +632,11 @@
return m_mapSortProxy.data( columnIndex, Qt::UserRole + 1 ).toString();
}
+QString MapViewWidget::Private::favoriteKey(const QModelIndex &index) const
+{
+ return "Favorites/" + m_mapSortProxy.data(index).toString();
+}
+
void MapViewWidget::Private::showContextMenu( const QPoint& pos )
{
QMenu menu;
@@ -664,18 +670,17 @@
void MapViewWidget::Private::toggleFavorite()
{
- const QModelIndex index = m_mapViewUi.marbleThemeSelectView->currentIndex();
- const QModelIndex columnIndex = m_mapSortProxy.index( index.row(), 0 );
-
+ QModelIndex index = m_mapViewUi.marbleThemeSelectView->currentIndex();
if( isCurrentFavorite() ) {
- m_settings.beginGroup( "Favorites" );
- m_settings.remove( m_mapSortProxy.data( columnIndex ).toString() );
- }
- else {
- m_settings.beginGroup( "Favorites" );
- m_settings.setValue( m_mapSortProxy.data( columnIndex ).toString(), QDateTime::currentDateTime() );
- }
- m_settings.endGroup();
+ m_settings.remove(favoriteKey(index));
+ } else {
+ m_settings.setValue(favoriteKey(index), QDateTime::currentDateTime() );
+ }
+ QStandardItemModel* sourceModel = qobject_cast<QStandardItemModel*>(m_mapSortProxy.sourceModel());
+ const QModelIndex sourceIndex = m_mapSortProxy.mapToSource(index);
+ emit sourceModel->dataChanged( sourceIndex, sourceIndex );
+ index = m_mapViewUi.marbleThemeSelectView->currentIndex();
+ m_mapViewUi.marbleThemeSelectView->scrollTo(index);
}
void MapViewWidget::Private::toggleIconSize()
@@ -686,16 +691,10 @@
m_settings.setValue("MapView/iconSize", m_mapViewUi.marbleThemeSelectView->iconSize() );
}
-bool MapViewWidget::Private::isCurrentFavorite()
+bool MapViewWidget::Private::isCurrentFavorite() const
{
const QModelIndex index = m_mapViewUi.marbleThemeSelectView->currentIndex();
- const QModelIndex nameIndex = m_mapSortProxy.index( index.row(), 0 );
-
- m_settings.beginGroup( "Favorites" );
- const bool isFavorite = m_settings.contains( m_mapSortProxy.data( nameIndex ).toString() );
- m_settings.endGroup();
-
- return isFavorite;
+ return m_settings.contains(favoriteKey(index));
}
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarbleAbstractPresenter.cpp
^
|
@@ -17,6 +17,8 @@
#include <Quaternion.h>
#include <ViewportParams.h>
#include <MarbleLocale.h>
+#include "MarbleMap.h"
+#include "MarbleModel.h"
#include <Planet.h>
#include <GeoDataPlacemark.h>
#include <MarbleClock.h>
@@ -24,10 +26,9 @@
namespace Marble
{
- MarbleAbstractPresenter::MarbleAbstractPresenter() :
- QObject()
- ,m_model()
- ,m_map(&m_model)
+ MarbleAbstractPresenter::MarbleAbstractPresenter(MarbleMap *map, QObject *parent) :
+ QObject(parent)
+ ,m_map(map)
,m_physics(this)
,m_animationsEnabled(false)
,m_logzoom(0)
@@ -86,8 +87,6 @@
emit zoomChanged(m_logzoom);
emit distanceChanged(distanceString());
-
- emit updateRequired();
}
}
else
@@ -190,7 +189,6 @@
emit zoomChanged(m_logzoom);
emit distanceChanged(distanceString());
- emit updateRequired();
}
else
{
@@ -337,7 +335,6 @@
emit zoomChanged(m_logzoom);
emit distanceChanged(distanceString());
- emit updateRequired();
}
}
@@ -494,19 +491,7 @@
void MarbleAbstractPresenter::setViewContext(ViewContext viewContext)
{
- if (map()->viewContext() != viewContext)
- {
- const MapQuality oldQuality = map()->mapQuality();
- map()->setViewContext(viewContext);
-
- //TODO - set view context for routing layer
- //m_routingLayer->setViewContext( viewContext );
-
- if (map()->mapQuality() != oldQuality)
- {
- emit updateRequired();
- }
- }
+ map()->setViewContext(viewContext);
}
bool MarbleAbstractPresenter::animationsEnabled() const
@@ -541,22 +526,22 @@
MarbleMap* MarbleAbstractPresenter::map()
{
- return &m_map;
+ return m_map;
}
const MarbleMap* MarbleAbstractPresenter::map() const
{
- return &m_map;
+ return m_map;
}
MarbleModel* MarbleAbstractPresenter::model()
{
- return &m_model;
+ return m_map->model();
}
const MarbleModel* MarbleAbstractPresenter::model() const
{
- return &m_model;
+ return m_map->model();
}
ViewportParams* MarbleAbstractPresenter::viewport()
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarbleAbstractPresenter.h
^
|
@@ -17,13 +17,17 @@
#include <QList>
#include "GeoDataLookAt.h"
#include "GeoDataLatLonBox.h"
-#include "MarbleMap.h"
-#include "MarbleModel.h"
#include "MarblePhysics.h"
#include <marble_export.h>
namespace Marble
{
+
+class GeoDataPlacemark;
+class MarbleMap;
+class MarbleModel;
+class ViewportParams;
+
class MARBLE_EXPORT MarbleAbstractPresenter : public QObject
{
Q_OBJECT
@@ -31,7 +35,6 @@
signals:
void zoomChanged(int zoom);
void distanceChanged(const QString& distanceString);
- void updateRequired();
/** This signal is emitted when a new rectangle region is selected over the map
* The list of double values includes coordinates in degrees using the following:
@@ -40,8 +43,7 @@
void regionSelected(const QList<double>&);
public:
- MarbleAbstractPresenter();
- void initialize(MarbleModel *model, MarbleMap *map);
+ MarbleAbstractPresenter(MarbleMap *map, QObject *parent = 0);
virtual ~MarbleAbstractPresenter();
qreal moveStep() const;
@@ -138,9 +140,7 @@
void setSelection(const QRect& region);
private:
- //MarbleAbstractPresenter owns these
- MarbleModel m_model;
- MarbleMap m_map;
+ MarbleMap *const m_map;
MarblePhysics m_physics;
bool m_animationsEnabled;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarbleDirs.cpp
^
|
@@ -120,8 +120,16 @@
QString MarbleDirs::systemPath()
{
+ if (!runTimeMarbleDataPath.isEmpty()) {
+ return runTimeMarbleDataPath;
+ }
+
QString systempath;
+#ifdef Q_OS_WIN
+ return QCoreApplication::applicationDirPath() + QDir::separator() + "data";
+#endif
+
#ifdef Q_OS_MACX
//
// On OSX lets try to find any file first in the bundle
@@ -150,10 +158,6 @@
return systempath;
#endif
-// Should this happen before the Mac bundle already?
-if ( !runTimeMarbleDataPath.isEmpty() )
- return runTimeMarbleDataPath;
-
#ifdef MARBLE_DATA_PATH
//MARBLE_DATA_PATH is a compiler define set by cmake
QString compileTimeMarbleDataPath(MARBLE_DATA_PATH);
@@ -174,6 +178,10 @@
QString MarbleDirs::pluginSystemPath()
{
+ if (!runTimeMarblePluginPath.isEmpty()) {
+ return runTimeMarblePluginPath;
+ }
+
QString systempath;
#ifdef Q_OS_MACX
@@ -199,9 +207,9 @@
}
#endif // mac bundle
-// Should this happen before the Mac bundle already?
-if ( !runTimeMarblePluginPath.isEmpty() )
- return runTimeMarblePluginPath;
+#ifdef Q_OS_WIN
+ return QCoreApplication::applicationDirPath() + QDir::separator() + "plugins";
+#endif
#ifdef Q_OS_ANDROID
return "assets:/plugins";
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarbleGlobal.h
^
|
@@ -256,14 +256,14 @@
// String for about dialog and http user agent
// FIXME: check if blanks are allowed in user agent version numbers
-const QString MARBLE_VERSION_STRING = QString::fromLatin1( "0.22.20 (0.23 development version)" );
+const QString MARBLE_VERSION_STRING = QString::fromLatin1( "0.24.21 (0.25 development version)" );
// API Version id:
// form : 0xMMmmpp
// MM = major revision.
// mm = minor revision.
// pp = patch revision.
-#define MARBLE_VERSION 0x001614
+#define MARBLE_VERSION 0x001815
static const char NOT_AVAILABLE[] = QT_TR_NOOP("not available");
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarbleInputHandler.cpp
^
|
@@ -20,11 +20,11 @@
#include <QPixmap>
#include <QGestureEvent>
#include <QPinchGesture>
-#include <QDebug> //removethis
#include "kineticmodel.h"
#include "MarbleGlobal.h"
#include "MarbleDebug.h"
+#include "MarbleMap.h"
#include "GeoDataCoordinates.h"
#include "MarbleAbstractPresenter.h"
#include "ViewportParams.h"
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarbleLegendBrowser.cpp
^
|
@@ -133,6 +133,10 @@
void MarbleLegendBrowser::loadLegend()
{
+ if (!d->m_marbleModel) {
+ return;
+ }
+
#ifndef MARBLE_NO_WEBKIT
if (d->m_currentThemeId != d->m_marbleModel->mapThemeId()) {
d->m_currentThemeId = d->m_marbleModel->mapThemeId();
@@ -144,8 +148,7 @@
QString legendPath;
// Check for a theme specific legend.html first
- if ( d->m_marbleModel != 0 && d->m_marbleModel->mapTheme() != 0 )
- {
+ if (d->m_marbleModel->mapTheme() != 0 ) {
const GeoSceneDocument *currentMapTheme = d->m_marbleModel->mapTheme();
legendPath = MarbleDirs::path( "maps/" +
@@ -176,10 +179,8 @@
// Set the html string in the QTextBrowser.
setHtml(finalHtml, baseUrl);
- if ( d->m_marbleModel ) {
- QTextDocument *document = new QTextDocument(page()->mainFrame()->toHtml());
- d->m_marbleModel->setLegend( document );
- }
+ QTextDocument *document = new QTextDocument(page()->mainFrame()->toHtml());
+ d->m_marbleModel->setLegend( document );
#endif
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarbleLineEdit.cpp
^
|
@@ -45,7 +45,7 @@
int m_iconSize;
- MarbleLineEditPrivate( MarbleLineEdit* parent );
+ explicit MarbleLineEditPrivate( MarbleLineEdit* parent );
void createProgressAnimation();
};
@@ -147,7 +147,7 @@
}
QString const direction = layoutDirection() == Qt::LeftToRight ? "rtl" : "ltr";
- int const size = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen ? 32 : 16;
+ int const size = (MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen) ? 32 : 16;
QPixmap pixmap = QPixmap( QString( ":/icons/%1x%1/edit-clear-locationbar-%2.png").arg( size ).arg( direction ) );
d->m_clearButton->setPixmap( pixmap );
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarbleMap.cpp
^
|
@@ -79,7 +79,7 @@
class MarbleMap::CustomPaintLayer : public LayerInterface
{
public:
- CustomPaintLayer( MarbleMap *map )
+ explicit CustomPaintLayer( MarbleMap *map )
: m_map( map )
{
}
@@ -320,13 +320,13 @@
void MarbleMap::setViewContext( ViewContext viewContext )
{
- if (d->m_viewParams.viewContext() == viewContext) {
+ if ( d->m_viewParams.viewContext() == viewContext ) {
return;
}
const MapQuality oldQuality = d->m_viewParams.mapQuality();
d->m_viewParams.setViewContext( viewContext );
- emit viewContextChanged(viewContext);
+ emit viewContextChanged( viewContext );
if ( d->m_viewParams.mapQuality() != oldQuality ) {
// Update texture map during the repaint that follows:
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarbleModel.cpp
^
|
@@ -339,6 +339,7 @@
QStringList fileList;
QStringList propertyList;
QList<GeoDataStyle::Ptr> styleList;
+ QList<int> renderOrderList;
bool skip = false;
bool sourceFileMatch = false;
@@ -379,6 +380,7 @@
QPen pen = data->pen();
QBrush brush = data->brush();
GeoDataStyle::Ptr style;
+ int renderOrder = data->renderOrder();
/**
* data->colors() are the colorMap values from dgml file. If this is not
@@ -418,6 +420,7 @@
fileList << filename;
propertyList << property;
styleList << style;
+ renderOrderList << renderOrder;
}
}
}
@@ -427,7 +430,7 @@
}
// load new datasets
for ( int i = 0 ; i < fileList.size(); ++i ) {
- d->m_fileManager.addFile( fileList.at(i), propertyList.at(i), styleList.at(i), MapDocument );
+ d->m_fileManager.addFile( fileList.at(i), propertyList.at(i), styleList.at(i), MapDocument, renderOrderList.at(i) );
}
mDebug() << "THEME CHANGED: ***" << mapTheme->head()->mapThemeId();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarblePhysics.cpp
^
|
@@ -35,7 +35,7 @@
qreal m_planetRadius;
- MarblePhysicsPrivate( MarbleAbstractPresenter *presenter )
+ explicit MarblePhysicsPrivate( MarbleAbstractPresenter *presenter )
: m_presenter( presenter ),
m_mode( Instant ),
m_planetRadius( EARTH_RADIUS )
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarblePluginSettingsWidget.cpp
^
|
@@ -28,7 +28,7 @@
class MarblePluginSettingsWidgetPrivate : public Ui::MarblePluginSettingsWidget
{
public:
- MarblePluginSettingsWidgetPrivate( Marble::MarblePluginSettingsWidget *parent ) :
+ explicit MarblePluginSettingsWidgetPrivate( Marble::MarblePluginSettingsWidget *parent ) :
q( parent ),
m_itemDelegate( 0 )
{}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarbleWidget.cpp
^
|
@@ -36,7 +36,6 @@
#include "MarbleLocale.h"
#include "MarbleMap.h"
#include "MarbleModel.h"
-#include "MarblePhysics.h"
#include "MarbleWidgetInputHandler.h"
#include "MarbleWidgetPopupMenu.h"
#include "Planet.h"
@@ -54,7 +53,7 @@
class MarbleWidget::CustomPaintLayer : public LayerInterface
{
public:
- CustomPaintLayer( MarbleWidget *widget )
+ explicit CustomPaintLayer( MarbleWidget *widget )
: m_widget( widget )
{
}
@@ -85,14 +84,15 @@
};
-class MarbleWidgetPrivate : public MarbleAbstractPresenter
+class MarbleWidgetPrivate
{
public:
- MarbleWidgetPrivate( MarbleWidget *parent )
- : MarbleAbstractPresenter(),
+ explicit MarbleWidgetPrivate( MarbleWidget *parent ) :
m_widget( parent ),
+ m_model(),
+ m_map( &m_model ),
+ m_presenter( &m_map ),
m_inputhandler( 0 ),
- m_physics( this ),
m_routingLayer( 0 ),
m_mapInfoDialog( 0 ),
m_customPaintLayer( parent ),
@@ -103,8 +103,8 @@
~MarbleWidgetPrivate()
{
- map()->removeLayer( &m_customPaintLayer );
- map()->removeLayer( m_mapInfoDialog );
+ m_map.removeLayer( &m_customPaintLayer );
+ m_map.removeLayer( m_mapInfoDialog );
delete m_mapInfoDialog;
delete m_popupmenu;
}
@@ -126,9 +126,12 @@
MarbleWidget *const m_widget;
- MarbleWidgetInputHandler *m_inputhandler;
+ MarbleModel m_model;
+ MarbleMap m_map;
+
+ MarbleAbstractPresenter m_presenter;
- MarblePhysics m_physics;
+ MarbleWidgetInputHandler *m_inputhandler;
RoutingLayer *m_routingLayer;
PopupLayer *m_mapInfoDialog;
@@ -177,57 +180,55 @@
m_widget->setAutoFillBackground( true );
// Initialize the map and forward some signals.
- map()->setSize( m_widget->width(), m_widget->height() );
- map()->setShowFrameRate( false ); // never let the map draw the frame rate,
+ m_map.setSize( m_widget->width(), m_widget->height() );
+ m_map.setShowFrameRate( false ); // never let the map draw the frame rate,
// we do this differently here in the widget
- m_widget->connect(this, SIGNAL(regionSelected(QList<double>)), m_widget, SIGNAL(regionSelected(QList<double>)));
+ m_widget->connect( &m_presenter, SIGNAL(regionSelected(QList<double>)), m_widget, SIGNAL(regionSelected(QList<double>)) );
- m_widget->connect(this, SIGNAL(updateRequired()),
- m_widget, SLOT(update()));
- m_widget->connect(this, SIGNAL(zoomChanged(int)), m_widget, SIGNAL(zoomChanged(int)));
- m_widget->connect(this, SIGNAL(distanceChanged(QString)), m_widget, SIGNAL(distanceChanged(QString)));
+ m_widget->connect( &m_presenter, SIGNAL(zoomChanged(int)), m_widget, SIGNAL(zoomChanged(int)) );
+ m_widget->connect( &m_presenter, SIGNAL(distanceChanged(QString)), m_widget, SIGNAL(distanceChanged(QString)) );
// forward some signals of m_map
- m_widget->connect( map(), SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)),
+ m_widget->connect( &m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)),
m_widget, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)) );
- m_widget->connect( map(), SIGNAL(projectionChanged(Projection)),
+ m_widget->connect( &m_map, SIGNAL(projectionChanged(Projection)),
m_widget, SIGNAL(projectionChanged(Projection)) );
- m_widget->connect( map(), SIGNAL(tileLevelChanged(int)),
+ m_widget->connect( &m_map, SIGNAL(tileLevelChanged(int)),
m_widget, SIGNAL(tileLevelChanged(int)) );
- m_widget->connect( map(), SIGNAL(framesPerSecond(qreal)),
+ m_widget->connect( &m_map, SIGNAL(framesPerSecond(qreal)),
m_widget, SIGNAL(framesPerSecond(qreal)) );
- m_widget->connect( map(), SIGNAL(viewContextChanged(ViewContext)),
+ m_widget->connect( &m_map, SIGNAL(viewContextChanged(ViewContext)),
m_widget, SLOT(setViewContext(ViewContext)) );
- m_widget->connect( map(), SIGNAL(pluginSettingsChanged()),
+ m_widget->connect( &m_map, SIGNAL(pluginSettingsChanged()),
m_widget, SIGNAL(pluginSettingsChanged()) );
- m_widget->connect( map(), SIGNAL(renderPluginInitialized(RenderPlugin*)),
+ m_widget->connect( &m_map, SIGNAL(renderPluginInitialized(RenderPlugin*)),
m_widget, SIGNAL(renderPluginInitialized(RenderPlugin*)) );
// react to some signals of m_map
- m_widget->connect( map(), SIGNAL(themeChanged(QString)),
+ m_widget->connect( &m_map, SIGNAL(themeChanged(QString)),
m_widget, SLOT(updateMapTheme()) );
- m_widget->connect( map(), SIGNAL(repaintNeeded(QRegion)),
+ m_widget->connect( &m_map, SIGNAL(repaintNeeded(QRegion)),
m_widget, SLOT(update()) );
- m_widget->connect( map(), SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)),
+ m_widget->connect( &m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)),
m_widget, SLOT(updateSystemBackgroundAttribute()) );
- m_widget->connect( map(), SIGNAL(renderStatusChanged(RenderStatus)),
+ m_widget->connect( &m_map, SIGNAL(renderStatusChanged(RenderStatus)),
m_widget, SIGNAL(renderStatusChanged(RenderStatus)) );
- m_widget->connect( map(), SIGNAL(renderStateChanged(RenderState)),
+ m_widget->connect( &m_map, SIGNAL(renderStateChanged(RenderState)),
m_widget, SIGNAL(renderStateChanged(RenderState)) );
- m_widget->connect( model()->fileManager(), SIGNAL(centeredDocument(GeoDataLatLonBox)),
+ m_widget->connect( m_model.fileManager(), SIGNAL(centeredDocument(GeoDataLatLonBox)),
m_widget, SLOT(centerOn(GeoDataLatLonBox)) );
// Show a progress dialog when the model calculates new map tiles.
- m_widget->connect( model(), SIGNAL( creatingTilesStart( TileCreator*, const QString&,
+ m_widget->connect( &m_model, SIGNAL( creatingTilesStart( TileCreator*, const QString&,
const QString& ) ),
m_widget, SLOT( creatingTilesStart( TileCreator*, const QString&,
const QString& ) ) );
- m_popupmenu = new MarbleWidgetPopupMenu( m_widget, model() );
+ m_popupmenu = new MarbleWidgetPopupMenu( m_widget, &m_model );
m_routingLayer = new RoutingLayer( m_widget, m_widget );
m_routingLayer->setPlacemarkModel( 0 );
@@ -237,12 +238,12 @@
m_mapInfoDialog = new PopupLayer( m_widget, m_widget );
m_mapInfoDialog->setVisible( false );
m_widget->connect( m_mapInfoDialog, SIGNAL(repaintNeeded()), m_widget, SLOT(update()) );
- map()->addLayer( m_mapInfoDialog );
+ m_map.addLayer( m_mapInfoDialog );
setInputHandler();
m_widget->setMouseTracking( true );
- map()->addLayer( &m_customPaintLayer );
+ m_map.addLayer( &m_customPaintLayer );
m_widget->connect( m_inputhandler, SIGNAL(mouseClickGeoPosition(qreal,qreal,GeoDataCoordinates::Unit)),
m_widget, SIGNAL(highlightedPlacemarksChanged(qreal,qreal,GeoDataCoordinates::Unit)) );
@@ -252,7 +253,7 @@
void MarbleWidgetPrivate::setInputHandler()
{
- setInputHandler(new MarbleWidgetInputHandler(this, m_widget));
+ setInputHandler( new MarbleWidgetInputHandler( &m_presenter, m_widget ) );
}
void MarbleWidgetPrivate::setInputHandler( MarbleWidgetInputHandler *handler )
@@ -264,10 +265,10 @@
{
m_widget->installEventFilter( m_inputhandler );
- connect( m_inputhandler, SIGNAL(mouseClickScreenPosition(int,int)),
+ QObject::connect( m_inputhandler, SIGNAL(mouseClickScreenPosition(int,int)),
m_widget, SLOT(notifyMouseClick(int,int)) );
- connect( m_inputhandler, SIGNAL(mouseMoveGeoPosition(QString)),
+ QObject::connect( m_inputhandler, SIGNAL(mouseMoveGeoPosition(QString)),
m_widget, SIGNAL(mouseMoveGeoPosition(QString)) );
}
}
@@ -276,7 +277,7 @@
{
// We only have to repaint the background every time if the earth
// doesn't cover the whole image.
- const bool isOn = map()->viewport()->mapCoversViewport() && !model()->mapThemeId().isEmpty();
+ const bool isOn = m_map.viewport()->mapCoversViewport() && !m_model.mapThemeId().isEmpty();
m_widget->setAttribute( Qt::WA_NoSystemBackground, isOn );
}
@@ -285,22 +286,22 @@
MarbleModel *MarbleWidget::model()
{
- return d->model();
+ return &d->m_model;
}
const MarbleModel *MarbleWidget::model() const
{
- return d->model();
+ return &d->m_model;
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarbleWidgetInputHandler.cpp
^
|
@@ -33,7 +33,7 @@
class MarbleWidgetSelectionRubber : public AbstractSelectionRubber
{
public:
- MarbleWidgetSelectionRubber(MarbleWidget *widget)
+ explicit MarbleWidgetSelectionRubber(MarbleWidget *widget)
: m_rubberBand(QRubberBand::Rectangle, widget)
{
m_rubberBand.hide();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MarbleZipReader.h
^
|
@@ -90,7 +90,7 @@
bool isReadable() const;
bool exists() const;
- struct Q_GUI_EXPORT FileInfo
+ struct MARBLE_EXPORT FileInfo
{
FileInfo();
FileInfo(const FileInfo &other);
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MergedLayerDecorator.cpp
^
|
@@ -25,7 +25,6 @@
#include "MarbleDebug.h"
#include "GeoDataGroundOverlay.h"
#include "GeoSceneTextureTileDataset.h"
-#include "GeoSceneVectorTileDataset.h"
#include "ImageF.h"
#include "StackedTile.h"
#include "TileLoaderHelper.h"
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/MovieCapture.cpp
^
|
@@ -22,7 +22,7 @@
class MovieCapturePrivate
{
public:
- MovieCapturePrivate(MarbleWidget *widget) :
+ explicit MovieCapturePrivate(MarbleWidget *widget) :
marbleWidget(widget), method(MovieCapture::TimeDriven)
{}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/NewstuffModel.cpp
^
|
@@ -110,7 +110,7 @@
QHash<int, QByteArray> m_roleNames;
- NewstuffModelPrivate( NewstuffModel* parent );
+ explicit NewstuffModelPrivate( NewstuffModel* parent );
QIcon preview( int index );
void setPreview( int index, const QIcon &previewIcon );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/ParsingRunnerManager.cpp
^
|
@@ -23,6 +23,7 @@
#include <QList>
#include <QThreadPool>
#include <QTimer>
+#include <QMutex>
namespace Marble
{
@@ -36,18 +37,20 @@
~Private();
- void cleanupParsingTask( ParsingTask *task );
+ void cleanupParsingTask();
void addParsingResult(GeoDataDocument *document, const QString &error);
ParsingRunnerManager *const q;
const PluginManager *const m_pluginManager;
- QList<ParsingTask *> m_parsingTasks;
+ QMutex m_parsingTasksMutex;
+ int m_parsingTasks;
GeoDataDocument *m_fileResult;
};
ParsingRunnerManager::Private::Private( ParsingRunnerManager *parent, const PluginManager *pluginManager ) :
q( parent ),
m_pluginManager( pluginManager ),
+ m_parsingTasks(0),
m_fileResult( 0 )
{
qRegisterMetaType<GeoDataDocument*>( "GeoDataDocument*" );
@@ -58,16 +61,11 @@
// nothing to do
}
-void ParsingRunnerManager::Private::cleanupParsingTask( ParsingTask *finishedTask )
+void ParsingRunnerManager::Private::cleanupParsingTask()
{
- for (int i=m_parsingTasks.size()-1; i>=0; --i) {
- if (m_parsingTasks[i] == finishedTask) {
- m_parsingTasks[i]->deleteLater();
- m_parsingTasks.removeAt(i);
- }
- }
-
- if ( m_parsingTasks.isEmpty() ) {
+ QMutexLocker locker(&m_parsingTasksMutex);
+ m_parsingTasks = qMax(0, m_parsingTasks-1);
+ if (m_parsingTasks == 0) {
emit q->parsingFinished();
}
}
@@ -93,22 +91,20 @@
const QString suffix = fileInfo.suffix().toLower();
const QString completeSuffix = fileInfo.completeSuffix().toLower();
+ d->m_parsingTasks = 0;
foreach( const ParseRunnerPlugin *plugin, plugins ) {
QStringList const extensions = plugin->fileExtensions();
if ( extensions.isEmpty() || extensions.contains( suffix ) || extensions.contains( completeSuffix ) ) {
ParsingTask *task = new ParsingTask( plugin->newRunner(), this, fileName, role );
- connect( task, SIGNAL(finished(ParsingTask*)), this, SLOT(cleanupParsingTask(ParsingTask*)) );
+ connect( task, SIGNAL(finished()), this, SLOT(cleanupParsingTask()) );
mDebug() << "parse task " << plugin->nameId() << " " << (quintptr)task;
- d->m_parsingTasks << task;
+ ++d->m_parsingTasks;
+ QThreadPool::globalInstance()->start( task );
}
}
- foreach ( ParsingTask *task, d->m_parsingTasks ) {
- QThreadPool::globalInstance()->start( task );
- }
-
- if ( d->m_parsingTasks.isEmpty() ) {
- d->cleanupParsingTask( 0 );
+ if (d->m_parsingTasks == 0) {
+ emit parsingFinished();
}
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/ParsingRunnerManager.h
^
|
@@ -26,7 +26,6 @@
class MarbleModel;
class PluginManager;
-class ParsingTask;
class MARBLE_EXPORT ParsingRunnerManager : public QObject
{
@@ -64,7 +63,7 @@
void parsingFinished();
private:
- Q_PRIVATE_SLOT( d, void cleanupParsingTask( ParsingTask *task ) )
+ Q_PRIVATE_SLOT( d, void cleanupParsingTask() )
Q_PRIVATE_SLOT( d, void addParsingResult( GeoDataDocument *document, const QString &error ) )
class Private;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/PlacemarkLayout.cpp
^
|
@@ -556,7 +556,7 @@
GeoDataStyle::ConstPtr style = placemark->style();
QRectF labelRect;
- if( !placemark->name().isEmpty() ) {
+ if( !placemark->displayName().isEmpty() ) {
labelRect = roomForLabel( style, x, y, placemark->name() );
if ( labelRect.isNull() ) {
return false;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/PlacemarkPositionProviderPlugin.h
^
|
@@ -30,7 +30,7 @@
Q_INTERFACES( Marble::PositionProviderPluginInterface )
public:
- PlacemarkPositionProviderPlugin( MarbleModel *marbleModel );
+ explicit PlacemarkPositionProviderPlugin( MarbleModel *marbleModel );
virtual QString name() const;
virtual QString nameId() const;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/PlaybackAnimatedUpdateItem.h
^
|
@@ -25,7 +25,7 @@
{
Q_OBJECT
public:
- PlaybackAnimatedUpdateItem( GeoDataAnimatedUpdate *animatedUpdate );
+ explicit PlaybackAnimatedUpdateItem( GeoDataAnimatedUpdate *animatedUpdate );
const GeoDataAnimatedUpdate* animatedUpdate() const;
double duration() const;
void play();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/PlaybackFlyToItem.h
^
|
@@ -21,7 +21,7 @@
{
Q_OBJECT
public:
- PlaybackFlyToItem( const GeoDataFlyTo* flyTo );
+ explicit PlaybackFlyToItem( const GeoDataFlyTo* flyTo );
const GeoDataFlyTo* flyTo() const;
double duration() const;
void play();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/PlaybackSoundCueItem.h
^
|
@@ -28,7 +28,7 @@
{
Q_OBJECT
public:
- PlaybackSoundCueItem( const GeoDataSoundCue* soundCue );
+ explicit PlaybackSoundCueItem( const GeoDataSoundCue* soundCue );
const GeoDataSoundCue* soundCue() const;
double duration() const;
void play();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/PlaybackTourControlItem.h
^
|
@@ -21,7 +21,7 @@
class PlaybackTourControlItem : public PlaybackItem
{
public:
- PlaybackTourControlItem( const GeoDataTourControl* tourControl );
+ explicit PlaybackTourControlItem( const GeoDataTourControl* tourControl );
const GeoDataTourControl* tourControl() const;
double duration() const;
void play();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/PlaybackWaitItem.h
^
|
@@ -21,7 +21,7 @@
{
Q_OBJECT
public:
- PlaybackWaitItem( const GeoDataWait* wait );
+ explicit PlaybackWaitItem( const GeoDataWait* wait );
const GeoDataWait* wait() const;
double duration() const;
void play();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/QtMarbleConfigDialog.cpp
^
|
@@ -576,7 +576,7 @@
int QtMarbleConfigDialog::volatileTileCacheLimit() const
{
- int defaultValue = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen ? 6 : 100;
+ int defaultValue = (MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen) ? 6 : 100;
return d->m_settings.value( "Cache/volatileTileCacheLimit", defaultValue ).toInt();
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/RouteSimulationPositionProviderPlugin.cpp
^
|
@@ -82,7 +82,7 @@
GeoDataCoordinates RouteSimulationPositionProviderPlugin::position() const
{
- return m_currentPosition;
+ return m_currentPositionWithNoise;
}
GeoDataAccuracy RouteSimulationPositionProviderPlugin::accuracy() const
@@ -104,7 +104,8 @@
m_status( PositionProviderStatusUnavailable ),
m_currentDateTime(),
m_speed( 0.0 ),
- m_direction( 0.0 )
+ m_direction( 0.0 ),
+ m_directionWithNoise(0.0)
{
// nothing to do
}
@@ -116,11 +117,9 @@
void RouteSimulationPositionProviderPlugin::initialize()
{
m_currentIndex = -1;
-
- m_lineString = m_marbleModel->routingManager()->routingModel()->route().path();
-
+ m_lineString = m_lineStringInterpolated = m_marbleModel->routingManager()->routingModel()->route().path();
+ m_speed = 0; //initialize speed to be around 25 m/s;
m_status = m_lineString.isEmpty() ? PositionProviderStatusUnavailable : PositionProviderStatusAcquiring;
-
if ( !m_lineString.isEmpty() ) {
QTimer::singleShot( 1000.0 / c_frequency, this, SLOT(update()) );
}
@@ -138,7 +137,7 @@
qreal RouteSimulationPositionProviderPlugin::direction() const
{
- return m_direction;
+ return m_directionWithNoise;
}
QDateTime RouteSimulationPositionProviderPlugin::timestamp() const
@@ -148,27 +147,105 @@
void RouteSimulationPositionProviderPlugin::update()
{
- ++m_currentIndex;
-
- if ( m_currentIndex >= 0 && m_currentIndex < m_lineString.size() ) {
+ if ( m_currentIndex >= 0 && m_currentIndex < m_lineStringInterpolated.size() ) {
if ( m_status != PositionProviderStatusAvailable ) {
m_status = PositionProviderStatusAvailable;
emit statusChanged( PositionProviderStatusAvailable );
}
- GeoDataCoordinates newPosition = m_lineString.at( m_currentIndex );
+ GeoDataCoordinates newPosition = m_lineStringInterpolated.at( m_currentIndex );
const QDateTime newDateTime = QDateTime::currentDateTime();
+ qreal time= m_currentDateTime.msecsTo(newDateTime)/1000.0;
if ( m_currentPosition.isValid() ) {
- m_speed = distanceSphere( m_currentPosition, newPosition ) * m_marbleModel->planetRadius() / ( m_currentDateTime.msecsTo( newDateTime ) ) * 1000;
+ //speed calculations
+ //Max speed is set on points (m_lineStringInterpolated) based on formula. (max speed before points is calculated so the acceleration won't be exceeded)
+ const qreal acceleration = 1.5;
+ const qreal lookForwardDistance = 1000;
+ qreal checkedDistance = distanceSphere( m_currentPosition, m_lineStringInterpolated.at(m_currentIndex) )* m_marbleModel->planetRadius();
+ const qreal maxSpeed = 25;
+ const qreal minSpeed = 2;
+ qreal newSpeed = qMin((m_speed + acceleration*time), maxSpeed);
+ for (int i=qMax(1,m_currentIndex); i<m_lineStringInterpolated.size()-1 && checkedDistance<lookForwardDistance; ++i)
+ {
+ qreal previousHeading = m_lineStringInterpolated.at( i-1 ).bearing( m_lineStringInterpolated.at( i ), GeoDataCoordinates::Degree, GeoDataCoordinates::FinalBearing );
+ qreal curveLength = 10;//we treat one point turn as a curve of length 10
+ qreal angleSum = 0;//sum of turn angles in a curve
+ for (int j=i+1; j<m_lineStringInterpolated.size() && curveLength<35; ++j)
+ {
+ qreal newHeading = m_lineStringInterpolated.at( j-1 ).bearing( m_lineStringInterpolated.at( j ), GeoDataCoordinates::Degree, GeoDataCoordinates::FinalBearing );
+ qreal differenceHeading = qAbs(previousHeading-newHeading);//angle of turn
+ if(differenceHeading>180) {
+ differenceHeading = 360 - differenceHeading;
+ }
+ angleSum +=differenceHeading;
+ qreal maxSpeedAtTurn = qMax((1 - (static_cast<qreal>(angleSum/60.0/curveLength*10.0))*maxSpeed), minSpeed);//speed limit at turn
+ if( checkedDistance<25 && maxSpeedAtTurn<newSpeed )//if we are near turn don't accelerate, if we will have to slow down
+ newSpeed = qMin(newSpeed, qMax(m_speed,maxSpeedAtTurn));
+ // formulas:
+ // s = Vc * t + a*t*t/2
+ // V0 = Vc + a*t
+ // V0 = maxCurrentSpeed
+ // Vc = maxSpeedAtTurn
+ // s = checkedDistance
+ // a = acceleration
+ qreal delta = maxSpeedAtTurn*maxSpeedAtTurn - 4.0*acceleration/2.0*(-checkedDistance);//delta = b*b-4*a*c
+ qreal t = (-maxSpeedAtTurn+sqrt(delta))/(2.0*acceleration/2.0);//(-b+sqrt(delta))/(2*c)
+ qreal maxCurrentSpeed = maxSpeedAtTurn + acceleration*t;
+ newSpeed = qMin(newSpeed, maxCurrentSpeed);
+ previousHeading = newHeading;
+ curveLength += distanceSphere( m_lineStringInterpolated.at( j-1 ), m_lineStringInterpolated.at( j ) )* m_marbleModel->planetRadius();
+ }
+ checkedDistance += distanceSphere( m_lineStringInterpolated.at( i ), m_lineStringInterpolated.at( i+1 ) )* m_marbleModel->planetRadius();
+ }
+ m_speed=newSpeed;
+
+ //Assume the car's moving at m_speed m/s. The distance moved will be speed*time which is equal to the speed of the car if time is equal to one.
+ //If the function isn't called once exactly after a second, multiplying by the time will compensate for the error and maintain the speed.
+ qreal fraction = m_speed*time/(distanceSphere( m_currentPosition, newPosition )* m_marbleModel->planetRadius());
+
+ //Interpolate and find the next point to move to if needed.
+ if(fraction>0 && fraction <1){
+ GeoDataCoordinates newPoint = m_currentPosition.interpolate(newPosition,fraction);
+ newPosition=newPoint;
+ }
+ else if ( fraction > 1 ) {
+ bool isCurrentIndexValid = true;
+ while ( fraction > 1 ) {
+ ++m_currentIndex;
+ if ( m_currentIndex >= m_lineStringInterpolated.size() ) {
+ isCurrentIndexValid = false;
+ break;
+ }
+
+ newPosition = m_lineStringInterpolated.at( m_currentIndex );
+ fraction = m_speed*time / (distanceSphere( m_currentPosition, newPosition )* m_marbleModel->planetRadius());
+ }
+
+ if ( isCurrentIndexValid ) {
+ GeoDataCoordinates newPoint = m_currentPosition.interpolate( newPosition, fraction );
+ newPosition = newPoint;
+ }
+ }
+ else
+ {
+ m_currentIndex++;
+ }
+
m_direction = m_currentPosition.bearing( newPosition, GeoDataCoordinates::Degree, GeoDataCoordinates::FinalBearing );
+ m_directionWithNoise = addNoise(m_direction);
}
m_currentPosition = newPosition;
+ m_currentPositionWithNoise = addNoise(m_currentPosition, accuracy());
m_currentDateTime = newDateTime;
emit positionChanged( position(), accuracy() );
}
else {
// Repeat from start
- m_currentIndex = -1;
+ m_currentIndex = 0;
+ m_lineStringInterpolated = m_lineString;
+ m_currentPosition = GeoDataCoordinates(); //Reset The current position so that the the simulation starts from the correct starting point.
+ m_currentPositionWithNoise = GeoDataCoordinates();
+ m_speed = 0;
if ( m_status != PositionProviderStatusUnavailable ) {
m_status = PositionProviderStatusUnavailable;
emit statusChanged( PositionProviderStatusUnavailable );
@@ -178,6 +255,19 @@
QTimer::singleShot( 1000.0 / c_frequency, this, SLOT(update()) );
}
+GeoDataCoordinates RouteSimulationPositionProviderPlugin::addNoise(const Marble::GeoDataCoordinates &position, const Marble::GeoDataAccuracy &accuracy ) const
+{
+ qreal randomBearing = static_cast<qreal>(qrand()) / (static_cast<qreal>(RAND_MAX/M_PI));
+ qreal randomDistance = static_cast<qreal>(qrand()) / (static_cast<qreal>(RAND_MAX/(accuracy.horizontal / 2.0 / m_marbleModel->planetRadius())));
+ return position.moveByBearing(randomBearing, randomDistance);
+}
+
+qreal RouteSimulationPositionProviderPlugin::addNoise(qreal bearing) const
+{
+ qreal const maxBearingError = 30.0;
+ return bearing + static_cast<qreal>(qrand()) / (static_cast<qreal>(RAND_MAX/maxBearingError/2.0)) - maxBearingError / 2.0;
+}
+
} // namespace Marble
#include "moc_RouteSimulationPositionProviderPlugin.cpp"
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/RouteSimulationPositionProviderPlugin.h
^
|
@@ -30,7 +30,7 @@
Q_INTERFACES( Marble::PositionProviderPluginInterface )
public:
- RouteSimulationPositionProviderPlugin( MarbleModel *marbleModel );
+ explicit RouteSimulationPositionProviderPlugin( MarbleModel *marbleModel );
virtual ~RouteSimulationPositionProviderPlugin();
// Implementing PluginInterface
@@ -61,14 +61,20 @@
void update();
private:
+ GeoDataCoordinates addNoise(const Marble::GeoDataCoordinates &,const Marble::GeoDataAccuracy &) const;
+ qreal addNoise(qreal bearing) const;
+
MarbleModel *const m_marbleModel;
int m_currentIndex;
PositionProviderStatus m_status;
GeoDataLineString m_lineString;
+ GeoDataLineString m_lineStringInterpolated;
GeoDataCoordinates m_currentPosition;
+ GeoDataCoordinates m_currentPositionWithNoise;
QDateTime m_currentDateTime;
qreal m_speed;
qreal m_direction;
+ qreal m_directionWithNoise;
};
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/RunnerTask.cpp
^
|
@@ -97,7 +97,7 @@
GeoDataDocument* document = m_runner->parseFile( m_fileName, m_role, error );
emit parsed(document, error);
m_runner->deleteLater();
- emit finished( this );
+ emit finished();
}
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/RunnerTask.h
^
|
@@ -112,7 +112,7 @@
Q_SIGNALS:
void parsed(GeoDataDocument* document, const QString &error);
- void finished( ParsingTask *task );
+ void finished();
private:
ParsingRunner *const m_runner;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/ServerLayout.cpp
^
|
@@ -38,9 +38,8 @@
QUrl MarbleServerLayout::downloadUrl( const QUrl &prototypeUrl, const TileId &id ) const
{
- const QString path = QString( "%1maps/%2/%3/%4/%4_%5.%6" )
+ const QString path = QString( "%1/%2/%3/%3_%4.%5" )
.arg( prototypeUrl.path() )
- .arg( m_textureLayer->sourceDir() )
.arg( id.zoomLevel() )
.arg( id.y(), tileDigits, 10, QChar('0') )
.arg( id.x(), tileDigits, 10, QChar('0') )
@@ -57,6 +56,11 @@
return "Marble";
}
+QString ServerLayout::sourceDir() const
+{
+ return m_textureLayer ? m_textureLayer->sourceDir() : QString();
+}
+
OsmServerLayout::OsmServerLayout( GeoSceneTileDataset *textureLayer )
: ServerLayout( textureLayer )
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/ServerLayout.h
^
|
@@ -40,6 +40,11 @@
*/
virtual QString name() const = 0;
+ /**
+ * Returns the sourceDir of the texture layer, or an empty string if the texture layer is 0
+ */
+ QString sourceDir() const;
+
protected:
GeoSceneTileDataset *const m_textureLayer;
};
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/SoundTrack.h
^
|
@@ -24,7 +24,7 @@
Q_OBJECT
public:
- SoundTrack( PlaybackSoundCueItem* item );
+ explicit SoundTrack( PlaybackSoundCueItem* item );
void setDelayBeforeTrackStarts( double delay );
double delayBeforeTrackStarts() const;
void play();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/StackedTileLoader.cpp
^
|
@@ -43,7 +43,7 @@
class StackedTileLoaderPrivate
{
public:
- StackedTileLoaderPrivate( MergedLayerDecorator *mergedLayerDecorator )
+ explicit StackedTileLoaderPrivate( MergedLayerDecorator *mergedLayerDecorator )
: m_layerDecorator( mergedLayerDecorator )
{
m_tileCache.setMaxCost( 20000 * 1024 ); // Cache size measured in bytes
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/TileCreator.cpp
^
|
@@ -71,7 +71,7 @@
class TileCreatorSourceImage : public TileCreatorSource
{
public:
- TileCreatorSourceImage( const QString &sourcePath )
+ explicit TileCreatorSourceImage( const QString &sourcePath )
: m_sourceImage( QImage( sourcePath ) ),
m_cachedRowNum( -1 )
{
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/TileLoader.h
^
|
@@ -76,7 +76,7 @@
*/
static TileStatus tileStatus( GeoSceneTileDataset const *tileData, const TileId &tileId );
- public Q_SLOTS:
+ private Q_SLOTS:
void updateTile( QByteArray const & imageData, QString const & tileId );
void updateTile( QString const & fileName, QString const & idStr );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/TourPlayback.cpp
^
|
@@ -15,6 +15,7 @@
#include <QSlider>
#include <qurl.h>
#include <QtCore/qnamespace.h>
+#include <QPointer>
#include "MarbleDebug.h"
#include "MarbleWidget.h"
@@ -52,7 +53,7 @@
QList<SoundTrack*> m_soundTracks;
QList<AnimatedUpdateTrack*> m_animatedUpdateTracks;
GeoDataFlyTo m_mapCenter;
- MarbleWidget *m_widget;
+ QPointer<MarbleWidget> m_widget;
QUrl m_baseUrl;
};
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/TourWidget.cpp
^
|
@@ -70,7 +70,7 @@
{
public:
- TourWidgetPrivate( TourWidget *parent );
+ explicit TourWidgetPrivate( TourWidget *parent );
GeoDataFeature *getPlaylistFeature() const;
void updateRootIndex();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/TourWidget.h
^
|
@@ -17,7 +17,7 @@
#include <QWidget>
#include <QStyledItemDelegate>
#include <QListView>
-#include <GeoDataCoordinates.h>
+#include "GeoDataCoordinates.h"
class QItemSelection;
class QModelIndex;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/VectorTileModel.h
^
|
@@ -108,9 +108,9 @@
QThreadPool *const m_threadPool;
int m_tileLoadLevel;
int m_tileZoomLevel;
- QMap<TileId, QSharedPointer<CacheDocument> > m_documents;
QList<TileId> m_pendingDocuments;
QList<GeoDataDocument*> m_garbageQueue;
+ QMap<TileId, QSharedPointer<CacheDocument> > m_documents;
};
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/VisiblePlacemark.cpp
^
|
@@ -135,7 +135,7 @@
{
GeoDataStyle::ConstPtr style = m_placemark->style();
- QString labelName = m_placemark->name();
+ QString labelName = m_placemark->displayName();
if ( labelName.isEmpty() || style->labelStyle().color() == QColor(Qt::transparent) ) {
m_labelPixmap = QPixmap();
return;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/blendings/BlendingAlgorithms.cpp
^
|
@@ -177,7 +177,7 @@
qreal DivideBlending::blendChannel( qreal const bottomColorIntensity,
qreal const topColorIntensity ) const
{
- return log( 1.0 + bottomColorIntensity / ( 1.0 - topColorIntensity ) / 8.0) / log(2.0);
+ return log1p( bottomColorIntensity / ( 1.0 - topColorIntensity ) / 8.0) / log(2.0);
}
qreal GammaDarkBlending::blendChannel( qreal const bottomColorIntensity,
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/declarative/Bookmarks.cpp
^
|
@@ -97,9 +97,6 @@
Marble::GeoDataCoordinates coordinate( longitude, latitude, 0.0, Marble::GeoDataCoordinates::Degree );
placemark.setCoordinate( coordinate );
placemark.setName( name );
- Marble::GeoDataLookAt* lookat = new Marble::GeoDataLookAt;
- lookat->setCoordinates( coordinate );
- lookat->setRange( 750 );
placemark.extendedData().addValue( Marble::GeoDataData( "isBookmark", true ) );
manager->addBookmark( target, placemark );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/declarative/DeclarativeDataPlugin.cpp
^
|
@@ -45,7 +45,7 @@
static int m_global_counter;
int m_counter;
- DeclarativeDataPluginPrivate( DeclarativeDataPlugin* q );
+ explicit DeclarativeDataPluginPrivate( DeclarativeDataPlugin* q );
static void parseChunk( DeclarativeDataPluginItem * item, GeoDataCoordinates &coordinates, const QString &key, const QVariant &value );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/declarative/MarbleQuickItem.cpp
^
|
@@ -131,21 +131,26 @@
bool m_usePinchArea;
};
- class MarbleQuickItemPrivate : public MarbleAbstractPresenter
+ class MarbleQuickItemPrivate
{
public:
- MarbleQuickItemPrivate(MarbleQuickItem *marble) : MarbleAbstractPresenter()
- ,m_marble(marble)
- ,m_positionVisible(false)
- ,m_inputHandler(this, marble)
+ explicit MarbleQuickItemPrivate(MarbleQuickItem *marble) :
+ m_marble(marble),
+ m_model(),
+ m_map(&m_model),
+ m_presenter(&m_map),
+ m_positionVisible(false),
+ m_inputHandler(&m_presenter, marble)
{
- m_currentPosition.setName(tr("Current Location"));
- connect(this, SIGNAL(updateRequired()), m_marble, SLOT(update()));
+ m_currentPosition.setName(QObject::tr("Current Location"));
}
private:
MarbleQuickItem *m_marble;
friend class MarbleQuickItem;
+ MarbleModel m_model;
+ MarbleMap m_map;
+ MarbleAbstractPresenter m_presenter;
bool m_positionVisible;
Placemark m_currentPosition;
@@ -155,7 +160,7 @@
MarbleQuickItem::MarbleQuickItem(QQuickItem *parent) : QQuickPaintedItem(parent)
,d(new MarbleQuickItemPrivate(this))
{
- foreach (AbstractFloatItem *item, d->map()->floatItems()) {
+ foreach (AbstractFloatItem *item, d->m_map.floatItems()) {
if (item->nameId() == "license") {
item->setPosition(QPointF(5.0, -10.0));
} else {
@@ -163,12 +168,12 @@
}
}
- connect(d->map(), SIGNAL(repaintNeeded(QRegion)), this, SLOT(update()));
+ connect(&d->m_map, SIGNAL(repaintNeeded(QRegion)), this, SLOT(update()));
connect(this, SIGNAL(widthChanged()), this, SLOT(resizeMap()));
connect(this, SIGNAL(heightChanged()), this, SLOT(resizeMap()));
- connect(d->map(), SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SLOT(updatePositionVisibility()));
- connect(d->map(), SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SIGNAL(visibleLatLonAltBoxChanged()));
- connect(d->map(), SIGNAL(radiusChanged(int)), this, SIGNAL(zoomChanged()));
+ connect(&d->m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SLOT(updatePositionVisibility()));
+ connect(&d->m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SIGNAL(visibleLatLonAltBoxChanged()));
+ connect(&d->m_map, SIGNAL(radiusChanged(int)), this, SIGNAL(zoomChanged()));
setAcceptedMouseButtons(Qt::AllButtons);
installEventFilter(&d->m_inputHandler);
@@ -181,7 +186,7 @@
int newWidth = width() > minWidth ? (int)width() : minWidth;
int newHeight = height() > minHeight ? (int)height() : minHeight;
- d->map()->setSize(newWidth, newHeight);
+ d->m_map.setSize(newWidth, newHeight);
update();
updatePositionVisibility();
}
@@ -205,7 +210,7 @@
{
bool isVisible = false;
if ( positionAvailable() ) {
- if ( d->map()->viewport()->viewLatLonAltBox().contains(d->model()->positionTracking()->currentLocation()) ) {
+ if ( d->m_map.viewport()->viewLatLonAltBox().contains(d->m_model.positionTracking()->currentLocation()) ) {
isVisible = true;
}
}
@@ -225,13 +230,12 @@
void MarbleQuickItem::paint(QPainter *painter)
{ //TODO - much to be done here still, i.e paint !enabled version
QPaintDevice *paintDevice = painter->device();
- QImage image;
QRect rect = contentsBoundingRect().toRect();
+ painter->end();
{
- painter->end();
- GeoPainter geoPainter(paintDevice, d->map()->viewport(), d->map()->mapQuality());
- d->map()->paint(geoPainter, rect);
+ GeoPainter geoPainter(paintDevice, d->m_map.viewport(), d->m_map.mapQuality());
+ d->m_map.paint(geoPainter, rect);
}
painter->begin(paintDevice);
}
@@ -246,77 +250,77 @@
int MarbleQuickItem::mapWidth() const
{
- return d->map()->width();
+ return d->m_map.width();
}
int MarbleQuickItem::mapHeight() const
{
- return d->map()->height();
+ return d->m_map.height();
}
bool MarbleQuickItem::showFrameRate() const
{
- return d->map()->showFrameRate();
+ return d->m_map.showFrameRate();
}
MarbleQuickItem::Projection MarbleQuickItem::projection() const
{
- return (Projection)d->map()->projection();
+ return (Projection)d->m_map.projection();
}
QString MarbleQuickItem::mapThemeId() const
{
- return d->map()->mapThemeId();
+ return d->m_map.mapThemeId();
}
bool MarbleQuickItem::showAtmosphere() const
{
- return d->map()->showAtmosphere();
+ return d->m_map.showAtmosphere();
}
bool MarbleQuickItem::showCompass() const
{
- return d->map()->showCompass();
+ return d->m_map.showCompass();
}
bool MarbleQuickItem::showClouds() const
{
- return d->map()->showClouds();
+ return d->m_map.showClouds();
}
bool MarbleQuickItem::showCrosshairs() const
{
- return d->map()->showCrosshairs();
+ return d->m_map.showCrosshairs();
}
bool MarbleQuickItem::showGrid() const
{
- return d->map()->showGrid();
+ return d->m_map.showGrid();
}
bool MarbleQuickItem::showOverviewMap() const
{
- return d->map()->showOverviewMap();
+ return d->m_map.showOverviewMap();
}
bool MarbleQuickItem::showOtherPlaces() const
{
- return d->map()->showOtherPlaces();
+ return d->m_map.showOtherPlaces();
}
bool MarbleQuickItem::showScaleBar() const
{
- return d->map()->showScaleBar();
+ return d->m_map.showScaleBar();
}
bool MarbleQuickItem::showBackground() const
{
- return d->map()->showBackground();
+ return d->m_map.showBackground();
}
bool MarbleQuickItem::showPositionMarker() const
{
- QList<RenderPlugin *> plugins = d->map()->renderPlugins();
+ QList<RenderPlugin *> plugins = d->m_map.renderPlugins();
foreach (const RenderPlugin * plugin, plugins) {
if (plugin->nameId() == "positionMarker") {
return plugin->visible();
@@ -327,8 +331,8 @@
QString MarbleQuickItem::positionProvider() const
{
- if ( this->model()->positionTracking()->positionProviderPlugin() ) {
- return this->model()->positionTracking()->positionProviderPlugin()->nameId();
+ if ( d->m_model.positionTracking()->positionProviderPlugin() ) {
+ return d->m_model.positionTracking()->positionProviderPlugin()->nameId();
}
return QString();
@@ -336,22 +340,22 @@
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/declarative/MarbleQuickItem.h
^
|
@@ -59,7 +59,7 @@
Q_PROPERTY(bool inertialGlobeRotation READ inertialGlobeRotation WRITE setInertialGlobeRotation NOTIFY inertialGlobeRotationChanged)
public:
- MarbleQuickItem(QQuickItem *parent = 0);
+ explicit MarbleQuickItem(QQuickItem *parent = 0);
enum Projection{
Spherical = Marble::Spherical,
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/declarative/Routing.cpp
^
|
@@ -33,7 +33,7 @@
class RoutingPrivate
{
public:
- RoutingPrivate(QObject * parent = nullptr);
+ explicit RoutingPrivate(QObject * parent = nullptr);
MarbleMap* m_marbleMap;
QMap<QString, Marble::RoutingProfile> m_profiles;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/declarative/SearchBackend.cpp
^
|
@@ -43,8 +43,15 @@
void SearchBackend::setCompletionPrefix(const QString &prefix)
{
if( m_completer != nullptr && m_completer->completionPrefix() != prefix ) {
+ if (!m_lastSuccessfulCompletion.isEmpty()
+ && prefix.startsWith(m_lastSuccessfulCompletion)
+ && prefix.size() > m_lastSuccessfulCompletion.size()) {
+ return;
+ }
+
m_completionModel->removePlacemarks(QString("Completion model"), 0, m_completionModel->rowCount());
m_completionContainer->clear();
+ QString const lastPrefix = m_completer->completionPrefix();
m_completer->setCompletionPrefix(prefix);
if( prefix.isEmpty() ) {
emit completionModelChanged(m_completionModel);
@@ -60,6 +67,11 @@
container->append(placemark);
}
}
+ if (container->isEmpty() && prefix.startsWith(lastPrefix) ) {
+ m_lastSuccessfulCompletion = lastPrefix;
+ } else if (!container->isEmpty()) {
+ m_lastSuccessfulCompletion.clear();
+ }
m_completionModel->setPlacemarkContainer(container);
m_completionModel->addPlacemarks(0, container->size());
delete m_completionContainer;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/declarative/SearchBackend.h
^
|
@@ -32,7 +32,7 @@
Q_PROPERTY(Placemark* selectedPlacemark READ selectedPlacemark NOTIFY selectedPlacemarkChanged)
public:
- SearchBackend(QObject *parent = 0);
+ explicit SearchBackend(QObject *parent = 0);
Q_INVOKABLE void search(const QString &place);
Q_INVOKABLE void setCompletionPrefix(const QString &prefix);
QObject *marbleQuickItem();
@@ -62,6 +62,7 @@
MarblePlacemarkModel *m_completionModel;
QVector<GeoDataPlacemark*> *m_completionContainer;
Placemark m_selectedPlacemark;
+ QString m_lastSuccessfulCompletion;
};
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/CMakeLists.txt
^
|
@@ -191,6 +191,8 @@
geodata/handlers/dgml/DgmlSettingsTagHandler.cpp
geodata/handlers/dgml/DgmlAuxillaryDictionary.h
geodata/handlers/dgml/DgmlLayerTagHandler.h
+ geodata/handlers/dgml/DgmlRenderOrderTagHandler.cpp
+ geodata/handlers/dgml/DgmlRenderOrderTagHandler.h
)
SET ( geodata_writers_dgml_SRCS
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/data/GeoDataCoordinates.cpp
^
|
@@ -620,6 +620,9 @@
*/
GeoDataCoordinates::~GeoDataCoordinates()
{
+ delete d->m_q;
+ d->m_q = 0;
+
if (!d->ref.deref())
delete d;
#ifdef DEBUG_GEODATA
@@ -640,8 +643,11 @@
* this state shouldn't happen, but if it does, we have to clean up behind us.
*/
void GeoDataCoordinates::detach()
-{
+{
if(d->ref.load() == 1) {
+ delete d->m_q;
+ d->m_q = 0;
+
return;
}
@@ -664,12 +670,10 @@
switch( unit ){
default:
case Radian:
- d->m_q = Quaternion::fromSpherical( _lon, _lat );
d->m_lon = _lon;
d->m_lat = _lat;
break;
case Degree:
- d->m_q = Quaternion::fromSpherical( _lon * DEG2RAD , _lat * DEG2RAD );
d->m_lon = _lon * DEG2RAD;
d->m_lat = _lat * DEG2RAD;
break;
@@ -685,11 +689,9 @@
switch( unit ){
default:
case Radian:
- d->m_q = Quaternion::fromSpherical( _lon, d->m_lat );
d->m_lon = _lon;
break;
case Degree:
- d->m_q = Quaternion::fromSpherical( _lon * DEG2RAD , d->m_lat );
d->m_lon = _lon * DEG2RAD;
break;
}
@@ -704,11 +706,9 @@
detach();
switch( unit ){
case Radian:
- d->m_q = Quaternion::fromSpherical( d->m_lon, _lat );
d->m_lat = _lat;
break;
case Degree:
- d->m_q = Quaternion::fromSpherical( d->m_lon, _lat * DEG2RAD );
d->m_lat = _lat * DEG2RAD;
break;
}
@@ -1318,13 +1318,17 @@
const Quaternion& GeoDataCoordinates::quaternion() const
{
- return d->m_q;
+ if (d->m_q == 0) {
+ d->m_q = new Quaternion();
+ *d->m_q = Quaternion::fromSpherical( d->m_lon , d->m_lat );
+ }
+ return *d->m_q;
}
GeoDataCoordinates GeoDataCoordinates::interpolate( const GeoDataCoordinates &target, double t_ ) const
{
double const t = qBound( 0.0, t_, 1.0 );
- Quaternion const quat = Quaternion::slerp( d->m_q, target.d->m_q, t );
+ Quaternion const quat = Quaternion::slerp( quaternion(), target.quaternion(), t );
qreal lon, lat;
quat.getSpherical( lon, lat );
double const alt = (1.0-t) * d->m_altitude + t * target.d->m_altitude;
@@ -1334,9 +1338,9 @@
GeoDataCoordinates GeoDataCoordinates::interpolate( const GeoDataCoordinates &before, const GeoDataCoordinates &target, const GeoDataCoordinates &after, double t_ ) const
{
double const t = qBound( 0.0, t_, 1.0 );
- Quaternion const b1 = GeoDataCoordinatesPrivate::basePoint( before.d->m_q, d->m_q, target.d->m_q );
- Quaternion const a2 = GeoDataCoordinatesPrivate::basePoint( d->m_q, target.d->m_q, after.d->m_q );
- Quaternion const a = Quaternion::slerp( d->m_q, target.d->m_q, t );
+ Quaternion const b1 = GeoDataCoordinatesPrivate::basePoint( before.quaternion(), quaternion(), target.quaternion() );
+ Quaternion const a2 = GeoDataCoordinatesPrivate::basePoint( quaternion(), target.quaternion(), after.quaternion() );
+ Quaternion const a = Quaternion::slerp( quaternion(), target.quaternion(), t );
Quaternion const b = Quaternion::slerp( b1, a2, t );
Quaternion c = Quaternion::slerp( a, b, 2 * t * (1.0-t) );
qreal lon, lat;
@@ -1422,8 +1426,6 @@
stream >> d->m_lon;
stream >> d->m_lat;
stream >> d->m_altitude;
-
- d->m_q = Quaternion::fromSpherical( d->m_lon, d->m_lat );
}
Quaternion GeoDataCoordinatesPrivate::basePoint( const Quaternion &q1, const Quaternion &q2, const Quaternion &q3 )
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/data/GeoDataCoordinates_p.h
^
|
@@ -28,7 +28,8 @@
* needs this name. Maybe we can rename it to our scheme later on.
*/
GeoDataCoordinatesPrivate()
- : m_lon( 0 ),
+ : m_q( 0 ),
+ m_lon( 0 ),
m_lat( 0 ),
m_altitude( 0 ),
m_detail( 0 ),
@@ -46,19 +47,18 @@
GeoDataCoordinatesPrivate( qreal _lon, qreal _lat, qreal _alt,
GeoDataCoordinates::Unit unit,
int _detail )
- : m_altitude( _alt ),
+ : m_q( 0 ),
+ m_altitude( _alt ),
m_detail( _detail ),
ref( 0 )
{
switch( unit ){
default:
case GeoDataCoordinates::Radian:
- m_q = Quaternion::fromSpherical( _lon, _lat );
m_lon = _lon;
m_lat = _lat;
break;
case GeoDataCoordinates::Degree:
- m_q = Quaternion::fromSpherical( _lon * DEG2RAD , _lat * DEG2RAD );
m_lon = _lon * DEG2RAD;
m_lat = _lat * DEG2RAD;
break;
@@ -70,7 +70,7 @@
* initialize the reference with the value of the other
*/
GeoDataCoordinatesPrivate( const GeoDataCoordinatesPrivate &other )
- : m_q( Quaternion::fromSpherical( other.m_lon, other.m_lat ) ),
+ : m_q( 0 ),
m_lon( other.m_lon ),
m_lat( other.m_lat ),
m_altitude( other.m_altitude ),
@@ -88,8 +88,9 @@
m_lat = other.m_lat;
m_altitude = other.m_altitude;
m_detail = other.m_detail;
- m_q = other.m_q;
ref = 0;
+ delete m_q;
+ m_q = 0;
return *this;
}
@@ -201,7 +202,7 @@
*/
static qreal lonLatToEasting( qreal lon, qreal lat );
- Quaternion m_q;
+ Quaternion * m_q;
qreal m_lon;
qreal m_lat;
qreal m_altitude; // in meters above sea level
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/data/GeoDataDocument.h
^
|
@@ -32,7 +32,7 @@
#include "GeoDataContainer.h"
#include "GeoDocument.h"
-#include <GeoDataStyle.h>
+#include "GeoDataStyle.h"
namespace Marble
{
@@ -164,7 +164,7 @@
GeoDataStyleMap styleMap( const QString& styleId ) const;
/**
- * @brief dump a Vector of all styles
+ * @brief dump a Vector of all stylemaps
*/
QList<GeoDataStyleMap> styleMaps() const;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/data/GeoDataFeature.cpp
^
|
@@ -16,6 +16,7 @@
#include <QDataStream>
#include <QSize>
#include <QPixmap>
+#include <QHash>
#include "MarbleDirs.h"
#include "MarbleDebug.h"
@@ -675,6 +676,282 @@
return GeoDataFeaturePrivate::s_defaultStyle[ category ];
}
+QString GeoDataFeature::visualCategoryName(GeoDataFeature::GeoDataVisualCategory category)
+{
+ static QHash<GeoDataFeature::GeoDataVisualCategory, QString> s_visualCategoryNames;
+ if (s_visualCategoryNames.isEmpty()) {
+ s_visualCategoryNames[None] = "None";
+ s_visualCategoryNames[Default] = "Default";
+ s_visualCategoryNames[Unknown] = "Unknown";
+ s_visualCategoryNames[SmallCity] = "SmallCity";
+ s_visualCategoryNames[SmallCountyCapital] = "SmallCountyCapital";
+ s_visualCategoryNames[SmallStateCapital] = "SmallStateCapital";
+ s_visualCategoryNames[SmallNationCapital] = "SmallNationCapital";
+ s_visualCategoryNames[MediumCity] = "MediumCity";
+ s_visualCategoryNames[MediumCountyCapital] = "MediumCountyCapital";
+ s_visualCategoryNames[MediumStateCapital] = "MediumStateCapital";
+ s_visualCategoryNames[MediumNationCapital] = "MediumNationCapital";
+ s_visualCategoryNames[BigCity] = "BigCity";
+ s_visualCategoryNames[BigCountyCapital] = "BigCountyCapital";
+ s_visualCategoryNames[BigStateCapital] = "BigStateCapital";
+ s_visualCategoryNames[BigNationCapital] = "BigNationCapital";
+ s_visualCategoryNames[LargeCity] = "LargeCity";
+ s_visualCategoryNames[LargeCountyCapital] = "LargeCountyCapital";
+ s_visualCategoryNames[LargeStateCapital] = "LargeStateCapital";
+ s_visualCategoryNames[LargeNationCapital] = "LargeNationCapital";
+ s_visualCategoryNames[Nation] = "Nation";
+ s_visualCategoryNames[PlaceCity] = "PlaceCity";
+ s_visualCategoryNames[PlaceSuburb] = "PlaceSuburb";
+ s_visualCategoryNames[PlaceHamlet] = "PlaceHamlet";
+ s_visualCategoryNames[PlaceLocality] = "PlaceLocality";
+ s_visualCategoryNames[PlaceTown] = "PlaceTown";
+ s_visualCategoryNames[PlaceVillage] = "PlaceVillage";
+ s_visualCategoryNames[Mountain] = "Mountain";
+ s_visualCategoryNames[Volcano] = "Volcano";
+ s_visualCategoryNames[Mons] = "Mons";
+ s_visualCategoryNames[Valley] = "Valley";
+ s_visualCategoryNames[Continent] = "Continent";
+ s_visualCategoryNames[Ocean] = "Ocean";
+ s_visualCategoryNames[OtherTerrain] = "OtherTerrain";
+ s_visualCategoryNames[Crater] = "Crater";
+ s_visualCategoryNames[Mare] = "Mare";
+ s_visualCategoryNames[GeographicPole] = "GeographicPole";
+ s_visualCategoryNames[MagneticPole] = "MagneticPole";
+ s_visualCategoryNames[ShipWreck] = "ShipWreck";
+ s_visualCategoryNames[AirPort] = "AirPort";
+ s_visualCategoryNames[Observatory] = "Observatory";
+ s_visualCategoryNames[MilitaryDangerArea] = "MilitaryDangerArea";
+ s_visualCategoryNames[Wikipedia] = "Wikipedia";
+ s_visualCategoryNames[OsmSite] = "OsmSite";
+ s_visualCategoryNames[Coordinate] = "Coordinate";
+ s_visualCategoryNames[MannedLandingSite] = "MannedLandingSite";
+ s_visualCategoryNames[RoboticRover] = "RoboticRover";
+ s_visualCategoryNames[UnmannedSoftLandingSite] = "UnmannedSoftLandingSite";
+ s_visualCategoryNames[UnmannedHardLandingSite] = "UnmannedHardLandingSite";
+ s_visualCategoryNames[Folder] = "Folder";
+ s_visualCategoryNames[Bookmark] = "Bookmark";
+ s_visualCategoryNames[NaturalWater] = "NaturalWater";
+ s_visualCategoryNames[NaturalWood] = "NaturalWood";
+ s_visualCategoryNames[NaturalBeach] = "NaturalBeach";
+ s_visualCategoryNames[NaturalWetland] = "NaturalWetland";
+ s_visualCategoryNames[NaturalGlacier] = "NaturalGlacier";
+ s_visualCategoryNames[NaturalScrub] = "NaturalScrub";
+ s_visualCategoryNames[NaturalCliff] = "NaturalCliff";
+ s_visualCategoryNames[NaturalHeath] = "NaturalHeath";
+ s_visualCategoryNames[HighwayTrafficSignals] = "HighwayTrafficSignals";
+ s_visualCategoryNames[HighwaySteps] = "HighwaySteps";
+ s_visualCategoryNames[HighwayUnknown] = "HighwayUnknown";
+ s_visualCategoryNames[HighwayPath] = "HighwayPath";
+ s_visualCategoryNames[HighwayFootway] = "HighwayFootway";
+ s_visualCategoryNames[HighwayTrack] = "HighwayTrack";
+ s_visualCategoryNames[HighwayPedestrian] = "HighwayPedestrian";
+ s_visualCategoryNames[HighwayCycleway] = "HighwayCycleway";
+ s_visualCategoryNames[HighwayService] = "HighwayService";
+ s_visualCategoryNames[HighwayRoad] = "HighwayRoad";
+ s_visualCategoryNames[HighwayResidential] = "HighwayResidential";
+ s_visualCategoryNames[HighwayLivingStreet] = "HighwayLivingStreet";
+ s_visualCategoryNames[HighwayUnclassified] = "HighwayUnclassified";
+ s_visualCategoryNames[HighwayTertiaryLink] = "HighwayTertiaryLink";
+ s_visualCategoryNames[HighwayTertiary] = "HighwayTertiary";
+ s_visualCategoryNames[HighwaySecondaryLink] = "HighwaySecondaryLink";
+ s_visualCategoryNames[HighwaySecondary] = "HighwaySecondary";
+ s_visualCategoryNames[HighwayPrimaryLink] = "HighwayPrimaryLink";
+ s_visualCategoryNames[HighwayPrimary] = "HighwayPrimary";
+ s_visualCategoryNames[HighwayTrunkLink] = "HighwayTrunkLink";
+ s_visualCategoryNames[HighwayTrunk] = "HighwayTrunk";
+ s_visualCategoryNames[HighwayMotorwayLink] = "HighwayMotorwayLink";
+ s_visualCategoryNames[HighwayMotorway] = "HighwayMotorway";
+ s_visualCategoryNames[Building] = "Building";
+ s_visualCategoryNames[AccomodationCamping] = "AccomodationCamping";
+ s_visualCategoryNames[AccomodationHostel] = "AccomodationHostel";
+ s_visualCategoryNames[AccomodationHotel] = "AccomodationHotel";
+ s_visualCategoryNames[AccomodationMotel] = "AccomodationMotel";
+ s_visualCategoryNames[AccomodationYouthHostel] = "AccomodationYouthHostel";
+ s_visualCategoryNames[AccomodationGuestHouse] = "AccomodationGuestHouse";
+ s_visualCategoryNames[AmenityLibrary] = "AmenityLibrary";
+ s_visualCategoryNames[EducationCollege] = "EducationCollege";
+ s_visualCategoryNames[EducationSchool] = "EducationSchool";
+ s_visualCategoryNames[EducationUniversity] = "EducationUniversity";
+ s_visualCategoryNames[FoodBar] = "FoodBar";
+ s_visualCategoryNames[FoodBiergarten] = "FoodBiergarten";
+ s_visualCategoryNames[FoodCafe] = "FoodCafe";
+ s_visualCategoryNames[FoodFastFood] = "FoodFastFood";
+ s_visualCategoryNames[FoodPub] = "FoodPub";
+ s_visualCategoryNames[FoodRestaurant] = "FoodRestaurant";
+ s_visualCategoryNames[HealthDentist] = "HealthDentist";
+ s_visualCategoryNames[HealthDoctors] = "HealthDoctors";
+ s_visualCategoryNames[HealthHospital] = "HealthHospital";
+ s_visualCategoryNames[HealthPharmacy] = "HealthPharmacy";
+ s_visualCategoryNames[HealthVeterinary] = "HealthVeterinary";
+ s_visualCategoryNames[MoneyAtm] = "MoneyAtm";
+ s_visualCategoryNames[MoneyBank] = "MoneyBank";
+ s_visualCategoryNames[AmenityArchaeologicalSite] = "AmenityArchaeologicalSite";
+ s_visualCategoryNames[AmenityEmbassy] = "AmenityEmbassy";
+ s_visualCategoryNames[AmenityEmergencyPhone] = "AmenityEmergencyPhone";
+ s_visualCategoryNames[AmenityWaterPark] = "AmenityWaterPark";
+ s_visualCategoryNames[AmenityCommunityCentre] = "AmenityCommunityCentre";
+ s_visualCategoryNames[AmenityFountain] = "AmenityFountain";
+ s_visualCategoryNames[AmenityNightClub] = "AmenityNightClub";
+ s_visualCategoryNames[AmenityBench] = "AmenityBench";
+ s_visualCategoryNames[AmenityCourtHouse] = "AmenityCourtHouse";
+ s_visualCategoryNames[AmenityFireStation] = "AmenityFireStation";
+ s_visualCategoryNames[AmenityHuntingStand] = "AmenityHuntingStand";
+ s_visualCategoryNames[AmenityPolice] = "AmenityPolice";
+ s_visualCategoryNames[AmenityPostBox] = "AmenityPostBox";
+ s_visualCategoryNames[AmenityPostOffice] = "AmenityPostOffice";
+ s_visualCategoryNames[AmenityPrison] = "AmenityPrison";
+ s_visualCategoryNames[AmenityRecycling] = "AmenityRecycling";
+ s_visualCategoryNames[AmenityTelephone] = "AmenityTelephone";
+ s_visualCategoryNames[AmenityToilets] = "AmenityToilets";
+ s_visualCategoryNames[AmenityTownHall] = "AmenityTownHall";
+ s_visualCategoryNames[AmenityWasteBasket] = "AmenityWasteBasket";
+ s_visualCategoryNames[AmenityDrinkingWater] = "AmenityDrinkingWater";
+ s_visualCategoryNames[AmenityGraveyard] = "AmenityGraveyard";
+ s_visualCategoryNames[BarrierCityWall] = "BarrierCityWall";
+ s_visualCategoryNames[BarrierGate] = "BarrierGate";
+ s_visualCategoryNames[BarrierLiftGate] = "BarrierLiftGate";
+ s_visualCategoryNames[BarrierWall] = "BarrierWall";
+ s_visualCategoryNames[NaturalPeak] = "NaturalPeak";
+ s_visualCategoryNames[NaturalTree] = "NaturalTree";
+ s_visualCategoryNames[ShopBeverages] = "ShopBeverages";
+ s_visualCategoryNames[ShopHifi] = "ShopHifi";
+ s_visualCategoryNames[ShopSupermarket] = "ShopSupermarket";
+ s_visualCategoryNames[ShopAlcohol] = "ShopAlcohol";
+ s_visualCategoryNames[ShopBakery] = "ShopBakery";
+ s_visualCategoryNames[ShopButcher] = "ShopButcher";
+ s_visualCategoryNames[ShopConfectionery] = "ShopConfectionery";
+ s_visualCategoryNames[ShopConvenience] = "ShopConvenience";
+ s_visualCategoryNames[ShopGreengrocer] = "ShopGreengrocer";
+ s_visualCategoryNames[ShopSeafood] = "ShopSeafood";
+ s_visualCategoryNames[ShopDepartmentStore] = "ShopDepartmentStore";
+ s_visualCategoryNames[ShopKiosk] = "ShopKiosk";
+ s_visualCategoryNames[ShopBag] = "ShopBag";
+ s_visualCategoryNames[ShopClothes] = "ShopClothes";
+ s_visualCategoryNames[ShopFashion] = "ShopFashion";
+ s_visualCategoryNames[ShopJewelry] = "ShopJewelry";
+ s_visualCategoryNames[ShopShoes] = "ShopShoes";
+ s_visualCategoryNames[ShopVarietyStore] = "ShopVarietyStore";
+ s_visualCategoryNames[ShopBeauty] = "ShopBeauty";
+ s_visualCategoryNames[ShopChemist] = "ShopChemist";
+ s_visualCategoryNames[ShopCosmetics] = "ShopCosmetics";
+ s_visualCategoryNames[ShopHairdresser] = "ShopHairdresser";
+ s_visualCategoryNames[ShopOptician] = "ShopOptician";
+ s_visualCategoryNames[ShopPerfumery] = "ShopPerfumery";
+ s_visualCategoryNames[ShopDoitYourself] = "ShopDoitYourself";
+ s_visualCategoryNames[ShopFlorist] = "ShopFlorist";
+ s_visualCategoryNames[ShopHardware] = "ShopHardware";
+ s_visualCategoryNames[ShopFurniture] = "ShopFurniture";
+ s_visualCategoryNames[ShopElectronics] = "ShopElectronics";
+ s_visualCategoryNames[ShopMobilePhone] = "ShopMobilePhone";
+ s_visualCategoryNames[ShopBicycle] = "ShopBicycle";
+ s_visualCategoryNames[ShopCar] = "ShopCar";
+ s_visualCategoryNames[ShopCarRepair] = "ShopCarRepair";
+ s_visualCategoryNames[ShopCarParts] = "ShopCarParts";
+ s_visualCategoryNames[ShopMotorcycle] = "ShopMotorcycle";
+ s_visualCategoryNames[ShopOutdoor] = "ShopOutdoor";
+ s_visualCategoryNames[ShopMusicalInstrument] = "ShopMusicalInstrument";
+ s_visualCategoryNames[ShopPhoto] = "ShopPhoto";
+ s_visualCategoryNames[ShopBook] = "ShopBook";
+ s_visualCategoryNames[ShopGift] = "ShopGift";
+ s_visualCategoryNames[ShopStationery] = "ShopStationery";
+ s_visualCategoryNames[ShopLaundry] = "ShopLaundry";
+ s_visualCategoryNames[ShopPet] = "ShopPet";
+ s_visualCategoryNames[ShopToys] = "ShopToys";
+ s_visualCategoryNames[ShopTravelAgency] = "ShopTravelAgency";
+ s_visualCategoryNames[Shop] = "Shop";
+ s_visualCategoryNames[ManmadeBridge] = "ManmadeBridge";
+ s_visualCategoryNames[ManmadeLighthouse] = "ManmadeLighthouse";
+ s_visualCategoryNames[ManmadePier] = "ManmadePier";
+ s_visualCategoryNames[ManmadeWaterTower] = "ManmadeWaterTower";
+ s_visualCategoryNames[ManmadeWindMill] = "ManmadeWindMill";
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/data/GeoDataFeature.h
^
|
@@ -629,12 +629,14 @@
static QSharedPointer<Marble::GeoDataStyle> presetStyle( GeoDataVisualCategory category );
+ static QString visualCategoryName(GeoDataVisualCategory category);
+
virtual void detach();
protected:
// the d-pointer needs to be protected to be accessible from derived classes
GeoDataFeaturePrivate* d;
- GeoDataFeature( GeoDataFeaturePrivate* priv );
+ explicit GeoDataFeature( GeoDataFeaturePrivate* priv );
bool equals( const GeoDataFeature &other ) const;
using GeoDataObject::equals;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/data/GeoDataLineString.h
^
|
@@ -374,7 +374,7 @@
virtual void unpack( QDataStream& stream );
protected:
- GeoDataLineString(GeoDataLineStringPrivate* priv);
+ explicit GeoDataLineString(GeoDataLineStringPrivate* priv);
private:
GeoDataLineStringPrivate *p();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/data/GeoDataPlacemark.cpp
^
|
@@ -26,6 +26,7 @@
#include "MarbleDebug.h"
#include "GeoDataTrack.h"
#include "GeoDataModel.h"
+#include <QString>
namespace Marble
{
@@ -291,6 +292,30 @@
p()->m_geometry->setParent( this );
}
+
+QString GeoDataPlacemark::displayName() const
+{
+ if (hasOsmData()) {
+ OsmPlacemarkData const &data = osmData();
+ QStringList const uiLanguages = QLocale::system().uiLanguages();
+ foreach (const QString &uiLanguage, uiLanguages) {
+ QString const language = uiLanguage.toLocal8Bit().constData();
+ for (auto tagIter = data.tagsBegin(), end = data.tagsEnd(); tagIter != end; ++tagIter) {
+ if (tagIter.key().startsWith("name:")) {
+ QString const tagLanguage = tagIter.key().mid(5);
+ if (tagLanguage == language) {
+ return tagIter.value();
+ }
+ }
+ }
+ }
+ }
+
+ return name();
+}
+
+
+
qreal GeoDataPlacemark::area() const
{
return p()->m_area;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/data/GeoDataPlacemark.h
^
|
@@ -107,6 +107,11 @@
const GeoDataGeometry* geometry() const;
/**
+ * @brief displays the name of a place in the locale language of the user
+ */
+ QString displayName() const;
+
+ /**
* Return the coordinates of the placemark as @p longitude,
* @p latitude and @p altitude.
*/
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/data/GeoDataPolygon.cpp
^
|
@@ -158,6 +158,15 @@
p()->inner.append( boundary );
}
+void GeoDataPolygon::setRenderOrder(int renderOrder){
+ detach();
+ p()->m_renderOrder = renderOrder;
+}
+
+int GeoDataPolygon::renderOrder() const{
+ return p()->m_renderOrder;
+}
+
void GeoDataPolygon::pack( QDataStream& stream ) const
{
GeoDataObject::pack( stream );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/data/GeoDataPolygon.h
^
|
@@ -6,7 +6,7 @@
// the source code.
//
// Copyright 2008-2009 Patrick Spendrin <ps_ml@gmx.de>
-// Copyright 2008 Inge Wallin <inge@lysator.liu.se>
+// Copyright 2008 Inge Wallin <inge@lysator.liu.se>
//
@@ -217,6 +217,9 @@
*/
virtual void unpack( QDataStream& stream );
+ int renderOrder() const;
+ void setRenderOrder(int);
+
private:
GeoDataPolygonPrivate *p();
const GeoDataPolygonPrivate *p() const;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/data/GeoDataPolygon_p.h
^
|
@@ -55,6 +55,7 @@
// GeoDataPoints since the LatLonAltBox has
// been calculated. Saves performance.
TessellationFlags m_tessellationFlags;
+ int m_renderOrder;
};
} // namespace Marble
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/data/GeoDataSchema.h
^
|
@@ -31,7 +31,7 @@
{
public:
GeoDataSchema();
- GeoDataSchema( const QHash<QString, GeoDataSimpleField>& simpleFields );
+ explicit GeoDataSchema( const QHash<QString, GeoDataSimpleField>& simpleFields );
GeoDataSchema( const GeoDataSchema& other );
GeoDataSchema& operator=( const GeoDataSchema& other );
bool operator==( const GeoDataSchema& other ) const;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
^
|
@@ -16,6 +16,7 @@
#include "GeoPainter.h"
#include "ViewportParams.h"
#include "GeoDataStyle.h"
+#include "MarbleDebug.h"
namespace Marble
{
@@ -25,43 +26,110 @@
: GeoGraphicsItem( feature ),
m_lineString( lineString )
{
+ QString const category = GeoDataFeature::visualCategoryName(feature->visualCategory());
+ QStringList paintLayers;
+ paintLayers << QString("LineString/%1/outline").arg(category);
+ paintLayers << QString("LineString/%1/inline").arg(category);
+ paintLayers << QString("LineString/%1/label").arg(category);
+ setPaintLayers(paintLayers);
}
-const float GeoLineStringGraphicsItem::s_outlineZValue = -0.001;
+void GeoLineStringGraphicsItem::setLineString( const GeoDataLineString* lineString )
+{
+ m_lineString = lineString;
+}
-void GeoLineStringGraphicsItem::createDecorations()
+const GeoDataLatLonAltBox& GeoLineStringGraphicsItem::latLonAltBox() const
{
- if ( style() != nullptr ) {
- if ( style()->lineStyle().cosmeticOutline() ) {
- GeoLineStringGraphicsItem* outline = new GeoLineStringGraphicsItem(this->feature(), this->m_lineString);
- outline->setZValue(this->zValue() + s_outlineZValue);
+ return m_lineString->latLonAltBox();
+}
- this->addDecoration(outline);
- }
+void GeoLineStringGraphicsItem::paint(GeoPainter* painter, const ViewportParams* viewport , const QString &layer)
+{
+ if (layer.endsWith("/outline")) {
+ paintOutline(painter, viewport);
+ } else if (layer.endsWith("/label")) {
+ paintLabel(painter, viewport);
+ } else if (layer.endsWith("/inline")) {
+ paintInline(painter, viewport);
+ } else {
+ painter->drawPolyline(*m_lineString);
}
}
-void GeoLineStringGraphicsItem::setLineString( const GeoDataLineString* lineString )
+void GeoLineStringGraphicsItem::paintInline(GeoPainter* painter, const ViewportParams* viewport)
{
- m_lineString = lineString;
+ if ( ( !viewport->resolves( m_lineString->latLonAltBox(), 2) ) ) {
+ return;
+ }
+
+ painter->save();
+ LabelPositionFlags labelPositionFlags = NoLabel;
+ QPen currentPen = configurePainter(painter, viewport, labelPositionFlags);
+
+ if ( ! ( currentPen.widthF() < 2.5f ) ) {
+ if( style()->lineStyle().cosmeticOutline() &&
+ style()->lineStyle().penStyle() == Qt::SolidLine ) {
+ if ( currentPen.widthF() > 2.5f ) {
+ currentPen.setWidthF( currentPen.widthF() - 2.0f );
+ }
+ currentPen.setColor( style()->polyStyle().paintedColor() );
+ painter->setPen( currentPen );
+ painter->drawPolyline(*m_lineString);
+ } else {
+ painter->drawPolyline(*m_lineString);
+ }
+ }
+
+ painter->restore();
}
-const GeoDataLatLonAltBox& GeoLineStringGraphicsItem::latLonAltBox() const
+void GeoLineStringGraphicsItem::paintOutline(GeoPainter *painter, const ViewportParams *viewport)
{
- return m_lineString->latLonAltBox();
+ if ( ( !viewport->resolves( m_lineString->latLonAltBox(), 2) ) ) {
+ return;
+ }
+
+ painter->save();
+ LabelPositionFlags labelPositionFlags = NoLabel;
+ QPen currentPen = configurePainter(painter, viewport, labelPositionFlags);
+ if (!( currentPen.widthF() < 2.5f )) {
+ painter->drawPolyline(*m_lineString);
+ }
+ painter->restore();
}
-void GeoLineStringGraphicsItem::paint( GeoPainter* painter, const ViewportParams* viewport )
+void GeoLineStringGraphicsItem::paintLabel(GeoPainter *painter, const ViewportParams *viewport)
{
if ( ( !viewport->resolves( m_lineString->latLonAltBox(), 2) ) ) {
return;
}
+ painter->save();
LabelPositionFlags labelPositionFlags = NoLabel;
+ QPen currentPen = configurePainter(painter, viewport, labelPositionFlags);
- painter->save();
+ if (!( currentPen.widthF() < 2.5f )) {
+ QPen pen = QPen(QColor(Qt::transparent));
+ pen.setWidthF(currentPen.widthF());
+ painter->setPen(pen);
+ // Activate the lines below to paint a label background which
+ // prevents antialiasing overpainting glitches, but leads to
+ // other glitches.
+ //QColor const color = style()->polyStyle().paintedColor();
+ //painter->setBackground(QBrush(color));
+ //painter->setBackgroundMode(Qt::OpaqueMode);
+ painter->drawPolyline( *m_lineString, feature()->name(), FollowLine,
+ style()->labelStyle().paintedColor(),
+ style()->labelStyle().font());
+ }
+
+ painter->restore();
+}
+QPen GeoLineStringGraphicsItem::configurePainter(GeoPainter *painter, const ViewportParams *viewport, LabelPositionFlags &labelPositionFlags) const
+{
QPen currentPen = painter->pen();
if ( !style() ) {
painter->setPen( QPen() );
@@ -122,30 +190,7 @@
}
}
- if ( ! ( isDecoration() && currentPen.widthF() < 2.5f ) )
- {
- if( style()->lineStyle().cosmeticOutline() &&
- style()->lineStyle().penStyle() == Qt::SolidLine ) {
- if ( isDecoration() ) {
- painter->drawPolyline( *m_lineString, "", NoLabel );
- } else {
- if ( currentPen.widthF() > 2.5f ) {
- currentPen.setWidthF( currentPen.widthF() - 2.0f );
- }
- currentPen.setColor( style()->polyStyle().paintedColor() );
- painter->setPen( currentPen );
- painter->drawPolyline( *m_lineString, feature()->name(), FollowLine,
- style()->labelStyle().paintedColor(),
- style()->labelStyle().font());
- }
- } else {
- painter->drawPolyline( *m_lineString, feature()->name(), labelPositionFlags,
- style()->labelStyle().paintedColor(),
- style()->labelStyle().font() );
- }
- }
-
- painter->restore();
+ return currentPen;
}
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.h
^
|
@@ -29,13 +29,18 @@
virtual const GeoDataLatLonAltBox& latLonAltBox() const;
- virtual void paint( GeoPainter* painter, const ViewportParams *viewport );
+
+ void paint(GeoPainter* painter, const ViewportParams *viewport, const QString &layer);
protected:
const GeoDataLineString *m_lineString;
- static const float s_outlineZValue;
- virtual void createDecorations();
+private:
+ void paintOutline(GeoPainter *painter, const ViewportParams *viewport);
+ void paintInline(GeoPainter *painter, const ViewportParams *viewport);
+ void paintLabel(GeoPainter *painter, const ViewportParams *viewport);
+
+ QPen configurePainter(GeoPainter* painter, const ViewportParams *viewport, LabelPositionFlags &labelPositionFlags) const;
};
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/graphicsitem/GeoPhotoGraphicsItem.cpp
^
|
@@ -12,6 +12,7 @@
#include "GeoPainter.h"
#include "GeoDataStyle.h"
+#include "GeoDataFeature.h"
#include "ViewportParams.h"
#include <QImageReader>
@@ -24,10 +25,15 @@
GeoPhotoGraphicsItem::GeoPhotoGraphicsItem( const GeoDataFeature *feature )
: GeoGraphicsItem( feature )
{
+ if (feature) {
+ QString const paintLayer = QString("Photo/%1").arg(GeoDataFeature::visualCategoryName(feature->visualCategory()));
+ setPaintLayers(QStringList() << paintLayer);
+ }
}
-void GeoPhotoGraphicsItem::paint( GeoPainter* painter, const ViewportParams* viewport )
+void GeoPhotoGraphicsItem::paint(GeoPainter* painter, const ViewportParams* viewport , const QString &layer)
{
+ Q_UNUSED(layer);
/* The code below loads the image lazily (only
* when it will actually be displayed). Once it was
* loaded but moves out of the viewport, it is unloaded
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/graphicsitem/GeoPhotoGraphicsItem.h
^
|
@@ -29,7 +29,7 @@
GeoDataPoint point() const;
- virtual void paint( GeoPainter* painter, const ViewportParams *viewport );
+ virtual void paint(GeoPainter* painter, const ViewportParams *viewport, const QString &layer);
virtual const GeoDataLatLonAltBox& latLonAltBox() const;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp
^
|
@@ -11,6 +11,7 @@
#include "GeoPointGraphicsItem.h"
#include "GeoPainter.h"
+#include "GeoDataFeature.h"
namespace Marble
{
@@ -18,6 +19,10 @@
GeoPointGraphicsItem::GeoPointGraphicsItem( const GeoDataFeature *feature )
: GeoGraphicsItem( feature )
{
+ if (feature) {
+ QString const paintLayer = QString("Point/%1").arg(GeoDataFeature::visualCategoryName(feature->visualCategory()));
+ setPaintLayers(QStringList() << paintLayer);
+ }
}
void GeoPointGraphicsItem::setPoint( const GeoDataPoint& point )
@@ -30,9 +35,10 @@
return m_point;
}
-void GeoPointGraphicsItem::paint( GeoPainter* painter, const ViewportParams* viewport )
+void GeoPointGraphicsItem::paint(GeoPainter* painter, const ViewportParams* viewport , const QString &layer)
{
- Q_UNUSED( viewport );
+ Q_UNUSED(viewport);
+ Q_UNUSED(layer);
painter->drawPoint( m_point );
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.h
^
|
@@ -27,7 +27,7 @@
void setPoint( const GeoDataPoint& point );
GeoDataPoint point() const;
- virtual void paint( GeoPainter* painter, const ViewportParams *viewport );
+ virtual void paint(GeoPainter* painter, const ViewportParams *viewport, const QString &layer);
virtual const GeoDataLatLonAltBox& latLonAltBox() const;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp
^
|
@@ -18,6 +18,7 @@
#include "ViewportParams.h"
#include "GeoDataStyle.h"
#include "MarbleDirs.h"
+#include "MarbleDebug.h"
#include "OsmPlacemarkData.h"
#include <QVector2D>
@@ -32,6 +33,7 @@
m_ring( 0 ),
m_buildingHeight(0.0)
{
+ determineBuildingHeight();
}
GeoPolygonGraphicsItem::GeoPolygonGraphicsItem( const GeoDataFeature *feature, const GeoDataLinearRing* ring )
@@ -40,19 +42,17 @@
m_ring( ring ),
m_buildingHeight(0.0)
{
+ determineBuildingHeight();
}
-const float GeoPolygonGraphicsItem::s_decorationZValue = -0.001;
-
-void GeoPolygonGraphicsItem::createDecorations()
+void GeoPolygonGraphicsItem::determineBuildingHeight()
{
- if (isDecoration() || (!m_polygon && !m_ring )) {
+ if (!m_polygon && !m_ring ) {
return;
}
- GeoPolygonGraphicsItem *fake3D;
-
- switch ( feature()->visualCategory() ) {
+ GeoDataFeature::GeoDataVisualCategory const visualCategory = feature()->visualCategory();
+ switch (visualCategory) {
case GeoDataFeature::Building:
//case GeoDataFeature::AccomodationCamping:
case GeoDataFeature::AccomodationHostel:
@@ -61,7 +61,7 @@
case GeoDataFeature::AccomodationYouthHostel:
case GeoDataFeature::AmenityLibrary:
case GeoDataFeature::EducationCollege:
- case GeoDataFeature::EducationSchool:
+ //case GeoDataFeature::EducationSchool:
case GeoDataFeature::EducationUniversity:
case GeoDataFeature::FoodBar:
case GeoDataFeature::FoodBiergarten:
@@ -97,21 +97,68 @@
case GeoDataFeature::ReligionShinto:
case GeoDataFeature::ReligionSikh:
{
- fake3D = m_polygon ? new GeoPolygonGraphicsItem( feature(), m_polygon ) : new GeoPolygonGraphicsItem( feature(), m_ring );
- fake3D->setZValue(this->zValue() + s_decorationZValue);
- double const height = extractBuildingHeight(8.0);
- m_buildingHeight = qBound(1.0, height, 1000.0);
- fake3D->m_buildingHeight = m_buildingHeight;
+ extractBuildingHeight();
+ setZValue(this->zValue() + m_buildingHeight);
Q_ASSERT(m_buildingHeight > 0.0);
+
+ QStringList paintLayers;
+ paintLayers << QString("Polygon/Building/frame");
+ paintLayers << QString("Polygon/Building/roof");
+ setPaintLayers(paintLayers);
}
break;
default:
- fake3D = nullptr;
+ QString const paintLayer = QString("Polygon/%1").arg(GeoDataFeature::visualCategoryName(visualCategory));
+ setPaintLayers(QStringList() << paintLayer);
break;
}
+}
- this->addDecoration(fake3D);
+void GeoPolygonGraphicsItem::initializeBuildingPainting(const GeoPainter* painter, const ViewportParams *viewport,
+ bool &drawAccurate3D, bool &isCameraAboveBuilding, bool &hasInnerBoundaries,
+ QVector<QPolygonF*>& outlinePolygons,
+ QVector<QPolygonF*>& innerPolygons) const
+{
+ drawAccurate3D = false;
+ isCameraAboveBuilding = false;
+
+ QPointF offsetAtCorner = buildingOffset(QPointF(0, 0), viewport, &isCameraAboveBuilding);
+ qreal maxOffset = qMax( qAbs( offsetAtCorner.x() ), qAbs( offsetAtCorner.y() ) );
+ drawAccurate3D = painter->mapQuality() == HighQuality ? maxOffset > 5.0 : maxOffset > 8.0;
+
+ // Since subtracting one fully contained polygon from another results in a single
+ // polygon with a "connecting line" between the inner and outer part we need
+ // to first paint the inner area with no pen and then the outlines with the correct pen.
+ hasInnerBoundaries = m_polygon ? !m_polygon->innerBoundaries().isEmpty() : false;
+ if (m_polygon) {
+ if (hasInnerBoundaries) {
+ screenPolygons(viewport, m_polygon, innerPolygons, outlinePolygons);
+ }
+ viewport->screenCoordinates(m_polygon->outerBoundary(), outlinePolygons);
+ } else if (m_ring) {
+ viewport->screenCoordinates(*m_ring, outlinePolygons);
+ }
+}
+
+QPointF GeoPolygonGraphicsItem::centroid(const QPolygonF &polygon, double &area) const
+{
+ auto centroid = QPointF(0.0, 0.0);
+ area = 0.0;
+ for (auto i=0, n=polygon.size(); i<n; ++i) {
+ auto const x0 = polygon[i].x();
+ auto const y0 = polygon[i].y();
+ auto const j = i == n-1 ? 0 : i+1;
+ auto const x1 = polygon[j].x();
+ auto const y1 = polygon[j].y();
+ auto const a = x0*y1 - x1*y0;
+ area += a;
+ centroid.rx() += (x0 + x1)*a;
+ centroid.ry() += (y0 + y1)*a;
+ }
+
+ area *= 0.5;
+ return centroid / (6.0*area);
}
QPointF GeoPolygonGraphicsItem::buildingOffset(const QPointF &point, const ViewportParams *viewport, bool* isCameraAboveBuilding) const
@@ -146,25 +193,46 @@
return QPointF(shiftX, shiftY);
}
-double GeoPolygonGraphicsItem::extractBuildingHeight(double defaultValue) const
+void GeoPolygonGraphicsItem::extractBuildingHeight()
{
+ double height = 8.0;
if (feature()->nodeType() == GeoDataTypes::GeoDataPlacemarkType) {
GeoDataPlacemark const * placemark = static_cast<GeoDataPlacemark const *>(feature());
if (placemark->osmData().containsTagKey("height")) {
/** @todo Also parse non-SI units, see https://wiki.openstreetmap.org/wiki/Key:height#Height_of_buildings */
QString const heightValue = placemark->osmData().tagValue("height").replace(" meters", QString()).replace(" m", QString());
bool extracted = false;
- double height = heightValue.toDouble(&extracted);
- return extracted ? height : defaultValue;
+ double extractedHeight = heightValue.toDouble(&extracted);
+ if (extracted) {
+ height = extractedHeight;
+ }
} else if (placemark->osmData().containsTagKey("building:levels")) {
int const levels = placemark->osmData().tagValue("building:levels").toInt();
int const skipLevels = placemark->osmData().tagValue("building:min_level").toInt();
/** @todo Is 35 as an upper bound for the number of levels sane? */
- return 3.0 * qBound(1, 1+levels-skipLevels, 35);
+ height = 3.0 * qBound(1, 1+levels-skipLevels, 35);
+ }
+
+ if (!placemark->name().isEmpty()) {
+ m_buildingLabel = placemark->name();
+ } else if (placemark->osmData().containsTagKey("addr:housename")) {
+ m_buildingLabel = placemark->osmData().tagValue("addr:housename");
+ } else if (placemark->osmData().containsTagKey("addr:housenumber")) {
+ m_buildingLabel = placemark->osmData().tagValue("addr:housenumber");
+ }
+
+ auto const end = placemark->osmData().nodeReferencesEnd();
+ for (auto iter = placemark->osmData().nodeReferencesBegin(); iter != end; ++iter) {
+ if (iter.value().containsTagKey("addr:housenumber")) {
+ NamedEntry entry;
+ entry.point = iter.key();
+ entry.label = iter.value().tagValue("addr:housenumber");
+ m_entries.push_back(entry);
+ }
}
}
- return defaultValue;
+ m_buildingHeight = qBound(1.0, height, 1000.0);
}
const GeoDataLatLonAltBox& GeoPolygonGraphicsItem::latLonAltBox() const
@@ -178,13 +246,261 @@
}
}
-void GeoPolygonGraphicsItem::paint( GeoPainter* painter, const ViewportParams* viewport )
+void GeoPolygonGraphicsItem::paint( GeoPainter* painter, const ViewportParams* viewport, const QString &layer ) {
+ if (layer.endsWith("/frame")) {
+ paintFrame(painter, viewport);
+ } else if (layer.endsWith("/roof")) {
+ paintRoof(painter, viewport);
+ } else if (m_buildingHeight == 0.0) {
+ painter->save();
+ configurePainter(painter, viewport, false);
+ if ( m_polygon ) {
+ painter->drawPolygon( *m_polygon );
+ } else if ( m_ring ) {
+ painter->drawPolygon( *m_ring );
+ }
+
+ bool const hasIcon = !style()->iconStyle().iconPath().isEmpty();
+ if (hasIcon) {
+ QImage const icon = style()->iconStyle().scaledIcon();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.h
^
|
@@ -12,6 +12,7 @@
#define MARBLE_GEOPOLYGONGRAPHICSITEM_H
#include "GeoGraphicsItem.h"
+#include "GeoDataCoordinates.h"
#include "marble_export.h"
#include <QImage>
#include <QColor>
@@ -32,23 +33,36 @@
virtual const GeoDataLatLonAltBox& latLonAltBox() const;
- virtual void paint( GeoPainter* painter, const ViewportParams *viewport );
-
-protected:
- virtual void createDecorations();
+ void paint(GeoPainter* painter, const ViewportParams *viewport, const QString &layer);
private:
+ void paintFrame( GeoPainter* painter, const ViewportParams *viewport );
+ void paintRoof( GeoPainter* painter, const ViewportParams *viewport );
+
QPointF buildingOffset(const QPointF &point, const ViewportParams *viewport, bool* isCameraAboveBuilding=0) const;
- double extractBuildingHeight(double defaultValue) const;
- void screenPolygons(const ViewportParams *viewport, const GeoDataPolygon* polygon, QVector<QPolygonF*> &polygons, QVector<QPolygonF*> &outlines);
+ void extractBuildingHeight();
+ void screenPolygons(const ViewportParams *viewport, const GeoDataPolygon* polygon, QVector<QPolygonF*> &polygons, QVector<QPolygonF*> &outlines) const;
+ QPen configurePainter(GeoPainter* painter, const ViewportParams *viewport, bool isBuildingFrame);
+ void determineBuildingHeight();
+ void initializeBuildingPainting(const GeoPainter* painter, const ViewportParams *viewport,
+ bool &drawAccurate3D, bool &isCameraAboveBuilding, bool &hasInnerBoundaries,
+ QVector<QPolygonF*>& outlinePolygons,
+ QVector<QPolygonF*>& innerPolygons) const;
+ QPointF centroid(const QPolygonF &polygon, double &area) const;
const GeoDataPolygon *const m_polygon;
const GeoDataLinearRing *const m_ring;
- static const float s_decorationZValue;
double m_buildingHeight;
+ QString m_buildingLabel;
QString m_cachedTexturePath;
QColor m_cachedTextureColor;
QImage m_cachedTexture;
+
+ struct NamedEntry {
+ GeoDataCoordinates point;
+ QString label;
+ };
+ QList<NamedEntry> m_entries;
};
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/graphicsitem/GeoTrackGraphicsItem.cpp
^
|
@@ -12,6 +12,7 @@
#include "GeoDataLineString.h"
#include "GeoDataTrack.h"
+#include "GeoDataFeature.h"
#include "MarbleDebug.h"
using namespace Marble;
@@ -20,6 +21,10 @@
: GeoLineStringGraphicsItem( feature, track->lineString() )
{
setTrack( track );
+ if (feature) {
+ QString const paintLayer = QString("Track/%1").arg(GeoDataFeature::visualCategoryName(feature->visualCategory()));
+ setPaintLayers(QStringList() << paintLayer);
+ }
}
void GeoTrackGraphicsItem::setTrack( const GeoDataTrack* track )
@@ -28,11 +33,11 @@
update();
}
-void GeoTrackGraphicsItem::paint( GeoPainter *painter, const ViewportParams *viewport )
+void GeoTrackGraphicsItem::paint(GeoPainter *painter, const ViewportParams *viewport , const QString &layer)
{
+ Q_UNUSED(layer);
update();
-
- GeoLineStringGraphicsItem::paint( painter, viewport );
+ GeoLineStringGraphicsItem::paint(painter, viewport, layer);
}
void GeoTrackGraphicsItem::update()
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/graphicsitem/GeoTrackGraphicsItem.h
^
|
@@ -26,7 +26,7 @@
void setTrack( const GeoDataTrack *track );
- virtual void paint( GeoPainter *painter, const ViewportParams *viewport );
+ virtual void paint(GeoPainter *painter, const ViewportParams *viewport, const QString &layer);
private:
const GeoDataTrack *m_track;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/handlers/dgml/DgmlElementDictionary.cpp
^
|
@@ -76,5 +76,6 @@
const char* dgmlTag_Vectortile = "vectortile";
const char* dgmlTag_Visible = "visible";
const char* dgmlTag_Zoom = "zoom";
+const char* dgmlTag_RenderOrder = "renderOrder";
}
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/handlers/dgml/DgmlElementDictionary.h
^
|
@@ -79,6 +79,7 @@
extern const char* dgmlTag_Vectortile;
extern const char* dgmlTag_Visible;
extern const char* dgmlTag_Zoom;
+ extern const char* dgmlTag_RenderOrder;
}
// Helper macro
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/handlers/dgml/DgmlRenderOrderTagHandler.cpp
^
|
@@ -0,0 +1,42 @@
+//
+// 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 2016 Sanjiban Bairagya <sanjibanb@kde.org>
+//
+
+#include "DgmlRenderOrderTagHandler.h"
+
+#include "DgmlElementDictionary.h"
+#include "DgmlAttributeDictionary.h"
+#include "GeoParser.h"
+#include "GeoSceneGeodata.h"
+
+namespace Marble
+{
+namespace dgml
+{
+DGML_DEFINE_TAG_HANDLER(RenderOrder)
+
+GeoNode* DgmlRenderOrderTagHandler::parse(GeoParser& parser) const
+{
+ // Check whether the tag is valid
+ Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_RenderOrder));
+
+ // Checking for parent item
+ GeoStackItem parentItem = parser.parentElement();
+ if ( parentItem.represents( dgmlTag_Vector )
+ || parentItem.represents( dgmlTag_Geodata ) ) {
+ GeoSceneGeodata *dataSource = 0;
+ dataSource = parentItem.nodeAs<GeoSceneGeodata>();
+ dataSource->setRenderOrder( parser.readElementText().trimmed().toInt() );
+ }
+
+ return 0;
+}
+
+}
+}
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/handlers/dgml/DgmlRenderOrderTagHandler.h
^
|
@@ -0,0 +1,30 @@
+//
+// 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 2016 Sanjiban Bairagya <sanjibanb@kde.org>
+//
+
+#ifndef MARBLE_DGMLRENDERORDERTAGHANDLER_H
+#define MARBLE_DGMLRENDERORDERTAGHANDLER_H
+
+#include "GeoTagHandler.h"
+
+namespace Marble
+{
+namespace dgml
+{
+
+class DgmlRenderOrderTagHandler : public GeoTagHandler
+{
+public:
+ virtual GeoNode* parse(GeoParser&) const;
+};
+
+}
+}
+
+#endif
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/parser/GeoDocument.cpp
^
|
@@ -25,10 +25,6 @@
namespace Marble
{
-#if DUMP_GEONODE_LEAKS > 0
- // Initialize here, as there is no GeoDocument.cpp file
- unsigned long GeoDocument::s_leakProtector = 0;
-#endif
GeoDocument::GeoDocument()
{
@@ -36,14 +32,6 @@
GeoDocument::~GeoDocument()
{
-#if DUMP_GEONODE_LEAKS > 0
- if (s_leakProtector != 0) {
- fprintf(stderr, "Found %li GeoNode object LEAKS!\n", s_leakProtector);
- s_leakProtector = 0;
- } else {
- fprintf(stderr, "No GeoNode object leak!\n");
- }
-#endif
}
bool GeoDocument::isGeoDataDocument() const
@@ -59,16 +47,10 @@
GeoNode::GeoNode()
{
-#if DUMP_GEONODE_LEAKS > 0
- GeoDocument::s_leakProtector++;
-#endif
}
GeoNode::~GeoNode()
{
-#if DUMP_GEONODE_LEAKS > 0
- --GeoDocument::s_leakProtector;
-#endif
}
const char* GeoNode::nodeType() const
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/parser/GeoDocument.h
^
|
@@ -27,12 +27,6 @@
#include "geodata_export.h"
-#ifdef _WIN32
-#define DUMP_GEONODE_LEAKS 1
-#else
-#define DUMP_GEONODE_LEAKS 0
-#endif
-
namespace Marble
{
@@ -49,9 +43,6 @@
virtual bool isGeoDataDocument() const;
virtual bool isGeoSceneDocument() const;
-#if DUMP_GEONODE_LEAKS > 0
- static unsigned long s_leakProtector;
-#endif
};
/**
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/scene/GeoSceneGeodata.cpp
^
|
@@ -20,7 +20,8 @@
m_sourceFile( QString() ),
m_alpha( 1.0 ),
m_pen( QPen( Qt::NoPen ) ),
- m_brush( QBrush( Qt::transparent ) )
+ m_brush( QBrush( Qt::transparent ) ),
+ m_renderOrder( 0 )
{
}
@@ -100,6 +101,16 @@
m_brush = brush;
}
+int GeoSceneGeodata::renderOrder() const
+{
+ return m_renderOrder;
+}
+
+void GeoSceneGeodata::setRenderOrder( int renderOrder )
+{
+ m_renderOrder = renderOrder;
+}
+
QList<QColor> GeoSceneGeodata::colors() const
{
return m_colors;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/scene/GeoSceneGeodata.h
^
|
@@ -48,6 +48,9 @@
QBrush brush() const;
void setBrush( const QBrush& brush );
+ int renderOrder() const;
+ void setRenderOrder( int renderOrder );
+
QList<QColor> colors() const;
void setColors( const QList<QColor> &colors );
@@ -58,6 +61,7 @@
qreal m_alpha;
QPen m_pen;
QBrush m_brush;
+ int m_renderOrder;
QList<QColor> m_colors;
};
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/scene/GeoSceneGroup.cpp
^
|
@@ -87,6 +87,11 @@
void GeoSceneGroup::addProperty( GeoSceneProperty* property )
{
+ Q_ASSERT(property);
+ if (!property) {
+ return;
+ }
+
// Remove any property that has the same name
QVector<GeoSceneProperty*>::iterator it = m_properties.begin();
while (it != m_properties.end()) {
@@ -101,14 +106,12 @@
}
}
- if ( property ) {
- m_properties.append( property );
+ m_properties.append( property );
- // Establish connection to the outside, e.g. the LegendBrowser
- connect ( property, SIGNAL(valueChanged(QString,bool)),
- SIGNAL(valueChanged(QString,bool)) );
- emit valueChanged( property->name(), property->value() );
- }
+ // Establish connection to the outside, e.g. the LegendBrowser
+ connect ( property, SIGNAL(valueChanged(QString,bool)),
+ SIGNAL(valueChanged(QString,bool)) );
+ emit valueChanged( property->name(), property->value() );
}
const GeoSceneProperty* GeoSceneGroup::property( const QString& name ) const
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/geodata/scene/GeoSceneTileDataset.cpp
^
|
@@ -222,8 +222,14 @@
QUrl GeoSceneTileDataset::downloadUrl( const TileId &id ) const
{
// default download url
- if ( m_downloadUrls.empty() )
- return m_serverLayout->downloadUrl( QUrl( "http://files.kde.org/marble/" ), id );
+ if ( m_downloadUrls.empty() ) {
+ QUrl const defaultUrl = QUrl(QString("%1/%2")
+ .arg("https://maps.kde.org")
+ .arg(m_serverLayout->sourceDir()));
+ mDebug() << "No download URL specified for tiles stored in "
+ << m_sourceDir << ", falling back to " << defaultUrl.toString();
+ return m_serverLayout->downloadUrl(defaultUrl, id);
+ }
if ( m_nextUrl == m_downloadUrls.constEnd() )
m_nextUrl = m_downloadUrls.constBegin();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/graphicsview/GeoGraphicsItem.cpp
^
|
@@ -29,7 +29,6 @@
GeoGraphicsItem::~GeoGraphicsItem()
{
- qDeleteAll< QList<GeoGraphicsItem*> >(d->m_decorations);
delete d;
}
@@ -41,9 +40,6 @@
void GeoGraphicsItem::setVisible( bool visible )
{
setFlag( ItemIsVisible, visible );
- foreach( GeoGraphicsItem* decoration, d->m_decorations ) {
- decoration->setVisible( visible );
- }
}
GeoGraphicsItem::GeoGraphicsItemFlags GeoGraphicsItem::flags() const
@@ -78,17 +74,11 @@
void GeoGraphicsItem::setLatLonAltBox( const GeoDataLatLonAltBox& latLonAltBox )
{
d->m_latLonAltBox = latLonAltBox;
- foreach( GeoGraphicsItem* decoration, d->m_decorations ) {
- decoration->setLatLonAltBox( latLonAltBox );
- }
}
void GeoGraphicsItem::setStyle( const GeoDataStyle::ConstPtr &style )
{
d->m_style = style;
- foreach( GeoGraphicsItem* decoration, d->m_decorations ) {
- decoration->setStyle( style );
- }
}
void GeoGraphicsItem::setHighlightStyle( const GeoDataStyle::ConstPtr &highlightStyle)
@@ -98,9 +88,6 @@
* and assign the new style @highlightStyle
*/
d->m_highlightStyle = highlightStyle;
- foreach( GeoGraphicsItem* decoration, d->m_decorations ) {
- decoration->setHighlightStyle( highlightStyle );
- }
}
GeoDataStyle::ConstPtr GeoGraphicsItem::style() const
@@ -128,9 +115,6 @@
void GeoGraphicsItem::setHighlighted( bool highlight )
{
d->m_highlighted = highlight;
- foreach( GeoGraphicsItem* decoration, d->m_decorations ) {
- decoration->setHighlighted( highlight );
- }
}
bool GeoGraphicsItem::isHighlighted() const
@@ -138,47 +122,24 @@
return d->m_highlighted;
}
-int GeoGraphicsItem::minZoomLevel() const
-{
- return d->m_minZoomLevel;
-}
-
-void GeoGraphicsItem::setMinZoomLevel(int zoomLevel)
+QStringList GeoGraphicsItem::paintLayers() const
{
- d->m_minZoomLevel = zoomLevel;
- foreach( GeoGraphicsItem* decoration, d->m_decorations ) {
- decoration->setMinZoomLevel( zoomLevel );
- }
+ return d->m_paintLayers;
}
-const QList<GeoGraphicsItem*>& GeoGraphicsItem::decorations()
+void GeoGraphicsItem::setPaintLayers(const QStringList &paintLayers)
{
- if ( d->m_decorations.isEmpty() ) {
- createDecorations();
- }
-
- return d->m_decorations;
+ d->m_paintLayers = paintLayers;
}
-void GeoGraphicsItem::addDecoration(GeoGraphicsItem* decoration)
+int GeoGraphicsItem::minZoomLevel() const
{
- if (decoration != nullptr) {
- decoration->d->m_isDecoration = true;
-
- decoration->setLatLonAltBox(this->latLonAltBox());
- decoration->setFlags(this->flags());
- decoration->setHighlighted(this->isHighlighted());
- decoration->setStyle(this->style());
- decoration->setMinZoomLevel(this->minZoomLevel());
- decoration->setVisible(this->visible());
-
- d->m_decorations.append(decoration);
- }
+ return d->m_minZoomLevel;
}
-bool GeoGraphicsItem::isDecoration() const
+void GeoGraphicsItem::setMinZoomLevel(int zoomLevel)
{
- return d->m_isDecoration;
+ d->m_minZoomLevel = zoomLevel;
}
bool GeoGraphicsItem::zValueLessThan(GeoGraphicsItem *one, GeoGraphicsItem *two)
@@ -186,7 +147,3 @@
return one->d->m_zValue < two->d->m_zValue;
}
-void GeoGraphicsItem::createDecorations()
-{
- return;
-}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/graphicsview/GeoGraphicsItem.h
^
|
@@ -14,7 +14,7 @@
// Marble
#include "marble_export.h"
-#include <GeoDataStyle.h>
+#include "GeoDataStyle.h"
class QString;
@@ -126,31 +126,18 @@
* Note that depending on the projection and zoom level, the item may be visible more than once,
* which is taken care of by GeoPainter.
*/
- virtual void paint( GeoPainter *painter, const ViewportParams *viewport ) = 0;
+ virtual void paint(GeoPainter *painter, const ViewportParams *viewport, const QString &layer) = 0;
void setHighlighted( bool highlight );
bool isHighlighted() const;
- const QList<GeoGraphicsItem*>& decorations();
+ QStringList paintLayers() const;
- bool isDecoration() const;
+ void setPaintLayers(const QStringList &paintLayers);
protected:
GeoGraphicsItemPrivate *const d;
-
- /**
- * Creates a new decoration for this item.
- *
- * Override this function to create a new type of decoration,
- * e.g. outlines for lines or "fake 3D effect" for polygons.
- * After a decoration was created add it to the item with
- * addDecoration(). You can create multiple decoration for a
- * single GeoGraphicsItem.
- */
- virtual void createDecorations();
-
- void addDecoration(GeoGraphicsItem* decoration);
};
} // Namespace Marble
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/graphicsview/GeoGraphicsItem_p.h
^
|
@@ -28,7 +28,6 @@
m_minZoomLevel( 0 ),
m_feature( feature ),
m_latLonAltBox(),
- m_isDecoration( false ),
m_highlighted( false )
{
}
@@ -45,8 +44,7 @@
GeoDataLatLonAltBox m_latLonAltBox;
GeoDataStyle::ConstPtr m_style;
- bool m_isDecoration;
- QList<GeoGraphicsItem*> m_decorations;
+ QStringList m_paintLayers;
// To highlight a placemark
bool m_highlighted;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/layers/GeometryLayer.cpp
^
|
@@ -58,7 +58,7 @@
public:
typedef QList<GeoDataPlacemark const *> OsmQueue;
- GeometryLayerPrivate( const QAbstractItemModel *model );
+ explicit GeometryLayerPrivate( const QAbstractItemModel *model );
void createGraphicsItems( const GeoDataObject *object );
void createGraphicsItemFromGeometry( const GeoDataGeometry *object, const GeoDataPlacemark *placemark, bool avoidOsmDuplicates );
@@ -76,21 +76,18 @@
QMap<qint64,OsmQueue> m_osmRelationItems;
private:
-
static void initializeDefaultValues();
+ static QString createPaintLayerOrder(const QString &itemType, GeoDataFeature::GeoDataVisualCategory visualCategory, const QString &subType = QString());
- static int s_defaultZValues[GeoDataFeature::LastIndex];
static int s_defaultMinZoomLevels[GeoDataFeature::LastIndex];
static bool s_defaultValuesInitialized;
static int s_maximumZoomLevel;
- static const int s_defaultZValue;
};
-int GeometryLayerPrivate::s_defaultZValues[GeoDataFeature::LastIndex];
int GeometryLayerPrivate::s_defaultMinZoomLevels[GeoDataFeature::LastIndex];
bool GeometryLayerPrivate::s_defaultValuesInitialized = false;
int GeometryLayerPrivate::s_maximumZoomLevel = 0;
-const int GeometryLayerPrivate::s_defaultZValue = 50;
+QStringList s_paintLayerOrder;
GeometryLayerPrivate::GeometryLayerPrivate( const QAbstractItemModel *model )
: m_model( model )
@@ -103,6 +100,16 @@
return s_maximumZoomLevel;
}
+QString GeometryLayerPrivate::createPaintLayerOrder(const QString &itemType, GeoDataFeature::GeoDataVisualCategory visualCategory, const QString &subType)
+{
+ QString const category = GeoDataFeature::visualCategoryName(visualCategory);
+ if (subType.isEmpty()) {
+ return QString("%1/%2").arg(itemType).arg(category);
+ } else {
+ return QString("%1/%2/%3").arg(itemType).arg(category).arg(subType);
+ }
+}
+
GeometryLayer::GeometryLayer( const QAbstractItemModel *model )
: d( new GeometryLayerPrivate( model ) )
{
@@ -140,77 +147,91 @@
return;
for ( int i = 0; i < GeoDataFeature::LastIndex; i++ )
- s_defaultZValues[i] = s_defaultZValue;
-
- for ( int i = 0; i < GeoDataFeature::LastIndex; i++ )
s_defaultMinZoomLevels[i] = 15;
- s_defaultZValues[GeoDataFeature::None] = 0;
+ for ( int i = GeoDataFeature::LanduseAllotments; i <= GeoDataFeature::LanduseVineyard; i++ ) {
+ if ((GeoDataFeature::GeoDataVisualCategory)i != GeoDataFeature::LanduseGrass) {
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", (GeoDataFeature::GeoDataVisualCategory)i);
+ }
+ }
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::NaturalBeach);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::NaturalWetland);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::NaturalGlacier);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::NaturalCliff);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::NaturalPeak);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::MilitaryDangerArea);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::LeisurePark);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::LeisurePitch);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::LeisureSportsCentre);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::LeisureStadium);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::NaturalWood);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::LanduseGrass);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::LeisurePlayground);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::NaturalScrub);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::LeisureTrack);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::TransportParking);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::TransportParkingSpace);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::ManmadeBridge);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::BarrierCityWall);
+
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::AmenityGraveyard);
+
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::EducationCollege);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::EducationSchool);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::EducationUniversity);
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::HealthHospital);
+
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::NaturalWater);
+ s_paintLayerOrder << createPaintLayerOrder("LineString", GeoDataFeature::NaturalWater);
+ for ( int i = GeoDataFeature::HighwaySteps; i <= GeoDataFeature::HighwayMotorway; i++ ) {
+ s_paintLayerOrder << createPaintLayerOrder("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "outline");
+ }
+ for ( int i = GeoDataFeature::HighwaySteps; i <= GeoDataFeature::HighwayMotorway; i++ ) {
+ s_paintLayerOrder << createPaintLayerOrder("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "inline");
+ }
+ for ( int i = GeoDataFeature::HighwaySteps; i <= GeoDataFeature::HighwayMotorway; i++ ) {
+ s_paintLayerOrder << createPaintLayerOrder("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "label");
+ }
+ for ( int i = GeoDataFeature::RailwayRail; i <= GeoDataFeature::RailwayFunicular; i++ ) {
+ s_paintLayerOrder << createPaintLayerOrder("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "outline");
+ }
+ for ( int i = GeoDataFeature::RailwayRail; i <= GeoDataFeature::RailwayFunicular; i++ ) {
+ s_paintLayerOrder << createPaintLayerOrder("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "inline");
+ }
+ for ( int i = GeoDataFeature::RailwayRail; i <= GeoDataFeature::RailwayFunicular; i++ ) {
+ s_paintLayerOrder << createPaintLayerOrder("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "label");
+ }
+
+ s_paintLayerOrder << createPaintLayerOrder("Polygon", GeoDataFeature::TransportPlatform);
+
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::AmenityGraveyard);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::NaturalWood);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::NaturalBeach);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::NaturalWetland);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::NaturalGlacier);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::NaturalScrub);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::LeisurePark);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::LeisurePlayground);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::LeisurePitch);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::LeisureSportsCentre);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::LeisureStadium);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::LeisureTrack);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::TransportParking);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::ManmadeBridge);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::BarrierCityWall);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::NaturalWater);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::NaturalCliff);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::NaturalPeak);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::EducationCollege);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::EducationSchool);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::EducationUniversity);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::HealthHospital);
+ s_paintLayerOrder << createPaintLayerOrder("Point", GeoDataFeature::MilitaryDangerArea);
- //Amenity
- s_defaultZValues[GeoDataFeature::AmenityGraveyard] = s_defaultZValue - 12;
+ s_paintLayerOrder << "Polygon/Building/frame";
+ s_paintLayerOrder << "Polygon/Building/roof";
- s_defaultZValues[GeoDataFeature::EducationCollege] = s_defaultZValue - 12;
- s_defaultZValues[GeoDataFeature::EducationSchool] = s_defaultZValue - 12;
- s_defaultZValues[GeoDataFeature::EducationUniversity] = s_defaultZValue - 12;
- s_defaultZValues[GeoDataFeature::HealthHospital] = s_defaultZValue - 12;
-
- //Landuse
-
- for ( int i = GeoDataFeature::LanduseAllotments; i <= GeoDataFeature::LanduseVineyard; i++ )
- s_defaultZValues[(GeoDataFeature::GeoDataVisualCategory)i] = s_defaultZValue - 17;
-
- s_defaultZValues[GeoDataFeature::NaturalWood] = s_defaultZValue - 15;
- s_defaultZValues[GeoDataFeature::NaturalBeach] = s_defaultZValue - 13;
- s_defaultZValues[GeoDataFeature::NaturalWetland] = s_defaultZValue - 13;
- s_defaultZValues[GeoDataFeature::NaturalGlacier] = s_defaultZValue - 10;
- s_defaultZValues[GeoDataFeature::NaturalScrub] = s_defaultZValue - 13;
- s_defaultZValues[GeoDataFeature::NaturalWater] = s_defaultZValue - 13;
- s_defaultZValues[GeoDataFeature::NaturalCliff] = s_defaultZValue - 13;
- s_defaultZValues[GeoDataFeature::NaturalPeak] = s_defaultZValue - 13;
-
- //Military
-
- s_defaultZValues[GeoDataFeature::MilitaryDangerArea] = s_defaultZValue - 10;
-
- //Leisure
-
- s_defaultZValues[GeoDataFeature::LeisurePark] = s_defaultZValue - 14;
- s_defaultZValues[GeoDataFeature::LeisurePlayground] = s_defaultZValue - 13;
- s_defaultZValues[GeoDataFeature::LeisurePitch] = s_defaultZValue - 13;
- s_defaultZValues[GeoDataFeature::LeisureSportsCentre] = s_defaultZValue - 13;
- s_defaultZValues[GeoDataFeature::LeisureStadium] = s_defaultZValue - 13;
- s_defaultZValues[GeoDataFeature::LeisureTrack] = s_defaultZValue - 13;
-
- s_defaultZValues[GeoDataFeature::TransportParking] = s_defaultZValue - 13;
-
- s_defaultZValues[GeoDataFeature::ManmadeBridge] = s_defaultZValue - 12;
- s_defaultZValues[GeoDataFeature::BarrierCityWall] = s_defaultZValue - 1;
-
- s_defaultZValues[GeoDataFeature::HighwayUnknown] = s_defaultZValue - 11;
- s_defaultZValues[GeoDataFeature::HighwayPath] = s_defaultZValue - 10;
- s_defaultZValues[GeoDataFeature::HighwayTrack] = s_defaultZValue - 9;
- s_defaultZValues[GeoDataFeature::HighwaySteps] = s_defaultZValue - 8;
- s_defaultZValues[GeoDataFeature::HighwayFootway] = s_defaultZValue - 8;
- s_defaultZValues[GeoDataFeature::HighwayCycleway] = s_defaultZValue - 8;
- s_defaultZValues[GeoDataFeature::HighwayService] = s_defaultZValue - 7;
- s_defaultZValues[GeoDataFeature::HighwayResidential] = s_defaultZValue - 7;
- s_defaultZValues[GeoDataFeature::HighwayLivingStreet] = s_defaultZValue - 7;
- s_defaultZValues[GeoDataFeature::HighwayPedestrian] = s_defaultZValue - 6;
- s_defaultZValues[GeoDataFeature::HighwayRoad] = s_defaultZValue - 6;
- s_defaultZValues[GeoDataFeature::HighwayUnclassified] = s_defaultZValue - 6;
- s_defaultZValues[GeoDataFeature::HighwayTertiary] = s_defaultZValue - 5;
- s_defaultZValues[GeoDataFeature::HighwaySecondary] = s_defaultZValue - 4;
- s_defaultZValues[GeoDataFeature::HighwayPrimary] = s_defaultZValue - 3;
- s_defaultZValues[GeoDataFeature::HighwayTrunk] = s_defaultZValue - 2;
- s_defaultZValues[GeoDataFeature::HighwayMotorway] = s_defaultZValue - 1;
- s_defaultZValues[GeoDataFeature::RailwayRail] = s_defaultZValue - 1;
-
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/layers/TextureLayer.cpp
^
|
@@ -396,7 +396,7 @@
void TextureLayer::setProjection( Projection projection )
{
- if ( d->m_textures.isEmpty() ) {
+ if ( d->m_textures.isEmpty() || textureLayerCount() == 0 ) {
return;
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/osm/OsmPlacemarkData.cpp
^
|
@@ -129,11 +129,8 @@
bool OsmPlacemarkData::containsTag( const QString &key, const QString &value ) const
{
- if ( m_tags.contains( key ) ) {
- return m_tags.value( key ) == value;
- }
-
- return false;
+ auto const iter = m_tags.constFind(key);
+ return iter == m_tags.constEnd() ? false : iter.value() == value;
}
bool OsmPlacemarkData::containsTagKey( const QString &key ) const
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/osm/OsmPresetLibrary.cpp
^
|
@@ -530,6 +530,7 @@
s_areaTags.insert( "amenity=graveyard" );
s_areaTags.insert( "amenity=parking" );
s_areaTags.insert( "amenity=parking_space" );
+ s_areaTags.insert( "amenity=bicycle_parking" );
s_areaTags.insert( "amenity=college" );
s_areaTags.insert( "amenity=hospital" );
s_areaTags.insert( "amenity=school" );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/projections/AbstractProjection.h
^
|
@@ -216,7 +216,7 @@
protected:
const QScopedPointer<AbstractProjectionPrivate> d_ptr;
- AbstractProjection( AbstractProjectionPrivate* dd );
+ explicit AbstractProjection( AbstractProjectionPrivate* dd );
private:
Q_DECLARE_PRIVATE(AbstractProjection)
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/projections/AzimuthalEquidistantProjection.h
^
|
@@ -92,7 +92,7 @@
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Degree ) const;
protected:
- AzimuthalEquidistantProjection(AzimuthalEquidistantProjectionPrivate *dd );
+ explicit AzimuthalEquidistantProjection(AzimuthalEquidistantProjectionPrivate *dd );
private:
Q_DECLARE_PRIVATE(AzimuthalEquidistantProjection)
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/projections/AzimuthalProjection.h
^
|
@@ -65,7 +65,7 @@
const ViewportParams *viewport ) const;
protected:
- AzimuthalProjection( AzimuthalProjectionPrivate* dd );
+ explicit AzimuthalProjection( AzimuthalProjectionPrivate* dd );
private:
Q_DECLARE_PRIVATE( AzimuthalProjection )
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/projections/CylindricalProjection.h
^
|
@@ -55,7 +55,7 @@
virtual QPainterPath mapShape( const ViewportParams *viewport ) const;
protected:
- CylindricalProjection( CylindricalProjectionPrivate* dd );
+ explicit CylindricalProjection( CylindricalProjectionPrivate* dd );
private:
Q_DECLARE_PRIVATE( CylindricalProjection )
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/projections/GnomonicProjection.h
^
|
@@ -91,7 +91,7 @@
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Degree ) const;
protected:
- GnomonicProjection(GnomonicProjectionPrivate *dd );
+ explicit GnomonicProjection(GnomonicProjectionPrivate *dd );
private:
Q_DECLARE_PRIVATE(GnomonicProjection)
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/projections/LambertAzimuthalProjection.h
^
|
@@ -91,7 +91,7 @@
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Degree ) const;
protected:
- LambertAzimuthalProjection(LambertAzimuthalProjectionPrivate *dd );
+ explicit LambertAzimuthalProjection(LambertAzimuthalProjectionPrivate *dd );
private:
Q_DECLARE_PRIVATE(LambertAzimuthalProjection)
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/projections/SphericalProjection.h
^
|
@@ -98,7 +98,7 @@
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Degree ) const;
protected:
- SphericalProjection(SphericalProjectionPrivate *dd );
+ explicit SphericalProjection(SphericalProjectionPrivate *dd );
private:
Q_DECLARE_PRIVATE(SphericalProjection)
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/projections/StereographicProjection.h
^
|
@@ -91,7 +91,7 @@
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Degree ) const;
protected:
- StereographicProjection(StereographicProjectionPrivate *dd );
+ explicit StereographicProjection(StereographicProjectionPrivate *dd );
private:
Q_DECLARE_PRIVATE(StereographicProjection)
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/projections/VerticalPerspectiveProjection.h
^
|
@@ -91,7 +91,7 @@
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Degree ) const;
protected:
- VerticalPerspectiveProjection(VerticalPerspectiveProjectionPrivate *dd );
+ explicit VerticalPerspectiveProjection(VerticalPerspectiveProjectionPrivate *dd );
private:
Q_DECLARE_PRIVATE(VerticalPerspectiveProjection)
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/routing/RoutingInputWidget.cpp
^
|
@@ -54,7 +54,7 @@
class RoutingInputLineEdit : public MarbleLineEdit
{
public:
- RoutingInputLineEdit( QWidget *parent = 0 );
+ explicit RoutingInputLineEdit( QWidget *parent = 0 );
protected:
virtual void keyPressEvent(QKeyEvent *);
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/routing/RoutingModel.cpp
^
|
@@ -33,7 +33,7 @@
OffRoute
};
- RoutingModelPrivate( RouteRequest* request );
+ explicit RoutingModelPrivate( RouteRequest* request );
MarbleModel *m_marbleModel;
Route m_route;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/routing/SpeakersModel.cpp
^
|
@@ -37,7 +37,7 @@
NewstuffModel m_newstuffModel;
- SpeakersModelPrivate( SpeakersModel* parent );
+ explicit SpeakersModelPrivate( SpeakersModel* parent );
void fillModel();
@@ -149,7 +149,7 @@
SpeakersModel::~SpeakersModel()
{
- // nothing to do
+ delete d;
}
int SpeakersModel::rowCount ( const QModelIndex &parent ) const
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/lib/marble/routing/VoiceNavigationModel.cpp
^
|
@@ -43,7 +43,7 @@
bool m_deviated;
- VoiceNavigationModelPrivate( VoiceNavigationModel* parent );
+ explicit VoiceNavigationModelPrivate( VoiceNavigationModel* parent );
void reset();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plasmarunner/plasma-runner-marble.desktop
^
|
@@ -1,5 +1,6 @@
[Desktop Entry]
Name=OpenStreetMap with Marble
+Name[ast]=OpenStreetMap con Marble
Name[bg]=OpenStreetMap с Marble
Name[bs]=OpenStreetMap sa Marble
Name[ca]=OpenStreetMap amb el Marble
@@ -41,6 +42,7 @@
Name[zh_CN]=Marble 的 OpenStreetMap
Name[zh_TW]=Marble 的 OpenStreetMap 支援
Comment=Lookup places in OpenStreetMap with Marble
+Comment[ast]=Gueta llugares n'OpenStreetMap con Marble
Comment[bg]=Търсене по карта OpenStreetMap с Marble
Comment[bs]=Traženje mjesta u OpenStreetMap sa Marble
Comment[ca]=Cerca llocs de l'OpenStreetMaps amb el Marble
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plasmoid/plasma-applet-kworldclock.desktop
^
|
@@ -51,7 +51,7 @@
Name[zh_CN]=世界时钟
Name[zh_TW]=世界時鐘
Comment=Shows the time in different parts of the world
-Comment[ast]=Amuesa la hora en distintes partes del mundu
+Comment[ast]=Amuesa la hora en diferentes partes del mundu
Comment[bg]=Показва времето в различни краища на света
Comment[bs]=Prikazuje vrijeme u različitim dijelovima svijeta
Comment[ca]=Mostra l'hora en diverses parts del món
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/positionprovider/gpsd/GpsdPositionProviderPlugin.cpp
^
|
@@ -12,7 +12,7 @@
#include "GpsdThread.h"
#include "MarbleDebug.h"
-#include <math.h>
+#include <cmath>
using namespace Marble;
/* TRANSLATOR Marble::GpsdPositionProviderPlugin */
@@ -76,7 +76,7 @@
{
PositionProviderStatus oldStatus = m_status;
GeoDataCoordinates oldPosition = m_position;
- if ( data.status == STATUS_NO_FIX || isnan( data.fix.longitude ) || isnan( data.fix.latitude ) )
+ if ( data.status == STATUS_NO_FIX || std::isnan( data.fix.longitude ) || std::isnan( data.fix.latitude ) )
m_status = PositionProviderStatusAcquiring;
else {
m_status = PositionProviderStatusAvailable;
@@ -88,29 +88,29 @@
m_accuracy.level = GeoDataAccuracy::Detailed;
#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 3 )
- if ( !isnan( data.fix.epx ) && !isnan( data.fix.epy ) ) {
+ if ( !std::isnan( data.fix.epx ) && !std::isnan( data.fix.epy ) ) {
m_accuracy.horizontal = qMax( data.fix.epx, data.fix.epy );
}
#else
- if ( !isnan( data.fix.eph ) ) {
+ if ( !std::isnan( data.fix.eph ) ) {
m_accuracy.horizontal = data.fix.eph;
}
#endif
- if ( !isnan( data.fix.epv ) ) {
+ if ( !std::isnan( data.fix.epv ) ) {
m_accuracy.vertical = data.fix.epv;
}
- if( !isnan(data.fix.speed ) )
+ if( !std::isnan(data.fix.speed ) )
{
m_speed = data.fix.speed;
}
- if( !isnan( data.fix.track ) )
+ if( !std::isnan( data.fix.track ) )
{
m_track = data.fix.track;
}
- if ( !isnan( data.fix.time ) )
+ if ( !std::isnan( data.fix.time ) )
{
m_timestamp = QDateTime::fromMSecsSinceEpoch( data.fix.time * 1000 );
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/annotate/AnnotatePlugin.cpp
^
|
@@ -241,7 +241,7 @@
QListIterator<SceneGraphicsItem*> iter( m_graphicsItems );
while ( iter.hasNext() ) {
- iter.next()->paint( painter, viewport );
+ iter.next()->paint( painter, viewport, "Annotation" );
}
return true;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/annotate/AreaAnnotation.cpp
^
|
@@ -51,7 +51,7 @@
m_interactingObj( InteractingNothing ),
m_virtualHovered( -1, -1 )
{
- // nothing to do
+ setPaintLayers(QStringList() << "AreaAnnotation");
}
AreaAnnotation::~AreaAnnotation()
@@ -59,8 +59,9 @@
delete m_animation;
}
-void AreaAnnotation::paint( GeoPainter *painter, const ViewportParams *viewport )
+void AreaAnnotation::paint(GeoPainter *painter, const ViewportParams *viewport , const QString &layer)
{
+ Q_UNUSED(layer);
m_viewport = viewport;
Q_ASSERT( placemark()->geometry()->nodeType() == GeoDataTypes::GeoDataPolygonType );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/annotate/AreaAnnotation.h
^
|
@@ -43,7 +43,7 @@
* @brief Paints the nodes on the screen and updates the regions which correspond
* to each node using the given GeoPainter.
*/
- virtual void paint( GeoPainter *painter, const ViewportParams *viewport );
+ virtual void paint( GeoPainter *painter, const ViewportParams *viewport, const QString &layer );
/**
* @brief Returns true if the given QPoint is contained by the current polygon. Note
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/annotate/GroundOverlayFrame.cpp
^
|
@@ -91,10 +91,12 @@
m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-vertical-active.png" ) );
update();
+ setPaintLayers(QStringList() << "GroundOverlayFrame");
}
-void GroundOverlayFrame::paint(GeoPainter *painter, const ViewportParams *viewport )
+void GroundOverlayFrame::paint(GeoPainter *painter, const ViewportParams *viewport , const QString &layer)
{
+ Q_UNUSED(layer);
m_viewport = viewport;
m_regionList.clear();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/annotate/GroundOverlayFrame.h
^
|
@@ -55,7 +55,7 @@
virtual const char *graphicType() const;
protected:
- virtual void paint( GeoPainter *painter, const ViewportParams *viewport );
+ virtual void paint( GeoPainter *painter, const ViewportParams *viewport, const QString &layer );
virtual bool mousePressEvent( QMouseEvent *event );
virtual bool mouseMoveEvent( QMouseEvent *event );
virtual bool mouseReleaseEvent( QMouseEvent *event );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/annotate/PlacemarkTextAnnotation.cpp
^
|
@@ -42,6 +42,7 @@
newStyle->iconStyle().setIconPath( MarbleDirs::path("bitmaps/redflag_22.png") );
placemark->setStyle( newStyle );
}
+ setPaintLayers(QStringList() << "PlacemarkTextAnnotation");
}
PlacemarkTextAnnotation::~PlacemarkTextAnnotation()
@@ -49,8 +50,9 @@
// nothing to do
}
-void PlacemarkTextAnnotation::paint( GeoPainter *painter, const ViewportParams *viewport )
+void PlacemarkTextAnnotation::paint( GeoPainter *painter, const ViewportParams *viewport, const QString &layer )
{
+ Q_UNUSED(layer);
Q_UNUSED( painter );
m_viewport = viewport;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/annotate/PlacemarkTextAnnotation.h
^
|
@@ -25,7 +25,7 @@
explicit PlacemarkTextAnnotation( GeoDataPlacemark *placemark );
~PlacemarkTextAnnotation();
- virtual void paint( GeoPainter *painter, const ViewportParams *viewport );
+ virtual void paint(GeoPainter *painter, const ViewportParams *viewport, const QString &layer);
virtual bool containsPoint( const QPoint &eventPos ) const;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/annotate/PolylineAnnotation.cpp
^
|
@@ -53,7 +53,7 @@
m_virtualHoveredNode( -1 )
{
- // nothing to do
+ setPaintLayers(QStringList() << "PolylineAnnotation");
}
PolylineAnnotation::~PolylineAnnotation()
@@ -61,8 +61,9 @@
delete m_animation;
}
-void PolylineAnnotation::paint( GeoPainter *painter, const ViewportParams *viewport )
+void PolylineAnnotation::paint(GeoPainter *painter, const ViewportParams *viewport , const QString &layer)
{
+ Q_UNUSED(layer);
m_viewport = viewport;
Q_ASSERT( placemark()->geometry()->nodeType() == GeoDataTypes::GeoDataLineStringType );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/annotate/PolylineAnnotation.h
^
|
@@ -35,7 +35,7 @@
* @brief Paints the nodes on the screen and updates the regions which correspond
* to each node using the given GeoPainter.
*/
- virtual void paint( GeoPainter *painter, const ViewportParams *viewport );
+ virtual void paint( GeoPainter *painter, const ViewportParams *viewport, const QString &layer );
/**
* @brief Returns true if either the polyline's associated region or one of its nodes
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/aprs/AprsGatherer.cpp
^
|
@@ -75,6 +75,10 @@
// prevents accidentially coloring signals heard over some sources
// as heard directly where it's never possible (such as over the
// internet).
+ Q_ASSERT(m_source);
+ if (!m_source) {
+ return;
+ }
bool canDoDirect = m_source->canDoDirect();
while( m_running ) {
@@ -87,7 +91,7 @@
}
- if ( !m_socket && m_source )
+ if ( !m_socket )
m_socket = m_source->openSocket();
if ( !m_socket ) {
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/crosshairs/CrosshairsConfigWidget.ui
^
|
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>318</width>
- <height>119</height>
+ <height>136</height>
</rect>
</property>
<property name="windowTitle">
@@ -44,7 +44,7 @@
</property>
<property name="icon">
<iconset resource="crosshairs.qrc">
- <normaloff>:/crosshairs-pointed.svg</normaloff>:/crosshairs-pointed.svg</iconset>
+ <normaloff>:/crosshairs-darkened.png</normaloff>:/crosshairs-darkened.png</iconset>
</property>
</item>
<item>
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/crosshairs/CrosshairsPlugin.cpp
^
|
@@ -31,6 +31,7 @@
: RenderPlugin( 0 ),
m_svgobj( 0 ),
m_themeIndex( 0 ),
+ m_theme( "" ),
m_configDialog( 0 ),
m_uiConfigWidget( 0 )
{
@@ -41,6 +42,7 @@
m_isInitialized( false ),
m_svgobj( 0 ),
m_themeIndex( 0 ),
+ m_theme( "" ),
m_configDialog( 0 ),
m_uiConfigWidget( 0 )
{
@@ -169,25 +171,26 @@
m_uiConfigWidget->m_themeList->setCurrentRow( m_themeIndex );
}
- QString theme = ":/crosshairs-pointed.svg";
+ m_theme = ":/crosshairs-darkened.png";
switch( m_themeIndex ) {
case 1:
- theme = ":/crosshairs-gun1.svg";
+ m_theme = ":/crosshairs-gun1.svg";
break;
case 2:
- theme = ":/crosshairs-gun2.svg";
+ m_theme = ":/crosshairs-gun2.svg";
break;
case 3:
- theme = ":/crosshairs-circled.svg";
+ m_theme = ":/crosshairs-circled.svg";
break;
case 4:
- theme = ":/crosshairs-german.svg";
+ m_theme = ":/crosshairs-german.svg";
break;
}
- delete m_svgobj;
- CrosshairsPlugin * me = const_cast<CrosshairsPlugin*>( this );
- m_svgobj = new QSvgRenderer( theme, me );
+ if( QImageReader::imageFormat( m_theme ) == "svg" ) {
+ delete m_svgobj;
+ m_svgobj = new QSvgRenderer( m_theme, this );
+ }
m_crosshairs = QPixmap();
}
@@ -211,11 +214,17 @@
const int height = 21;
if ( m_crosshairs.isNull() ) {
- painter->setRenderHint( QPainter::Antialiasing, true );
- m_crosshairs = QPixmap( QSize( width, height ) );
- m_crosshairs.fill( Qt::transparent );
- QPainter mapPainter( &m_crosshairs );
- m_svgobj->render( &mapPainter );
+ if( QImageReader::imageFormat( m_theme ) == "svg" ) {
+ painter->setRenderHint( QPainter::Antialiasing, true );
+ m_crosshairs = QPixmap( QSize( width, height ) );
+ m_crosshairs.fill( Qt::transparent );
+
+ QPainter mapPainter( &m_crosshairs );
+ m_svgobj->render( &mapPainter );
+ }
+ else {
+ m_crosshairs.load( m_theme );
+ }
}
GeoDataCoordinates const focusPoint = viewport->focusPoint();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/crosshairs/CrosshairsPlugin.h
^
|
@@ -17,6 +17,8 @@
#define MARBLE_CROSSHAIRSPLUGIN_H
#include <QObject>
+#include <QImageReader>
+
#include "RenderPlugin.h"
#include "DialogConfigurationInterface.h"
@@ -101,6 +103,8 @@
QPixmap m_crosshairs;
int m_themeIndex;
+ QString m_theme;
+
QDialog * m_configDialog;
Ui::CrosshairsConfigWidget * m_uiConfigWidget;
};
|
|
Added |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/crosshairs/crosshairs-darkened.png
^
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/crosshairs/crosshairs.qrc
^
|
@@ -4,6 +4,6 @@
<file>crosshairs-german.svg</file>
<file>crosshairs-gun1.svg</file>
<file>crosshairs-gun2.svg</file>
- <file>crosshairs-pointed.svg</file>
+ <file>crosshairs-darkened.png</file>
</qresource>
</RCC>
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/render/eclipses/EclipsesPlugin.cpp
^
|
@@ -424,7 +424,7 @@
void EclipsesPlugin::updateEclipses()
{
- mDebug() << "Updating eclipses....";
+ // mDebug() << "Updating eclipses....";
const int year = marbleModel()->clock()->dateTime().date().year();
const bool lun = m_settings.value( "enableLunarEclipses" ).toBool();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/CMakeLists.txt
^
|
@@ -3,6 +3,7 @@
add_subdirectory( latlon )
add_subdirectory( local-osm-search )
add_subdirectory( localdatabase )
+add_subdirectory( openlocation-code-search )
add_subdirectory( nominatim-search )
add_subdirectory( nominatim-reversegeocoding )
add_subdirectory( gosmore-reversegeocoding )
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/gpx/marble_gpx.desktop
^
|
@@ -60,6 +60,7 @@
Name[zh_TW]=地理_Marble
NoDisplay=true
GenericName=Virtual Globe
+GenericName[ast]=Globu virtual
GenericName[bg]=Настолен глобус
GenericName[bs]=Virtualni globus
GenericName[ca]=Globus virtual
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/gpx/marble_part_gpx.desktop
^
|
@@ -14,7 +14,7 @@
Name[en_GB]=Marble Part
Name[eo]=Marble Part
Name[es]=Part Marble
-Name[et]=Marble konponent
+Name[et]=Marble komponent
Name[eu]=Marmolaren zatia
Name[fi]=Marble-osa
Name[fr]=Composant Marble
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/gpx/marble_thumbnail_gpx.desktop
^
|
@@ -1,6 +1,7 @@
[Desktop Entry]
Type=Service
Name=GPX Geographic Data
+Name[ast]=Datos xeográficos GPX
Name[bg]=Географски данни – GPX
Name[bs]=GPX geografski podaci
Name[ca]=Dades geogràfiques GPX
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/json/JsonPlugin.cpp
^
|
@@ -57,7 +57,7 @@
QStringList JsonPlugin::fileExtensions() const
{
- return QStringList() << "json";
+ return QStringList() << "json" << "geojson";
}
ParsingRunner* JsonPlugin::newRunner() const
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/kml/marble_kml.desktop
^
|
@@ -60,6 +60,7 @@
Name[zh_TW]=地理_Marble
NoDisplay=true
GenericName=Virtual Globe
+GenericName[ast]=Globu virtual
GenericName[bg]=Настолен глобус
GenericName[bs]=Virtualni globus
GenericName[ca]=Globus virtual
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/kml/marble_kmz.desktop
^
|
@@ -60,6 +60,7 @@
Name[zh_TW]=地理_Marble
NoDisplay=true
GenericName=Virtual Globe
+GenericName[ast]=Globu virtual
GenericName[bg]=Настолен глобус
GenericName[bs]=Virtualni globus
GenericName[ca]=Globus virtual
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/kml/marble_part_kml.desktop
^
|
@@ -14,7 +14,7 @@
Name[en_GB]=Marble Part
Name[eo]=Marble Part
Name[es]=Part Marble
-Name[et]=Marble konponent
+Name[et]=Marble komponent
Name[eu]=Marmolaren zatia
Name[fi]=Marble-osa
Name[fr]=Composant Marble
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/kml/marble_part_kmz.desktop
^
|
@@ -14,7 +14,7 @@
Name[en_GB]=Marble Part
Name[eo]=Marble Part
Name[es]=Part Marble
-Name[et]=Marble konponent
+Name[et]=Marble komponent
Name[eu]=Marmolaren zatia
Name[fi]=Marble-osa
Name[fr]=Composant Marble
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/kml/marble_thumbnail_kml.desktop
^
|
@@ -1,6 +1,7 @@
[Desktop Entry]
Type=Service
Name=KML Geographic Data
+Name[ast]=Datos xeográficos KML
Name[bg]=Географски данни – KML
Name[bs]=KML Geografski podaci
Name[ca]=Dades geogràfiques KML
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/kml/marble_thumbnail_kmz.desktop
^
|
@@ -1,6 +1,7 @@
[Desktop Entry]
Type=Service
Name=KML Geographic Compressed Data
+Name[ast]=Datos comprimíos xeográficos KML
Name[bg]=Географски данни – KML, компресирани
Name[bs]=KML geografski kompresovani podaci
Name[ca]=Dades geogràfiques comprimides KML
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/openlocation-code-search
^
|
+(directory)
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/openlocation-code-search/CMakeLists.txt
^
|
@@ -0,0 +1,19 @@
+PROJECT( OpenLocationCodeSearchPlugin )
+
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${QT_INCLUDE_DIR}
+)
+if( QT4BUILD )
+ INCLUDE(${QT_USE_FILE})
+else()
+ INCLUDE_DIRECTORIES(${Qt5Sql_INCLUDE_DIRS})
+endif()
+
+set( openLocationCodeSearch_SRCS
+OpenLocationCodeSearchPlugin.cpp
+OpenLocationCodeSearchRunner.cpp
+ )
+
+marble_add_plugin( OpenLocationCodeSearchPlugin ${openLocationCodeSearch_SRCS} )
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchPlugin.cpp
^
|
@@ -0,0 +1,67 @@
+//
+// 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 2015 Constantin Mihalache <mihalache.c94@gmail.com>
+//
+
+#include "OpenLocationCodeSearchPlugin.h"
+#include "OpenLocationCodeSearchRunner.h"
+
+namespace Marble {
+
+OpenLocationCodeSearchPlugin::OpenLocationCodeSearchPlugin( QObject *parent ):
+ SearchRunnerPlugin( parent )
+{
+
+}
+
+QString OpenLocationCodeSearchPlugin::name() const
+{
+ return tr( "Open Location Code Search" );
+}
+
+QString OpenLocationCodeSearchPlugin::guiString() const
+{
+ return tr( "Open Location Code" );
+}
+
+QString OpenLocationCodeSearchPlugin::nameId() const
+{
+ return "openlocation-code-search";
+}
+
+QString OpenLocationCodeSearchPlugin::version() const
+{
+ return "1.0";
+}
+
+QString OpenLocationCodeSearchPlugin::description() const
+{
+ return tr( "Decodes an Open Location Code and creates a placemark with the respective coordinates" );
+}
+
+QString OpenLocationCodeSearchPlugin::copyrightYears() const
+{
+ return "2015";
+}
+
+QList<PluginAuthor> OpenLocationCodeSearchPlugin::pluginAuthors() const
+{
+ return QList<PluginAuthor>()
+ << PluginAuthor( QString::fromUtf8( "Constantin Mihalache" ), "mihalache.c94@gmail.com" );
+}
+
+SearchRunner* OpenLocationCodeSearchPlugin::newRunner() const
+{
+ return new OpenLocationCodeSearchRunner;
+}
+
+}
+
+Q_EXPORT_PLUGIN2( OpenLocationCodeSearchPlugin, Marble::OpenLocationCodeSearchPlugin )
+
+#include "moc_OpenLocationCodeSearchPlugin.cpp"
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchPlugin.h
^
|
@@ -0,0 +1,46 @@
+//
+// 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 2015 Constantin Mihalache <mihalache.c94@gmail.com>
+//
+
+#ifndef OPENLOCATIONCODESEARCHPLUGIN_H
+#define OPENLOCATIONCODESEARCHPLUGIN_H
+
+#include "SearchRunnerPlugin.h"
+namespace Marble {
+
+class OpenLocationCodeSearchPlugin : public SearchRunnerPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA( IID "org.kde.edu.marble.OpenLocationCodeSearchPlugin" )
+ Q_INTERFACES( Marble::SearchRunnerPlugin )
+
+public:
+ explicit OpenLocationCodeSearchPlugin(QObject *parent = 0);
+
+ QString name() const;
+
+ QString guiString() const;
+
+ QString nameId() const;
+
+ QString version() const;
+
+ QString description() const;
+
+ QString copyrightYears() const;
+
+ QList<PluginAuthor> pluginAuthors() const;
+
+ virtual SearchRunner* newRunner() const;
+
+};
+
+}
+
+#endif // OPENLOCATIONCODESEARCHPLUGIN_H
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchRunner.cpp
^
|
@@ -0,0 +1,198 @@
+//
+// 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 2015 Constantin Mihalache <mihalache.c94@gmail.com>
+//
+
+//self
+#include "OpenLocationCodeSearchRunner.h"
+#include "GeoDataPlacemark.h"
+#include "GeoDataStyle.h"
+#include "GeoDataLineStyle.h"
+#include "GeoDataPolyStyle.h"
+
+//Qt
+#include <QVector>
+
+namespace Marble
+{
+
+OpenLocationCodeSearchRunner::OpenLocationCodeSearchRunner( QObject *parent ):
+ SearchRunner( parent )
+{
+ // initialize the charIndex map
+ QString const acceptedChars = "23456789CFGHJMPQRVWX";
+ for( int index = 0; index < acceptedChars.size(); index++ ) {
+ charIndex[ acceptedChars[index] ] = index;
+ }
+}
+
+void OpenLocationCodeSearchRunner::search( const QString &searchTerm, const GeoDataLatLonBox &preferred )
+{
+ Q_UNUSED( preferred );
+
+ QVector<GeoDataPlacemark*> result;
+
+ if( isValidOLC( searchTerm.toUpper() ) ) {
+ GeoDataLatLonBox boundingBox = decodeOLC( searchTerm.toUpper() );
+ if( !boundingBox.isEmpty() ) {
+ GeoDataPlacemark *placemark = new GeoDataPlacemark( searchTerm );
+
+ GeoDataPolygon *geometry = new GeoDataPolygon( polygonFromLatLonBox( boundingBox ) );
+ placemark->setGeometry( geometry );
+
+ GeoDataStyle::Ptr style = GeoDataStyle::Ptr(new GeoDataStyle());
+ GeoDataLineStyle lineStyle;
+ GeoDataPolyStyle polyStyle;
+ lineStyle.setColor( QColor( Qt::GlobalColor::red ) );
+ lineStyle.setWidth( 2 );
+ polyStyle.setFill( false );
+ style->setLineStyle( lineStyle );
+ style->setPolyStyle( polyStyle );
+ placemark->setStyle( style );
+
+ result.append( placemark );
+ }
+ }
+
+ emit searchFinished( result );
+}
+
+GeoDataPolygon OpenLocationCodeSearchRunner::polygonFromLatLonBox( const GeoDataLatLonBox boundingBox ) const
+{
+ if( boundingBox.isEmpty() ) {
+ return GeoDataPolygon();
+ }
+
+ GeoDataPolygon poly;
+ GeoDataLinearRing outerBoundry;
+ // north-west corner
+ outerBoundry.append( GeoDataCoordinates( boundingBox.west(), boundingBox.north(), GeoDataCoordinates::Unit::Degree ) );
+ // north-east corner
+ outerBoundry.append( GeoDataCoordinates( boundingBox.east(), boundingBox.north(), GeoDataCoordinates::Unit::Degree ) );
+ // south-east corner
+ outerBoundry.append( GeoDataCoordinates( boundingBox.east(), boundingBox.south(), GeoDataCoordinates::Unit::Degree ) );
+ // south-west corner
+ outerBoundry.append( GeoDataCoordinates( boundingBox.west(), boundingBox.south(), GeoDataCoordinates::Unit::Degree ) );
+
+ poly.setOuterBoundary( outerBoundry );
+
+ return poly;
+}
+
+GeoDataLatLonBox OpenLocationCodeSearchRunner::decodeOLC( const QString &olc ) const
+{
+ if( !isValidOLC( olc ) ) {
+ return GeoDataLatLonBox();
+ }
+
+ // remove padding
+ QString decoded = olc;
+ decoded = decoded.remove( QRegExp("[0+]") );
+ qreal southLatitude = 0;
+ qreal westLongitude = 0;
+
+ int digit = 0;
+ qreal latitudeResolution = 400;
+ qreal longitudeResolution = 400;
+
+ while( digit < decoded.size() ) {
+ if( digit < 10 ) {
+ latitudeResolution /= 20;
+ longitudeResolution /= 20;
+ southLatitude += latitudeResolution * charIndex[ decoded[digit] ];
+ westLongitude += longitudeResolution * charIndex[ decoded[digit+1] ];
+ digit += 2;
+ }
+ else {
+ latitudeResolution /= 5;
+ longitudeResolution /= 4;
+ southLatitude += latitudeResolution *( charIndex[ decoded[digit] ] / 4 );
+ westLongitude += longitudeResolution *( charIndex[ decoded[digit] ] % 4 );
+ digit += 1;
+ }
+ }
+ return GeoDataLatLonBox( southLatitude - 90 + latitudeResolution, southLatitude - 90, westLongitude - 180 + longitudeResolution, westLongitude - 180, GeoDataCoordinates::Unit::Degree );
+}
+
+bool OpenLocationCodeSearchRunner::isValidOLC( const QString& olc ) const
+{
+ // It must have only one SEPARATOR located at an even index in
+ // the string.
+ QChar const separator('+');
+ int separatorPos = olc.indexOf(separator);
+ if( separatorPos == -1
+ || separatorPos != olc.lastIndexOf(separator)
+ || separatorPos % 2 != 0 )
+ {
+ return false;
+ }
+ int const separatorPosition = 8;
+ // It must be a full open location code.
+ if( separatorPos != separatorPosition ) {
+ return false;
+ }
+
+ // Test the first two characters as only some characters of the
+ // ACCEPTED_CHARS are allowed.
+ //
+ // First latitude character can only take one of the first 9 values.
+ int index0 = charIndex.value( olc[0], -1 );
+ if( index0 == -1 || index0 > 8 ) {
+ return false;
+ }
+ // First longitude character can only take one of the first 18 values.
+ int index1 = charIndex.value( olc[1], -1 );
+ if( index1 == -1 || index1 > 17) {
+ return false;
+ }
+
+ // Test the characters before the SEPARATOR.
+ QChar const suffixPadding('0');
+ bool paddingBegun = false;
+ for( int index = 0; index < separatorPos; index++ ) {
+ if( paddingBegun ) {
+ // Once padding has begun, there should be only padding.
+ if( olc[index] != suffixPadding ) {
+ return false;
+ }
+ continue;
+ }
+ if( charIndex.contains( olc[index] ) ) {
+ continue;
+ }
+ if( olc[index] == suffixPadding ) {
+ paddingBegun = true;
+ // Padding can start only at an even index.
+ if( index % 2 != 0 ) {
+ return false;
+ }
+ continue;
+ }
+ return false;
+ }
+
+ // Test the characters after the SEPARATOR.
+ if( olc.size() > separatorPos +1 ) {
+ if( paddingBegun ) {
+ return false;
+ }
+ // Only one character after the SEPARATOR is not allowed.
+ if( olc.size() == separatorPos + 2 ) {
+ return false;
+ }
+ for( int index = separatorPos + 1; index < olc.size(); index++ ) {
+ if( !charIndex.contains( olc[index] ) ) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+}
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchRunner.h
^
|
@@ -0,0 +1,57 @@
+//
+// 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 2015 Constantin Mihalache <mihalache.c94@gmail.com>
+//
+
+#ifndef OPENLOCATIONCODESEARCHRUNNER_H
+#define OPENLOCATIONCODESEARCHRUNNER_H
+
+#include "SearchRunner.h"
+#include "GeoDataLatLonBox.h"
+#include "GeoDataPolygon.h"
+#include "MarbleDebug.h"
+
+namespace Marble
+{
+
+class OpenLocationCodeSearchRunner : public SearchRunner
+{
+ Q_OBJECT
+public:
+ explicit OpenLocationCodeSearchRunner( QObject *parent = 0 );
+
+ void search( const QString &searchTerm, const GeoDataLatLonBox &preferred );
+
+private:
+
+ /**
+ * Makes a GeoDataPolygon which contains the boundary points of the
+ * boundingBox parameter.
+ */
+ GeoDataPolygon polygonFromLatLonBox( const GeoDataLatLonBox boundingBox ) const;
+
+ /**
+ * Decode a valid open location code string into a GeoDataLatLonBox.
+ */
+ GeoDataLatLonBox decodeOLC( const QString &ocl ) const;
+
+ /**
+ * Decide if the string is a valid & full open location code.
+ */
+ bool isValidOLC( const QString &ocl ) const;
+
+ /**
+ * Maps each character from the accepted chars to its coresponding index
+ * inside the string.
+ */
+ QHash<QChar, int> charIndex;
+};
+
+}
+
+#endif // OPENLOCATIONCODESEARCHRUNNER_H
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/CMakeLists.txt
^
|
@@ -30,6 +30,7 @@
OsmWay.cpp
OsmRelation.cpp
OsmElementDictionary.cpp
+ o5mreader.cpp
)
marble_add_plugin( OsmPlugin ${osm_SRCS} ${osm_writers_SRCS} ${osm_translators_SRCS} )
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/OsmNode.cpp
^
|
@@ -24,7 +24,12 @@
{
qreal const lon = attributes.value( "lon" ).toDouble();
qreal const lat = attributes.value( "lat" ).toDouble();
- m_coordinates = GeoDataCoordinates(lon, lat, 0, GeoDataCoordinates::Degree);
+ setCoordinates(GeoDataCoordinates(lon, lat, 0, GeoDataCoordinates::Degree));
+}
+
+void OsmNode::setCoordinates(const GeoDataCoordinates &coordinates)
+{
+ m_coordinates = coordinates;
}
void OsmNode::create(GeoDataDocument *document) const
@@ -52,13 +57,24 @@
qreal const lat = m_coordinates.latitude(GeoDataCoordinates::Degree);
if (qAbs(lat) > 15) {
/** @todo Should maybe auto-adjust to MarbleClock at some point */
- QDate const date = QDate::currentDate();
+ int const month = QDate::currentDate().month();
+ QString season;
bool const southernHemisphere = lat < 0;
- QDate const autumnStart = QDate(date.year(), southernHemisphere ? 3 : 9, 15);
- QDate const winterEnd = southernHemisphere ? QDate(date.year(), 8, 15) : QDate(date.year()+1, 2, 15);
- if (date > autumnStart && date < winterEnd) {
- QDate const autumnEnd = QDate(date.year(), southernHemisphere ? 5 : 11, 15);
- QString const season = date < autumnEnd ? "autumn" : "winter";
+ if (southernHemisphere) {
+ if (month >= 3 && month <= 5) {
+ season = "autumn";
+ } else if (month >= 6 && month <= 8) {
+ season = "winter";
+ }
+ } else {
+ if (month >= 9 && month <= 11) {
+ season = "autumn";
+ } else if (month == 12 || month == 1 || month == 2) {
+ season = "winter";
+ }
+ }
+
+ if (!season.isEmpty()) {
GeoDataIconStyle iconStyle = placemark->style()->iconStyle();
QString const bitmap = QString("bitmaps/osmcarto/symbols/48/individual/tree-29-%1.png").arg(season);
iconStyle.setIconPath(MarbleDirs::path(bitmap));
@@ -66,7 +82,6 @@
GeoDataStyle::Ptr style(new GeoDataStyle(*placemark->style()));
style->setIconStyle(iconStyle);
placemark->setStyle(style);
-
}
}
}
@@ -117,7 +132,7 @@
return popidx;
}
-GeoDataCoordinates OsmNode::coordinates() const
+const GeoDataCoordinates &OsmNode::coordinates() const
{
return m_coordinates;
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/OsmNode.h
^
|
@@ -23,8 +23,9 @@
public:
OsmPlacemarkData & osmData();
void parseCoordinates(const QXmlStreamAttributes &attributes);
+ void setCoordinates(const GeoDataCoordinates &coordinates);
- GeoDataCoordinates coordinates() const;
+ const GeoDataCoordinates & coordinates() const;
const OsmPlacemarkData & osmData() const;
void create(GeoDataDocument* document) const;
@@ -36,7 +37,7 @@
GeoDataCoordinates m_coordinates;
};
-typedef QMap<qint64,OsmNode> OsmNodes;
+typedef QHash<qint64,OsmNode> OsmNodes;
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/OsmParser.cpp
^
|
@@ -21,6 +21,7 @@
#include "GeoDataTypes.h"
#include "GeoDataStyle.h"
#include <MarbleZipReader.h>
+#include "o5mreader.h"
#include <QFile>
#include <QFileInfo>
@@ -30,6 +31,84 @@
GeoDataDocument *OsmParser::parse(const QString &filename, QString &error)
{
+ QFileInfo const fileInfo(filename);
+ if (fileInfo.completeSuffix() == "o5m") {
+ return parseO5m(filename, error);
+ } else {
+ return parseXml(filename, error);
+ }
+}
+
+GeoDataDocument* OsmParser::parseO5m(const QString &filename, QString &error)
+{
+ O5mreader* reader;
+ O5mreaderDataset data;
+ O5mreaderIterateRet outerState, innerState;
+ char *key, *value;
+
+ OsmNodes nodes;
+ OsmWays ways;
+ OsmRelations relations;
+ QHash<uint8_t, QString> relationTypes;
+ relationTypes[O5MREADER_DS_NODE] = "node";
+ relationTypes[O5MREADER_DS_WAY] = "way";
+ relationTypes[O5MREADER_DS_REL] = "relation";
+
+ auto file = fopen(filename.toStdString().c_str(), "rb");
+ o5mreader_open(&reader, file);
+
+ while( (outerState = o5mreader_iterateDataSet(reader, &data)) == O5MREADER_ITERATE_RET_NEXT) {
+ switch (data.type) {
+ case O5MREADER_DS_NODE:
+ {
+ OsmNode& node = nodes[data.id];
+ node.osmData().setId(data.id);
+ node.setCoordinates(GeoDataCoordinates(data.lon*1.0e-7, data.lat*1.0e-7,
+ 0.0, GeoDataCoordinates::Degree));
+ while ((innerState = o5mreader_iterateTags(reader, &key, &value)) == O5MREADER_ITERATE_RET_NEXT) {
+ node.osmData().addTag(key, value);
+ }
+ }
+ break;
+ case O5MREADER_DS_WAY:
+ {
+ OsmWay &way = ways[data.id];
+ way.osmData().setId(data.id);
+ uint64_t nodeId;
+ while ((innerState = o5mreader_iterateNds(reader, &nodeId)) == O5MREADER_ITERATE_RET_NEXT) {
+ way.addReference(nodeId);
+ }
+ while ((innerState = o5mreader_iterateTags(reader, &key, &value)) == O5MREADER_ITERATE_RET_NEXT) {
+ way.osmData().addTag(key, value);
+ }
+ }
+ break;
+ case O5MREADER_DS_REL:
+ {
+ OsmRelation &relation = relations[data.id];
+ relation.osmData().setId(data.id);
+ char *role;
+ uint8_t type;
+ uint64_t refId;
+ while ((innerState = o5mreader_iterateRefs(reader, &refId, &type, &role)) == O5MREADER_ITERATE_RET_NEXT) {
+ relation.addMember(refId, role, relationTypes[type]);
+ }
+ while ((innerState = o5mreader_iterateTags(reader, &key, &value)) == O5MREADER_ITERATE_RET_NEXT) {
+ relation.osmData().addTag(key, value);
+ }
+ }
+ break;
+ }
+ }
+
+ fclose(file);
+ error = reader->errMsg;
+ o5mreader_close(reader);
+ return createDocument(nodes, ways, relations);
+}
+
+GeoDataDocument* OsmParser::parseXml(const QString &filename, QString &error)
+{
QXmlStreamReader parser;
QFile file;
QBuffer buffer;
@@ -129,6 +208,7 @@
foreach(OsmNode const &node, nodes) {
node.create(document);
}
+
return document;
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/OsmParser.h
^
|
@@ -30,6 +30,8 @@
static GeoDataDocument* parse(const QString &filename, QString &error);
private:
+ static GeoDataDocument* parseXml(const QString &filename, QString &error);
+ static GeoDataDocument* parseO5m(const QString &filename, QString &error);
static GeoDataDocument *createDocument(OsmNodes &nodes, OsmWays &way, OsmRelations &relations);
};
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/OsmPlugin.cpp
^
|
@@ -40,13 +40,14 @@
QString OsmPlugin::copyrightYears() const
{
- return "2011";
+ return "2011, 2016";
}
QList<PluginAuthor> OsmPlugin::pluginAuthors() const
{
return QList<PluginAuthor>()
- << PluginAuthor( "Thibaut Gridel", "tgridel@free.fr" );
+ << PluginAuthor( "Thibaut Gridel", "tgridel@free.fr" )
+ << PluginAuthor( "Dennis Nienhüser", "nienhueser@kde.org" );
}
QString OsmPlugin::fileFormatDescription() const
@@ -56,7 +57,7 @@
QStringList OsmPlugin::fileExtensions() const
{
- return QStringList() << "osm" << "osm.zip";
+ return QStringList() << "osm" << "osm.zip" << "o5m";
}
ParsingRunner* OsmPlugin::newRunner() const
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/OsmRelation.cpp
^
|
@@ -34,10 +34,17 @@
void OsmRelation::parseMember(const QXmlStreamAttributes &attributes)
{
+ addMember(attributes.value("ref").toLongLong(),
+ attributes.value("role").toString(),
+ attributes.value("type").toString());
+}
+
+void OsmRelation::addMember(qint64 reference, const QString &role, const QString &type)
+{
OsmMember member;
- member.reference = attributes.value("ref").toLongLong();
- member.role = attributes.value("role").toString();
- member.type = attributes.value("type").toString();
+ member.reference = reference;
+ member.role = role;
+ member.type = type;
m_members << member;
}
@@ -60,13 +67,21 @@
GeoDataFeature::GeoDataVisualCategory outerCategory = OsmPresetLibrary::determineVisualCategory(m_osmData);
if (outerCategory == GeoDataFeature::None) {
// Try to determine the visual category from the relation members
- foreach(qint64 wayId, outerWays) {
- GeoDataFeature::GeoDataVisualCategory const category = OsmPresetLibrary::determineVisualCategory(ways[wayId].osmData());
- if (category != GeoDataFeature::None) {
- outerCategory = category;
+ bool categoriesAreSame = true;
+ auto iterator = outerWays.begin();
+ GeoDataFeature::GeoDataVisualCategory const firstCategory =
+ OsmPresetLibrary::determineVisualCategory(ways[*iterator].osmData());
+ for( ; iterator != outerWays.end(); ++iterator ) {
+ GeoDataFeature::GeoDataVisualCategory const category =
+ OsmPresetLibrary::determineVisualCategory(ways[*iterator].osmData());
+ if( category != firstCategory ) {
+ categoriesAreSame = false;
break;
}
}
+ if( categoriesAreSame ) {
+ outerCategory = firstCategory;
+ }
}
foreach(qint64 wayId, outerWays) {
Q_ASSERT(ways.contains(wayId));
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/OsmRelation.h
^
|
@@ -28,6 +28,7 @@
public:
OsmPlacemarkData & osmData();
void parseMember(const QXmlStreamAttributes &attributes);
+ void addMember(qint64 reference, const QString &role, const QString &type);
const OsmPlacemarkData & osmData() const;
@@ -49,7 +50,7 @@
QVector<OsmMember> m_members;
};
-typedef QMap<qint64,OsmRelation> OsmRelations;
+typedef QHash<qint64,OsmRelation> OsmRelations;
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/OsmWay.cpp
^
|
@@ -44,12 +44,13 @@
placemark->setGeometry(linearRing);
foreach(qint64 nodeId, m_references) {
- if (!nodes.contains(nodeId)) {
+ auto const nodeIter = nodes.constFind(nodeId);
+ if (nodeIter == nodes.constEnd()) {
delete placemark;
return;
}
- OsmNode const & node = nodes[nodeId];
+ OsmNode const & node = nodeIter.value();
placemark->osmData().addNodeReference(node.coordinates(), node.osmData());
linearRing->append(node.coordinates());
}
@@ -90,12 +91,13 @@
placemark->setGeometry(lineString);
foreach(qint64 nodeId, m_references) {
- if (!nodes.contains(nodeId)) {
+ auto const nodeIter = nodes.constFind(nodeId);
+ if (nodeIter == nodes.constEnd()) {
delete placemark;
return;
}
- OsmNode const & node = nodes[nodeId];
+ OsmNode const & node = nodeIter.value();
placemark->osmData().addNodeReference(node.coordinates(), node.osmData());
lineString->append(node.coordinates());
}
@@ -106,7 +108,7 @@
GeoDataLineStyle lineStyle = placemark->style()->lineStyle();
lineStyle.setCosmeticOutline(true);
- if (placemark->visualCategory() > GeoDataFeature::HighwayService &&
+ if (placemark->visualCategory() >= GeoDataFeature::HighwayService &&
placemark->visualCategory() <= GeoDataFeature::HighwayMotorway) {
bool const isOneWay = m_osmData.containsTag("oneway", "yes") || m_osmData.containsTag("oneway", "-1");
int const lanes = isOneWay ? 1 : 2; // also for motorway which implicitly is one way, but has two lanes and each direction has its own highway
@@ -116,7 +118,17 @@
lineStyle.setPhysicalWidth(physicalWidth);
- if( m_osmData.containsTag("tunnel", "yes") ) {
+ QString const accessValue = m_osmData.tagValue("access");
+ if (accessValue == "private" || accessValue == "no" || accessValue == "agricultural" || accessValue == "delivery" || accessValue == "forestry") {
+ QColor polyColor = polyStyle.color();
+ qreal hue, sat, val;
+ polyColor.getHsvF(&hue, &sat, &val);
+ polyColor.setHsvF(0.98, qMin(1.0, 0.2 + sat), val);
+ polyStyle.setColor(polyColor);
+ lineStyle.setColor(lineStyle.color().darker(150));
+ }
+
+ if (m_osmData.containsTag("tunnel", "yes") ) {
QColor polyColor = polyStyle.color();
qreal hue, sat, val;
polyColor.getHsvF(&hue, &sat, &val);
@@ -124,6 +136,7 @@
polyStyle.setColor(polyColor);
lineStyle.setColor(lineStyle.color().lighter(115));
}
+
} else if (placemark->visualCategory() == GeoDataFeature::NaturalWater) {
QString const widthValue = m_osmData.tagValue("width").replace(" meters", QString()).replace(" m", QString());
bool ok;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/OsmWay.h
^
|
@@ -36,7 +36,7 @@
OsmPlacemarkData m_osmData;
QVector<qint64> m_references;
};
-typedef QMap<qint64,OsmWay> OsmWays;
+typedef QHash<qint64,OsmWay> OsmWays;
}
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/marble_osm.desktop
^
|
@@ -60,6 +60,7 @@
Name[zh_TW]=地理_Marble
NoDisplay=true
GenericName=Virtual Globe
+GenericName[ast]=Globu virtual
GenericName[bg]=Настолен глобус
GenericName[bs]=Virtualni globus
GenericName[ca]=Globus virtual
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/marble_part_osm.desktop
^
|
@@ -14,7 +14,7 @@
Name[en_GB]=Marble Part
Name[eo]=Marble Part
Name[es]=Part Marble
-Name[et]=Marble konponent
+Name[et]=Marble komponent
Name[eu]=Marmolaren zatia
Name[fi]=Marble-osa
Name[fr]=Composant Marble
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/marble_thumbnail_osm.desktop
^
|
@@ -1,6 +1,7 @@
[Desktop Entry]
Type=Service
Name=OSM Data
+Name[ast]=Datos d'OSM
Name[bg]=Данни OSM
Name[bs]=OSM podaci
Name[ca]=Dades OSM
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/o5mreader.cpp
^
|
@@ -0,0 +1,532 @@
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+
+#include "o5mreader.h"
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+
+#define STR_PAIR_TABLE_SIZE 15000
+#define STR_PAIR_STRING_SIZE 256
+
+
+O5mreaderRet o5mreader_readUInt(O5mreader *pReader, uint64_t *ret) {
+ uint8_t b;
+ uint8_t i = 0;
+ *ret = 0LL;
+
+ do {
+ if ( fread(&b,1,1,pReader->f) == 0 ) {
+ o5mreader_setError(pReader,
+ O5MREADER_ERR_CODE_UNEXPECTED_END_OF_FILE,
+ NULL
+ );
+ return O5MREADER_RET_ERR;
+ }
+ *ret |= (long long)(b & 0x7f) << (i++ * 7);
+ } while ( b & 0x80 );
+
+ o5mreader_setNoError(pReader);
+
+ return O5MREADER_RET_OK;
+}
+
+O5mreaderRet o5mreader_readInt(O5mreader *pReader, uint64_t *ret) {
+ if ( o5mreader_readUInt(pReader, ret) == O5MREADER_RET_ERR )
+ return O5MREADER_RET_ERR;
+ *ret = *ret & 1
+ ? -(int64_t)(*ret >> 1) - 1
+ : (int64_t)(*ret >> 1);
+ return O5MREADER_RET_OK;
+}
+
+
+O5mreaderRet o5mreader_readStrPair(O5mreader *pReader, char **tagpair, int single) {
+ static char buffer[1024];
+ char* pBuf;
+ static uint64_t pointer = 0;
+ int length;
+ uint64_t key;
+ int i;
+
+ if ( o5mreader_readUInt(pReader,&key) == O5MREADER_RET_ERR ) {
+ return O5MREADER_RET_ERR;
+ }
+
+ if ( key ) {
+ *tagpair = pReader->strPairTable[(pointer+15000-key)%15000];
+ return key;
+ }
+ else {
+ pBuf = buffer;
+ for ( i=0; i<(single?1:2); i++ ) {
+ do {
+ if ( fread(pBuf,1,1,pReader->f) == 0 ) {
+ o5mreader_setError(pReader,
+ O5MREADER_ERR_CODE_UNEXPECTED_END_OF_FILE,
+ NULL
+ );
+ return O5MREADER_RET_ERR;
+ }
+ } while ( *(pBuf++) );
+ }
+
+ length = strlen(buffer) + (single ? 1 : strlen(buffer+strlen(buffer) +1) + 2);
+
+ if ( length <= 252 ) {
+ *tagpair = pReader->strPairTable[(pointer+15000)%15000];
+ memcpy(pReader->strPairTable[((pointer++)+15000)%15000],buffer,length);
+ }
+ else {
+ *tagpair = buffer;
+ }
+
+ }
+
+ return O5MREADER_RET_OK;
+}
+
+O5mreaderRet o5mreader_reset(O5mreader *pReader) {
+ pReader->nodeId = pReader->wayId = pReader->wayNodeId = pReader->relId = pReader->nodeRefId = pReader->wayRefId = pReader->relRefId = 0;
+ pReader->lon = pReader->lat = 0;
+ pReader->offset = 0;
+ pReader->canIterateTags = pReader->canIterateNds = pReader->canIterateRefs = 0;
+ return O5MREADER_RET_OK;
+}
+
+O5mreaderRet o5mreader_open(O5mreader **ppReader,FILE* f) {
+ uint8_t byte;
+ int i;
+ *ppReader = (O5mreader*)malloc(sizeof(O5mreader));
+ if ( !(*ppReader) ) {
+ return O5MREADER_RET_ERR;
+ }
+ (*ppReader)->errMsg = NULL;
+ (*ppReader)->f = f;
+ if ( fread(&byte,1,1,(*ppReader)->f) == 0 ) {
+ o5mreader_setError(*ppReader,
+ O5MREADER_ERR_CODE_UNEXPECTED_END_OF_FILE,
+ NULL
+ );
+ return O5MREADER_RET_ERR;
+ }
+ if ( byte != O5MREADER_DS_RESET ) {
+ o5mreader_setError(*ppReader,
+ O5MREADER_ERR_CODE_FILE_HAS_WRONG_START,
+ NULL
+ );
+ return O5MREADER_RET_ERR;
+ }
+
+ o5mreader_reset(*ppReader);
+
+ (*ppReader)->strPairTable = (char**) malloc(STR_PAIR_TABLE_SIZE*sizeof(char*));
+ if ( (*ppReader)->strPairTable == 0 ) {
+ o5mreader_setError(*ppReader,
+ O5MREADER_ERR_CODE_MEMORY_ERROR,
+ NULL
+ );
+ return O5MREADER_RET_ERR;
+ }
+ for ( i = 0; i < STR_PAIR_TABLE_SIZE; ++i ) {
+ (*ppReader)->strPairTable[i] = (char*) malloc(sizeof(char)*STR_PAIR_STRING_SIZE);
+ if ( (*ppReader)->strPairTable[i] == 0 ) {
+ o5mreader_setError(*ppReader,
+ O5MREADER_ERR_CODE_MEMORY_ERROR,
+ NULL
+ );
+ return O5MREADER_RET_ERR;
+ }
+ }
+
+ o5mreader_setNoError(*ppReader);
+ return O5MREADER_RET_OK;
+}
+
+void o5mreader_close(O5mreader *pReader) {
+ int i;
+ if ( pReader ) {
+ if ( pReader->strPairTable ) {
+ for ( i = 0; i < STR_PAIR_TABLE_SIZE; ++i )
+ if ( pReader->strPairTable[i] )
+ free(pReader->strPairTable[i]);
+ free(pReader->strPairTable);
+ }
+ o5mreader_setNoError(pReader);
+ free(pReader);
+ }
+}
+
+const char* o5mreader_strerror(int errCode) {
+ switch ( errCode ) {
+ case O5MREADER_ERR_CODE_FILE_HAS_WRONG_START:
+ return "'0xFF' isn't first byte of file.";
+ case O5MREADER_ERR_CODE_MEMORY_ERROR:
+ return "Memory error.";
+ case O5MREADER_ERR_CODE_UNEXPECTED_END_OF_FILE:
+ return "Unexpected end of file.";
+ case O5MREADER_ERR_CODE_CAN_NOT_ITERATE_TAGS_HERE:
+ return "Tags iteration is not allowed here.";
+ case O5MREADER_ERR_CODE_CAN_NOT_ITERATE_NDS_HERE:
+ return "Nodes iteration is not allowed here.";
+ case O5MREADER_ERR_CODE_CAN_NOT_ITERATE_REFS_HERE:
+ return "References iteration is not allowed here.";
+ default:
+ return "Unknown error code";
+ }
+}
+
+void o5mreader_setError(O5mreader *pReader,int code, const char* message) {
+ pReader->errCode = code;
|
[-]
[+]
|
Added |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/osm/o5mreader.h
^
|
@@ -0,0 +1,122 @@
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+
+#ifndef __O5MREADER__H__
+#define __O5MREADER__H__
+
+#include <stdint.h>
+#include <stdio.h>
+
+
+#define O5MREADER_RET_OK 1
+#define O5MREADER_RET_ERR 0
+
+#define O5MREADER_ITERATE_RET_DONE 0
+#define O5MREADER_ITERATE_RET_ERR -1
+#define O5MREADER_ITERATE_RET_NEXT 1
+
+#define O5MREADER_DS_END 0xfe
+#define O5MREADER_DS_NODE 0x10
+#define O5MREADER_DS_WAY 0x11
+#define O5MREADER_DS_REL 0x12
+#define O5MREADER_DS_BBOX 0xdb
+#define O5MREADER_DS_TSTAMP 0xdc
+#define O5MREADER_DS_HEADER 0xe0
+#define O5MREADER_DS_SYNC 0xee
+#define O5MREADER_DS_JUMP 0xef
+#define O5MREADER_DS_RESET 0xff
+
+
+#define O5MREADER_ERR_CODE_OK 0
+#define O5MREADER_ERR_CODE_FILE_HAS_WRONG_START 1
+#define O5MREADER_ERR_CODE_UNEXPECTED_END_OF_FILE 2
+#define O5MREADER_ERR_CODE_MEMORY_ERROR 3
+#define O5MREADER_ERR_CODE_CAN_NOT_ITERATE_TAGS_HERE 4
+#define O5MREADER_ERR_CODE_CAN_NOT_ITERATE_NDS_HERE 5
+#define O5MREADER_ERR_CODE_CAN_NOT_ITERATE_REFS_HERE 6
+
+typedef int O5mreaderRet;
+typedef int O5mreaderIterateRet;
+
+typedef struct {
+ int errCode;
+ char* errMsg;
+ FILE *f;
+ uint64_t offset;
+ uint64_t offsetNd;
+ uint64_t offsetRf;
+ uint64_t current;
+ char* tagPair;
+ int64_t nodeId;
+ int64_t wayId;
+ int64_t wayNodeId;
+ int64_t relId;
+ int64_t nodeRefId;
+ int64_t wayRefId;
+ int64_t relRefId;
+ int32_t lon;
+ int32_t lat;
+ uint8_t canIterateTags;
+ uint8_t canIterateNds;
+ uint8_t canIterateRefs;
+ char** strPairTable;
+} O5mreader;
+
+typedef struct {
+ uint8_t type;
+ uint64_t id;
+ uint32_t version;
+ uint8_t isEmpty;
+ int32_t lon;
+ int32_t lat;
+} O5mreaderDataset;
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+void o5mreader_setError(O5mreader *pReader,int code, const char* message);
+void o5mreader_setNoError(O5mreader *pReader);
+O5mreaderIterateRet o5mreader_skipTags(O5mreader *pReader);
+O5mreaderIterateRet o5mreader_readNode(O5mreader *pReader, O5mreaderDataset* ds);
+O5mreaderIterateRet o5mreader_readWay(O5mreader *pReader, O5mreaderDataset* ds);
+O5mreaderIterateRet o5mreader_readRel(O5mreader *pReader, O5mreaderDataset* ds);
+O5mreaderIterateRet o5mreader_skipRefs(O5mreader *pReader);
+O5mreaderIterateRet o5mreader_skipNds(O5mreader *pReader);
+O5mreaderRet o5mreader_readInt(O5mreader *pReader, uint64_t *ret);
+
+O5mreaderRet o5mreader_open(O5mreader **ppReader,FILE* f);
+
+void o5mreader_close(O5mreader *pReader);
+
+const char* o5mreader_strerror(int errCode);
+
+O5mreaderIterateRet o5mreader_iterateDataSet(O5mreader *pReader, O5mreaderDataset* ds);
+
+O5mreaderIterateRet o5mreader_iterateTags(O5mreader *pReader, char** pKey, char** pVal);
+
+O5mreaderIterateRet o5mreader_iterateNds(O5mreader *pReader, uint64_t *nodeId);
+
+O5mreaderIterateRet o5mreader_iterateRefs(O5mreader *pReader, uint64_t *refId, uint8_t *type, char** pRole);
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif //__O5MREADER__H__
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/shp/marble_part_shp.desktop
^
|
@@ -14,7 +14,7 @@
Name[en_GB]=Marble Part
Name[eo]=Marble Part
Name[es]=Part Marble
-Name[et]=Marble konponent
+Name[et]=Marble komponent
Name[eu]=Marmolaren zatia
Name[fi]=Marble-osa
Name[fr]=Composant Marble
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/shp/marble_shp.desktop
^
|
@@ -60,6 +60,7 @@
Name[zh_TW]=地理_Marble
NoDisplay=true
GenericName=Virtual Globe
+GenericName[ast]=Globu virtual
GenericName[bg]=Настолен глобус
GenericName[bs]=Virtualni globus
GenericName[ca]=Globus virtual
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/src/plugins/runner/shp/marble_thumbnail_shp.desktop
^
|
@@ -1,6 +1,7 @@
[Desktop Entry]
Type=Service
Name=ESRI Shapefile
+Name[ast]=Ficheru de formes ESRI
Name[bg]=Файл с форми ESRI
Name[bs]=ESRI datoteka s likovima
Name[ca]=Fitxers de formes ESRI
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/tests/ViewportParamsTest.cpp
^
|
@@ -371,8 +371,10 @@
QTest::newRow("Mercator NoTesselation acrossIDLRing")
<< projection << flags << acrossIDLRing << 2;
+#ifdef BUG_357540_IS_FIXED
QTest::newRow("Mercator NoTesselation aroundSPoleRing")
<< projection << flags << aroundSPoleRing << 2;
+#endif
flags = Tessellate;
QTest::newRow("Mercator Tesselate normalRing")
@@ -381,8 +383,10 @@
QTest::newRow("Mercator Tesselate acrossIDLRing")
<< projection << flags << acrossIDLRing << 2;
+#ifdef BUG_357540_IS_FIXED
QTest::newRow("Mercator Tesselate aroundSPoleRing")
<< projection << flags << aroundSPoleRing << 2;
+#endif
flags = Tessellate | RespectLatitudeCircle;
QTest::newRow("Mercator LatitudeCircle normalRing")
@@ -391,8 +395,10 @@
QTest::newRow("Mercator LatitudeCircle acrossIDLRing")
<< projection << flags << acrossIDLRing << 2;
+#ifdef BUG_357540_IS_FIXED
QTest::newRow("Mercator LatitudeCircle aroundSPoleRing")
<< projection << flags << aroundSPoleRing << 2;
+#endif
projection = Equirectangular;
@@ -403,8 +409,10 @@
QTest::newRow("Equirect NoTesselation acrossIDLRing")
<< projection << flags << acrossIDLRing << 2;
+#ifdef BUG_357540_IS_FIXED
QTest::newRow("Equirect NoTesselation aroundSPoleRing")
<< projection << flags << aroundSPoleRing << 2;
+#endif
flags = Tessellate;
QTest::newRow("Equirect Tesselate normalRing")
@@ -413,8 +421,10 @@
QTest::newRow("Equirect Tesselate acrossIDLRing")
<< projection << flags << acrossIDLRing << 2;
+#ifdef BUG_357540_IS_FIXED
QTest::newRow("Equirect Tesselate aroundSPoleRing")
<< projection << flags << aroundSPoleRing << 2;
+#endif
flags = Tessellate | RespectLatitudeCircle;
QTest::newRow("Equirect LatitudeCircle normalRing")
@@ -423,8 +433,10 @@
QTest::newRow("Equirect LatitudeCircle acrossIDLRing")
<< projection << flags << acrossIDLRing << 2;
+#ifdef BUG_357540_IS_FIXED
QTest::newRow("Equirect LatitudeCircle aroundSPoleRing")
<< projection << flags << aroundSPoleRing << 2;
+#endif
projection = Spherical;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/tools/constellations2kml/constellations2kml.cpp
^
|
@@ -154,8 +154,8 @@
<< " <LineString> \n"
<< " <coordinates> \n";
}
- QHash<int, QPair<qreal, qreal> >::const_iterator j = hash.find( starIndexes.at(i).toInt() );
- while( j != hash.end() && j.key() == starIndexes.at(i).toInt() ) {
+ QHash<int, QPair<qreal, qreal> >::const_iterator j = hash.constFind( starIndexes.at(i).toInt() );
+ while( j != hash.constEnd() && j.key() == starIndexes.at(i).toInt() ) {
out << " " << j.value().first << "," << j.value().second << " \n";
x.append( cos( j.value().first * DEG2RAD ) * cos( j.value().second * DEG2RAD ) );
y.append( sin( j.value().first * DEG2RAD ) * cos( j.value().second * DEG2RAD ) );
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/tools/mapreproject/OsmTileClusterRenderer.cpp
^
|
@@ -62,8 +62,8 @@
void OsmTileClusterRenderer::initMapSources()
{
- QVector<ReadOnlyMapDefinition>::const_iterator pos = m_mapSourceDefinitions.begin();
- QVector<ReadOnlyMapDefinition>::const_iterator const end = m_mapSourceDefinitions.end();
+ QVector<ReadOnlyMapDefinition>::const_iterator pos = m_mapSourceDefinitions.constBegin();
+ QVector<ReadOnlyMapDefinition>::const_iterator const end = m_mapSourceDefinitions.constEnd();
for (; pos != end; ++pos )
{
ReadOnlyMapImage * const mapImage = (*pos).createReadOnlyMap();
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/tools/mapreproject/main.cpp
^
|
@@ -113,14 +113,20 @@
TheEnd
};
+ char optionType[] = "type";
+ char optionBaseDirectory[] = "base-directory";
+ char optionFile[] = "file";
+ char optionTileLevel[] = "tile-level";
+ char optionInterpolationMethod[] = "interpolation-method";
+ char optionCacheSize[] = "cache-size";
char * const input_opts[] =
{
- "type",
- "base-directory",
- "file",
- "tile-level",
- "interpolation-method",
- "cache-size",
+ optionType,
+ optionBaseDirectory,
+ optionFile,
+ optionTileLevel,
+ optionInterpolationMethod,
+ optionCacheSize,
NULL
};
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/tools/osm-addresses/main.cpp
^
|
@@ -37,6 +37,7 @@
qDebug() << "Debug: " << context.file << ":" << context.line << " " << msg;
}
break;
+ case QtInfoMsg:
case QtWarningMsg:
if ( debugLevel < Mute ) {
qDebug() << "Info: " << context.file << ":" << context.line << " " << msg;
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/tools/vectortilecreator/vectortilecreator.py
^
|
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
@@ -12,7 +12,7 @@
#
"""
-Creates vector tiles (small .osm.zip files with standardized path/filenames) from larger osm files
+Creates vector tiles (small .o5m files with standardized path/filenames) from larger osm (pbf) files
"""
@@ -22,7 +22,6 @@
import csv
import time
from subprocess import call
-import zipfile
import argparse
import urllib3
@@ -106,22 +105,18 @@
tl = num2deg(x-1, y-1, zoom)
br = num2deg(x, y, zoom)
path = "{}/{}/{}".format(args.directory, zoom, x-1)
- target = "{}.osm".format(y-1)
- filterTarget = "{}_tmp.osm".format(y-1)
- zipTarget = "{}.osm.zip".format(y-1)
- if not args.overwrite and os.path.exists(os.path.join(path, zipTarget)):
- print("Skipping existing file {}\r".format(os.path.join(path, zipTarget)), end='')
+ target = "{}.o5m".format(y-1)
+ filterTarget = "{}_tmp.o5m".format(y-1)
+ if not args.overwrite and os.path.exists(os.path.join(path, target)):
+ print("Skipping existing file {}\r".format(os.path.join(path, target)), end='')
else:
call(["mkdir", "-p", path])
- print ("{} level {}: {}/{} {}\r".format(bounds[1], zoom, count, total, os.path.join(path, zipTarget)), end='')
+ print ("{} level {}: {}/{} {}\r".format(bounds[1], zoom, count, total, os.path.join(path, target)), end='')
filterLevel = "levels/{}.level".format(zoom)
if os.path.exists(filterLevel):
call(["osmconvert", "-t={}/osmconvert_tmp-".format(args.cache), "--complete-ways", "--complex-ways", "--drop-version", "-b={},{},{},{}".format(tl[1],br[0],br[1],tl[0]), cutted, "-o={}".format(os.path.join(path, filterTarget))])
- call(["osmfilter", "--parameter-file={}".format(filterLevel), os.path.join(path, filterTarget), "-o={}".format(os.path.join(args.cache, target))])
+ call(["osmfilter", "--parameter-file={}".format(filterLevel), os.path.join(path, filterTarget), "-o={}".format(os.path.join(path, target))])
os.remove(os.path.join(path, filterTarget))
else:
- call(["osmconvert", "-t={}/osmconvert_tmp-".format(args.cache), "--complete-ways", "--complex-ways", "--drop-version", "-b={},{},{},{}".format(tl[1],br[0],br[1],tl[0]), cutted, "-o={}".format(os.path.join(args.cache, target))])
- call(["chmod", "644", os.path.join(args.cache, target)])
- with zipfile.ZipFile(os.path.join(path, zipTarget), 'w') as myzip:
- myzip.write(os.path.join(args.cache, target), "{}.osm".format(y-1))
- os.remove(os.path.join(args.cache, target))
+ call(["osmconvert", "-t={}/osmconvert_tmp-".format(args.cache), "--complete-ways", "--complex-ways", "--drop-version", "-b={},{},{},{}".format(tl[1],br[0],br[1],tl[0]), cutted, "-o={}".format(os.path.join(path, target))])
+ call(["chmod", "644", os.path.join(path, target)])
|
[-]
[+]
|
Changed |
marble-1.14.21_sfos_160416.tar.xz/tools/version/update-version-number.py
^
|
@@ -109,7 +109,7 @@
replaceInFile(libVersionFile, libVersionHexOld, libVersionHexNew)
appVersionOld = ' return "[0-5]\\.[0-9]+\\.[0-9]+ (.*)";'
-appVersionNew = ' return "{}";'.format(generateVersionString(major+1, minor-10, patch))
+appVersionNew = ' return "{}";'.format(generateVersionString(major+2, minor-25, patch))
replaceInFile(appVersionFile, appVersionOld, appVersionNew)
if args.commit:
|
[-]
[+]
|
Changed |
marble.yaml
^
|
@@ -1,6 +1,6 @@
Name: marble
Summary: Virtual Globe
-Version: 1.12.20_sfos_151125
+Version: 1.14.21_sfos_160416
Release: 1
Group: Applications/Engineering
License: LGPLv2+
|