[Digikam-users] extragear/graphics/digikam/utilities/gpssearch

Gilles Caulier caulier.gilles at gmail.com
Wed Jun 4 20:51:03 BST 2008


SVN commit 816774 by cgilles:

digiKam from trunk (KDE4) : I'm happy to said than a new powerfull Search tool is available in digiKam : Searches over a map !

This tool use Marble widget from trunk with a patch from me to perform a rectangle selection on the canvas. Thepatch is available at this url:

http://digikam3rdparty.free.fr/misc.tarballs/marbleselection.patch

When you make a selection, digiKam query the database to find all pictures which have been taken into this area.

There is a screenshot of this tool in action at this url:

http://digikam3rdparty.free.fr/Screenshots/NewSearchTools/mapsearchtool.png

Several improvments need to be done in marble to have a more suitable selection tool, but at least it work fine as well.

CCMAIL: marcel.wiesweg at gmx.de
CCMAIL: digikam-users at kde.org
CCMAIL: tackat at kde.org

BUGS: 153070




 M  +6 -8      gpssearchview.cpp  
 M  +6 -6      gpssearchwidget.cpp  
 M  +3 -3      gpssearchwidget.h  


--- trunk/extragear/graphics/digikam/utilities/gpssearch/gpssearchview.cpp #816773:816774
@@ -257,12 +257,12 @@
 
     // We query database here
 
-    QRectF coordinateRectangle = d->gpsSearchWidget->selectionCoordinates();
-    QList<double> coordinates;
-    // coordinates as lon1, lat1,lon2, lat2  or West, North, East, South
-    coordinates << coordinateRectangle.left() << coordinateRectangle.top()
-                << coordinateRectangle.right() << coordinateRectangle.bottom();
+    // NOTE: coordinates as lon1, lat1, lon2, lat2 (or West, North, East, South)
+    // as left/top, right/bottom rectangle.
+    QList<double> coordinates = d->gpsSearchWidget->selectionCoordinates();
 
+    DDebug() << "Coordinates area to use: " << coordinates << endl;
+
     SearchXmlWriter writer;
     writer.writeGroup();
     writer.writeField("position", SearchXml::Inside);
@@ -271,10 +271,8 @@
     writer.finishField();
     writer.finishGroup();
 
-    /* FIXME
-    SAlbum* salbum = AlbumManager::instance()->createSAlbum(name, DatabaseSearch::HaarSearch, writer.xml());
+    SAlbum* salbum = AlbumManager::instance()->createSAlbum(name, DatabaseSearch::MapSearch, writer.xml());
     AlbumManager::instance()->setCurrentAlbum(salbum);
-    */
 }
 
 void GPSSearchView::slotAlbumSelected(SAlbum* salbum)
--- trunk/extragear/graphics/digikam/utilities/gpssearch/gpssearchwidget.cpp #816773:816774
@@ -40,7 +40,7 @@
 
     GPSSearchWidgetPriv(){}
 
-    QRectF selection;
+    QList<double> selection;
 };
 
 GPSSearchWidget::GPSSearchWidget(QWidget *parent)
@@ -52,8 +52,8 @@
     setMapThemeId("earth/srtm/srtm.dgml");
 #endif // MARBLE_VERSION
 
-    connect(this, SIGNAL(newSelection(const QRectF&)),
-            this, SLOT(slotNewSelection(const QRectF&)));
+    connect(this, SIGNAL(newSelection(const QList<double>&)),
+            this, SLOT(slotNewSelection(const QList<double>&)));
 }
 
 GPSSearchWidget::~GPSSearchWidget()
@@ -63,15 +63,15 @@
 
 bool GPSSearchWidget::asSelection() const
 {
-    return d->selection.isValid();
+    return !d->selection.isEmpty();
 }
 
-QRectF GPSSearchWidget::selectionCoordinates() const
+QList<double> GPSSearchWidget::selectionCoordinates() const
 {
     return d->selection;
 }
 
-void GPSSearchWidget::slotNewSelection(const QRectF& sel)
+void GPSSearchWidget::slotNewSelection(const QList<double>& sel)
 {
     d->selection = sel;
     emit signalNewSelection();
--- trunk/extragear/graphics/digikam/utilities/gpssearch/gpssearchwidget.h #816773:816774
@@ -27,7 +27,7 @@
 // Qt includes.
 
 #include <QLabel>
-#include <QRect>
+#include <QList>
 
 // Local includes.
 
@@ -55,7 +55,7 @@
 
     bool asSelection() const;
 
-    QRectF selectionCoordinates() const;
+    QList<double> selectionCoordinates() const;
 
 signals:
 
@@ -63,7 +63,7 @@
 
 private slots:
 
-    void slotNewSelection(const QRectF&);
+    void slotNewSelection(const QList<double>&);
 
 private:
 



More information about the Digikam-users mailing list