1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Little improvements in guessing download file info + in websearchbar.

- guessing file type and icon should now be more accurate
- when changing search engine in web searchbar and text in it
  is not empty, it will automatically load search results.
This commit is contained in:
nowrep 2012-02-11 11:38:02 +01:00
parent e70f6ef896
commit 99609d109d
2 changed files with 6 additions and 1 deletions

View File

@ -56,9 +56,10 @@ void DownloadFileHelper::handleUnsupportedContent(QNetworkReply* reply, bool ask
m_h_fileName = getFileName(reply);
m_reply = reply;
QFileInfo info(reply->url().toString());
QFileInfo info(m_h_fileName);
QTemporaryFile tempFile("XXXXXX." + info.suffix());
tempFile.open();
tempFile.write(m_reply->peek(1024 * 1024));
QFileInfo tempInfo(tempFile.fileName());
m_fileIcon = m_iconProvider->icon(tempInfo).pixmap(30, 30);
QString mimeType = m_iconProvider->type(tempInfo);

View File

@ -139,6 +139,10 @@ void WebSearchBar::searchChanged(const ButtonWithMenu::Item &item)
m_openSearchEngine->setSuggestionsParameters(m_activeEngine.suggestionsParameters);
m_searchManager->setActiveEngine(m_activeEngine);
if (!text().isEmpty()) {
search();
}
}
void WebSearchBar::search()