1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

LocationCompleter: Only update original text when first item is selected

Fixes issue where search/visit item would be incorrectly updated after
deleting item from completions.
This commit is contained in:
David Rosca 2018-01-03 20:45:54 +01:00
parent c97d077f67
commit 89aa7259f9

View File

@ -1,6 +1,6 @@
/* ============================================================
* Falkon - Qt web browser
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -378,8 +378,10 @@ void LocationCompleter::adjustPopupSize()
const int maxItemsCount = 12;
const int popupHeight = s_view->sizeHintForRow(0) * qMin(maxItemsCount, s_model->rowCount()) + 2 * s_view->frameWidth();
m_originalText = m_locationBar->text();
s_view->setOriginalText(m_originalText);
if (s_view->currentIndex().row() == 0) {
m_originalText = m_locationBar->text();
s_view->setOriginalText(m_originalText);
}
s_view->resize(s_view->width(), popupHeight);
s_view->show();