mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	mapwidget: add the method centerOnIndex()
Again for the port from Marble, later can be removed / renamed. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
		
							parent
							
								
									0d3d9c01eb
								
							
						
					
					
						commit
						4334d33413
					
				
					 2 changed files with 11 additions and 0 deletions
				
			
		|  | @ -1,6 +1,7 @@ | |||
| #include <QQmlContext> | ||||
| #include <QDebug> | ||||
| #include <QQuickItem> | ||||
| #include <QModelIndex> | ||||
| 
 | ||||
| #include "mapwidget.h" | ||||
| #include "core/dive.h" | ||||
|  | @ -27,6 +28,15 @@ void MapWidget::centerOnDiveSite(struct dive_site *ds) | |||
| 	qDebug() << longitude << latitude; | ||||
| } | ||||
| 
 | ||||
| void MapWidget::centerOnIndex(const QModelIndex& idx) | ||||
| { | ||||
| 	struct dive_site *ds = get_dive_site_by_uuid(idx.model()->index(idx.row(), 0).data().toInt()); | ||||
| 	if (!ds || !dive_site_has_gps_location(ds)) | ||||
| 		centerOnDiveSite(&displayed_dive_site); | ||||
| 	else | ||||
| 		centerOnDiveSite(ds); | ||||
| } | ||||
| 
 | ||||
| void MapWidget::reload() | ||||
| { | ||||
| 	// TODO;
 | ||||
|  |  | |||
|  | @ -22,6 +22,7 @@ public: | |||
| 
 | ||||
| public slots: | ||||
| 	void centerOnDiveSite(struct dive_site *); | ||||
| 	void centerOnIndex(const QModelIndex& idx); | ||||
| 	void endGetDiveCoordinates(); | ||||
| 
 | ||||
| private: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue