USA.
*/
-#include <QPair>
#include <QSettings>
#include "avatarimage.h"
m_clearLocationListButton->setDisabled(true);
connect(m_clearLocationListButton, SIGNAL(clicked()),
- this, SLOT(showSearchHistoryList()));
+ this, SLOT(showSearchHistoryListView()));
m_contextButtonLayout->addWidget(m_routeButton);
m_contextButtonLayout->addWidget(searchLocationButton);
m_contextButtonLayout->addWidget(m_clearLocationListButton);
readSettings();
- showSearchHistoryList();
+ showSearchHistoryListView();
}
LocationSearchPanel::~LocationSearchPanel()
{
qDebug() << __PRETTY_FUNCTION__;
- m_searchHistoryListView->clearItemSelection();
- m_searchHistoryListView->hide();
- setHeaderText(locations.count());
m_locationListView->clearList();
- m_clearLocationListButton->setEnabled(true);
- m_locationListView->show();
+ showLocationListView(locations.count());
for (int i = 0; i < locations.size(); ++i) {
LocationListItem *item = new LocationListItem();
m_routeButton->setDisabled(m_locationListView->selectedItems().isEmpty());
}
-void LocationSearchPanel::showSearchHistoryList()
+void LocationSearchPanel::showLocationListView(int locationItemsCount)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_searchHistoryListView->clearItemSelection();
+ m_searchHistoryListView->hide();
+ setHeaderText(locationItemsCount);
+ m_clearLocationListButton->setEnabled(true);
+ m_locationListView->show();
+}
+
+void LocationSearchPanel::showSearchHistoryListView()
{
qDebug() << __PRETTY_FUNCTION__;
void clearListsSelections();
/**
- * @brief Shows search history list.
+ * @brief Shows location list view.
+ *
+ * @param locationItemsCount location items count
+ */
+ void showLocationListView(int locationItemsCount);
+
+ /**
+ * @brief Shows search history list view.
*/
- void showSearchHistoryList();
+ void showSearchHistoryListView();
/**
* @brief Populates location list view.
qDebug() << __PRETTY_FUNCTION__;
setDateTime(dateTime);
-
- setTitle(shortenText(searchString, ITEM_WIDTH - 3 * MARGIN,
- ListItem::TEXT_SIZE_NORMAL));
-
+ setTitle(shortenText(searchString, ITEM_WIDTH - 3 * MARGIN, ListItem::TEXT_SIZE_NORMAL));
setImage(AvatarImage::create(QPixmap(":/res/images/search_history.png"), AvatarImage::Small));
clearSubItems();