Fixed bug when "No search results" text was incorrectly shown.
[situare] / src / ui / locationsearchpanel.cpp
index 25f5399..2afe5a9 100644 (file)
@@ -93,7 +93,7 @@ LocationSearchPanel::LocationSearchPanel(QWidget *parent)
     panelLayout->setContentsMargins(MARGIN_LEFT, PANEL_MARGIN_TOP,
                                     PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM);
     m_noSearchLabel = new QLabel();
-    m_noSearchLabel->setText("No Search Results");
+    m_noSearchLabel->setText("No search results");
     m_noSearchLabel->setAlignment(Qt::AlignCenter);
 
     QPalette m_noSearchPalette = palette();
@@ -105,7 +105,8 @@ LocationSearchPanel::LocationSearchPanel(QWidget *parent)
     panelLayout->addLayout(resultsListViewLayout);
 
     // --- CONTEXT BUTTONS ---
-    m_routeButton = new ImageButton(":res/images/routing.png", "", "", this);
+    m_routeButton = new ImageButton(":res/images/route_to_location.png",
+                                    ":res/images/route_to_location_s.png", "", this);
     connect(m_routeButton, SIGNAL(clicked()),
             this, SLOT(routeToSelectedLocation()));
 
@@ -115,9 +116,9 @@ LocationSearchPanel::LocationSearchPanel(QWidget *parent)
     connect(searchLocationButton, SIGNAL(clicked()),
             this, SIGNAL(requestSearchLocation()));
 
-    m_clearLocationListButton = new ImageButton(":/res/images/clear_btn.png",
-                                                ":/res/images/clear_btn_s.png",
-                                                ":/res/images/clear_btn_d.png", this);
+    m_clearLocationListButton = new ImageButton(":/res/images/back_btn.png",
+                                                ":/res/images/back_btn_s.png",
+                                                ":/res/images/back_btn_d.png", this);
     m_clearLocationListButton->setDisabled(true);
 
     connect(m_clearLocationListButton, SIGNAL(clicked()),
@@ -129,7 +130,6 @@ LocationSearchPanel::LocationSearchPanel(QWidget *parent)
 
     readSettings();
     showSearchHistoryListView();
-    showEmptyPanel(true);
 }
 
 LocationSearchPanel::~LocationSearchPanel()
@@ -199,16 +199,6 @@ void LocationSearchPanel::populateLocationListView(const QList<Location> &locati
         m_locationListView->addListItem(QString::number(i), item);
     }
 
-    const int FIRST_LOCATION_ITEM_INDEX = 0;
-    const int ONE_LOCATION_ITEM = 1;
-
-    if (locations.size() == ONE_LOCATION_ITEM) {
-        ListItem *item = m_locationListView->listItemAt(FIRST_LOCATION_ITEM_INDEX);
-
-        if (item)
-            m_locationListView->setSelectedItem(item);
-    }
-
     m_locationListView->scrollToTop();
 }
 
@@ -244,7 +234,7 @@ void LocationSearchPanel::routeToSelectedLocation()
 
 void LocationSearchPanel::showEmptyPanel(bool show)
 {
-    if (show){
+    if (show) {
         m_noSearchLabel->show();
         m_searchHistoryListView->hide();
     }