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