StreamingSearchView: Use const_iterator
This commit is contained in:
parent
255623bbfd
commit
f642513587
@ -363,8 +363,8 @@ bool StreamingSearchView::ResultsContextMenuEvent(QContextMenuEvent *e) {
|
|||||||
|
|
||||||
void StreamingSearchView::timerEvent(QTimerEvent *e) {
|
void StreamingSearchView::timerEvent(QTimerEvent *e) {
|
||||||
|
|
||||||
QMap<int, DelayedSearch>::iterator it = delayed_searches_.find(e->timerId());
|
QMap<int, DelayedSearch>::const_iterator it = delayed_searches_.constFind(e->timerId());
|
||||||
if (it != delayed_searches_.end()) {
|
if (it != delayed_searches_.constEnd()) {
|
||||||
SearchAsync(it.value().id_, it.value().query_, it.value().type_);
|
SearchAsync(it.value().id_, it.value().query_, it.value().type_);
|
||||||
delayed_searches_.erase(it);
|
delayed_searches_.erase(it);
|
||||||
return;
|
return;
|
||||||
@ -518,7 +518,7 @@ void StreamingSearchView::SearchDone(const int service_id, const SongMap &songs,
|
|||||||
|
|
||||||
void StreamingSearchView::CancelSearch(const int id) {
|
void StreamingSearchView::CancelSearch(const int id) {
|
||||||
|
|
||||||
for (QMap<int, DelayedSearch>::iterator it = delayed_searches_.begin(); it != delayed_searches_.end(); ++it) {
|
for (QMap<int, DelayedSearch>::const_iterator it = delayed_searches_.constBegin(); it != delayed_searches_.constEnd(); ++it) {
|
||||||
if (it.value().id_ == id) {
|
if (it.value().id_ == id) {
|
||||||
killTimer(it.key());
|
killTimer(it.key());
|
||||||
delayed_searches_.erase(it);
|
delayed_searches_.erase(it);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user