Clean-up, comments
authorSami Rämö <sami.ramo@ixonos.com>
Thu, 26 Aug 2010 11:21:15 +0000 (14:21 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Thu, 26 Aug 2010 11:21:15 +0000 (14:21 +0300)
src/ui/routingpanel.cpp
src/ui/routingpanel.h

index daed223..091506e 100644 (file)
@@ -4,10 +4,10 @@
 #include "locationlistview.h"
 #include "imagebutton.h"
 #include "panelcommon.h"
-#include "routing/location.h"
-#include "routing/route.h"
 #include "routewaypointlistitem.h"
 #include "routewaypointlistview.h"
+#include "routing/location.h"
+#include "routing/route.h"
 
 #include "routingpanel.h"
 
@@ -19,7 +19,6 @@ RoutingPanel::RoutingPanel(QWidget *parent)
     // --- ROUTING INSTRUCTIONS WIDGET ---
     m_routeWaypointListView = new RouteWaypointListView(this);
     m_routeWaypointListView->setItemDelegate(new ExtendedListItemDelegate(this));
-//    m_routeWaypointListView->hide();
 
     connect(m_routeWaypointListView, SIGNAL(routeWaypointItemClicked(GeoCoordinate)),
             this, SIGNAL(routeWaypointItemClicked(GeoCoordinate)));
@@ -40,7 +39,6 @@ RoutingPanel::RoutingPanel(QWidget *parent)
     QPalette labelPalette = resultsHeaderWidget->palette();
     labelPalette.setColor(QPalette::Background, Qt::black);
     resultsHeaderWidget->setPalette(labelPalette);
-//    m_resultsHeaderWidget->hide();
 
     QHBoxLayout *headerLayout = new QHBoxLayout();
     resultsHeaderWidget->setLayout(headerLayout);
@@ -53,7 +51,6 @@ RoutingPanel::RoutingPanel(QWidget *parent)
     // list view
     m_locationListView = new LocationListView(this);
     m_locationListView->setItemDelegate(new ExtendedListItemDelegate(this));
-//    m_locationListView->hide();
 
     connect(m_locationListView,
             SIGNAL(locationItemClicked(const GeoCoordinate&, const GeoCoordinate&)),
@@ -90,8 +87,8 @@ RoutingPanel::RoutingPanel(QWidget *parent)
     m_views->setContentsMargins(PANEL_MARGIN_LEFT, PANEL_MARGIN_TOP,
                                 PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM);
 
-    m_views->addWidget(m_resultsView);
     m_views->addWidget(m_routingView);
+    m_views->addWidget(m_resultsView);
 
     // --- CONTEXT BUTTONS ---
     m_searchLocationButton = new ImageButton(":/res/images/search.png",
@@ -134,11 +131,8 @@ void RoutingPanel::populateLocationListView(const QList<Location> &locations)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-//    m_resultsHeaderWidget->show();
     m_resultsLabel->setText(tr("Search results: %1").arg(locations.count()));
 
-//    m_routeWaypointListView->hide();
-//    m_locationListView->show();
     m_locationListView->clearList();
 
     for (int i = 0; i < locations.size(); ++i) {
@@ -162,6 +156,8 @@ void RoutingPanel::populateLocationListView(const QList<Location> &locations)
 
 void RoutingPanel::routeButtonToggled(bool checked)
 {
+    qDebug() << __PRETTY_FUNCTION__;
+
     if (checked) {
         routeToSelectedLocation();
         m_searchLocationButton->setChecked(false);
@@ -185,13 +181,13 @@ void RoutingPanel::routeToSelectedLocation()
 
 void RoutingPanel::searchLocationButtonToggled(bool checked)
 {
+    qDebug() << __PRETTY_FUNCTION__;
+
     if (checked) {
         showResultsView();
         emit requestSearchLocation();
     } else {
         showRoutingView();
-//        m_resultsHeaderWidget->hide();
-//        m_locationListView->hide();
     }
 }
 
@@ -199,10 +195,7 @@ void RoutingPanel::setRoute(Route &route)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-//    m_resultsHeaderWidget->hide();
-//    m_locationListView->hide();
-//    m_routeWaypointListView->show();
-//    m_routeWaypointListView->clearList();
+    m_routeWaypointListView->clearList();
 
     QList<RouteSegment> segments = route.segments();
     QList<GeoCoordinate> geometryPoints = route.geometryPoints();
@@ -254,5 +247,4 @@ void RoutingPanel::showRoutingView()
 
     m_views->setCurrentWidget(m_routingView);
     m_locationListView->clearItemSelection();
-
 }
index 2f486d2..45e8d18 100644 (file)
@@ -68,8 +68,14 @@ protected:
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
 private:
+    /**
+    * @brief Switch to search results view mode
+    */
     void showResultsView();
 
+    /**
+    * @brief Switch to routing instructions view mode
+    */
     void showRoutingView();
 
 private slots:
@@ -87,6 +93,9 @@ private slots:
     */
     void populateLocationListView(const QList<Location> &locations);
 
+    /**
+    * @brief Handler for route button toggling actions
+    */
     void routeButtonToggled(bool checked);
 
     /**
@@ -96,6 +105,9 @@ private slots:
     */
     void routeToSelectedLocation();
 
+    /**
+    * @brief Handler for search button toggling actions
+    */
     void searchLocationButtonToggled(bool checked);
 
     /**
@@ -160,17 +172,17 @@ signals:
  * DATA MEMBERS
  ******************************************************************************/
 private:
-    QLabel *m_resultsLabel;            ///< Location list label
+    QLabel *m_resultsLabel;                 ///< Location list label
 
-    QStackedLayout *m_views;
+    QStackedLayout *m_views;                ///< Views
 
-    QWidget *m_resultsView;
-    QWidget *m_routingView;
+    QWidget *m_resultsView;                 ///< Search results view widget
+    QWidget *m_routingView;                 ///< Routing instructions view widget
 
     ImageButton *m_routeButton;             ///< Route to location button
     ImageButton *m_searchLocationButton;    ///< Search location button
-    LocationListView *m_locationListView;   ///< Location list view
-    RouteWaypointListView *m_routeWaypointListView; ///< Route waypoint list view
+    LocationListView *m_locationListView;   ///< Search results list view
+    RouteWaypointListView *m_routeWaypointListView;     ///< Route instructions list view
 };
 
 #endif // ROUTINGPANEL_H