1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:47:35 +00:00

Ladybird/Qt: Make String allocation infallible

This commit is contained in:
Timothy Flynn 2023-12-04 10:08:16 -05:00 committed by Andrew Kaster
parent 82c827fc56
commit a21998003c
10 changed files with 27 additions and 32 deletions

View file

@ -48,6 +48,7 @@ public:
private:
AK::Vector<String> m_suggestions;
};
class AutoComplete final : public QCompleter {
Q_OBJECT
@ -59,14 +60,15 @@ public:
return index.data(Qt::DisplayRole).toString();
}
ErrorOr<void> get_search_suggestions(StringView);
void get_search_suggestions(String);
void clear_suggestions();
static ErrorOr<String> auto_complete_url_from_query(StringView query);
signals:
void activated(QModelIndex const&);
private:
static String auto_complete_url_from_query(StringView query);
ErrorOr<void> got_network_response(QNetworkReply* reply);
ErrorOr<void> parse_google_autocomplete(Vector<JsonValue> const&);