Skip to content

Commit

Permalink
Suggest module URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Emdek committed Dec 22, 2013
1 parent fa39683 commit 87dc4e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/SearchesManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ bool SearchesManager::writeSearch(QIODevice *device, SearchInformation *search)
{
writer.writeStartElement("Url");
writer.writeAttribute("rel", "suggestions");
writer.writeAttribute("type", "text/html");
writer.writeAttribute("type", "application/x-suggestions+json");
writer.writeAttribute("method", search->suggestionsUrl.method.toUpper());
writer.writeAttribute("enctype", search->suggestionsUrl.enctype.toLower());
writer.writeAttribute("template", search->suggestionsUrl.url);
Expand Down
10 changes: 10 additions & 0 deletions src/ui/AddressWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ void AddressWidget::optionChanged(const QString &option, const QVariant &value)
model->appendRow(new QStandardItem(bookmarks.at(i)));
}

QStringList moduleUrls;
moduleUrls << "about:bookmarks" << "about:config" << "about:cookies" << "about:transfers";

for (int i = 0; i < moduleUrls.count(); ++i)
{
model->appendRow(new QStandardItem(moduleUrls.at(i)));
}

m_completer->setModel(model);
}
else if (!value.toBool() && m_completer->model() && m_completer->model()->rowCount() > 0)
Expand Down Expand Up @@ -176,6 +184,8 @@ void AddressWidget::updateCompletion()
{
if (SettingsManager::getValue("AddressField/SuggestBookmarks").toBool())
{
m_completer->model()->removeRows(0, m_completer->model()->rowCount());

optionChanged("AddressField/SuggestBookmarks", true);
}
}
Expand Down

0 comments on commit 87dc4e3

Please sign in to comment.