Fix search placeholder text when navigating back in list style devices.

This commit is contained in:
craig
2012-02-09 19:15:59 +00:00
parent d94292df6a
commit f4000ecce8
3 changed files with 8 additions and 6 deletions

View File

@@ -29,6 +29,7 @@
22. When pressing play after pressing stop, start playing at current song -
don't start at begining of play queue.
23. Better repeat and consume icons.
24. Fix search placeholder text when navigating back in list style devices.
0.3.0
-----

View File

@@ -510,17 +510,17 @@ void ItemView::setLevel(int l, bool haveChildren)
if (0==currentLevel) {
listSearch->setPlaceholderText(i18n("Search %1...", topText));
} else if (prev>currentLevel) {
listSearch->setPlaceholderText(prevText);
listSearch->setPlaceholderText(prevText[currentLevel]);
} else {
prevText=listSearch->placeholderText();
prevText.insert(prev, listSearch->placeholderText());
}
#else
if (0==currentLevel) {
listSearch->setPlaceholderText(tr("Search %1...").arg(topText));
} else if (prev>currentLevel) {
listSearch->setPlaceholderText(prevText);
listSearch->setPlaceholderText(prevText[currentLevel]);
} else {
prevText=listSearch->placeholderText();
prevText.insert(prev, listSearch->placeholderText());
}
#endif
}

View File

@@ -25,13 +25,14 @@
#define ITEMVIEW_H
#include "ui_itemview.h"
class QAction;
#include <QtCore/QMap>
#ifdef ENABLE_KDE_SUPPORT
class KPixmapSequenceOverlayPainter;
#endif
class ProxyModel;
class QAction;
class QTimer;
class ItemView : public QWidget, public Ui::ItemView
@@ -108,7 +109,7 @@ private:
int currentLevel;
Mode mode;
QString topText;
QString prevText;
QMap<int, QString> prevText;
QModelIndex prevTopIndex;
QSize iconGridSize;
QSize listGridSize;