mirror of
https://github.com/martinrotter/rssguard.git
synced 2024-12-31 18:37:30 +01:00
Fixed some problem with Google suggest.
This commit is contained in:
parent
b5f0d3ffdd
commit
a90e4880d0
@ -23,6 +23,7 @@ Fixed:
|
||||
|
||||
Changed:
|
||||
|
||||
▪ Adjusted behavior of Google suggestions when no suggestions are available for give text.
|
||||
▪ Adjusted soěrting, particularly in message list.
|
||||
▪ Tweaked "remove duplicates" policy.
|
||||
▪ TT-RSS plugin can now restore messages from local recycle bin.
|
||||
|
@ -60,7 +60,7 @@
|
||||
|
||||
|
||||
GoogleSuggest::GoogleSuggest(LocationLineEdit *editor, QObject *parent)
|
||||
: QObject(parent), editor(editor), popup(new QListWidget()) {
|
||||
: QObject(parent), editor(editor), popup(new QListWidget()), m_enteredText(QString()) {
|
||||
popup->setWindowFlags(Qt::Popup);
|
||||
popup->setFocusPolicy(Qt::NoFocus);
|
||||
popup->setFocusProxy(editor);
|
||||
@ -167,8 +167,8 @@ void GoogleSuggest::preventSuggest() {
|
||||
}
|
||||
|
||||
void GoogleSuggest::autoSuggest() {
|
||||
QString str = QUrl::toPercentEncoding(editor->text());
|
||||
QString url = QString(GOOGLE_SUGGEST_URL).arg(str);
|
||||
m_enteredText = QUrl::toPercentEncoding(editor->text());
|
||||
QString url = QString(GOOGLE_SUGGEST_URL).arg(m_enteredText);
|
||||
|
||||
connect(SilentNetworkAccessManager::instance()->get(QNetworkRequest(QString(url))), SIGNAL(finished()),
|
||||
this, SLOT(handleNetworkData()));
|
||||
@ -195,6 +195,10 @@ void GoogleSuggest::handleNetworkData() {
|
||||
}
|
||||
}
|
||||
|
||||
if (choices.isEmpty()) {
|
||||
choices.append(m_enteredText);
|
||||
}
|
||||
|
||||
showCompletion(choices);
|
||||
}
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ class GoogleSuggest : public QObject {
|
||||
LocationLineEdit *editor;
|
||||
QScopedPointer<QListWidget> popup;
|
||||
QTimer *timer;
|
||||
QString m_enteredText;
|
||||
};
|
||||
|
||||
#endif // GOOGLESUGGEST_H
|
||||
|
Loading…
Reference in New Issue
Block a user