From 9a05e4f42f3989733457118a03d3bba93a0e2033 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 15 Nov 2010 00:25:08 +0100 Subject: Fix wrong default filenames due to a ":" in it websvn:1182549 for reference --- src/webpage.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/webpage.cpp') diff --git a/src/webpage.cpp b/src/webpage.cpp index 2347b6d8..f08aebd6 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -109,11 +109,12 @@ static bool downloadResource (const KUrl& srcUrl, const KIO::MetaData& metaData KUrl destUrl; int result = KIO::R_OVERWRITE; - const QUrl fileName ((suggestedName.isEmpty() ? srcUrl.fileName() : suggestedName)); + const QString fileName ((suggestedName.isEmpty() ? srcUrl.fileName() : suggestedName)); do { - destUrl = KFileDialog::getSaveFileName(fileName, QString(), parent); + // follow bug:184202 fixes + destUrl = KFileDialog::getSaveFileName(KUrl::fromPath(fileName), QString(), parent); if(destUrl.isEmpty()) return false; -- cgit v1.2.1 From fe21365ffafb922a6b24959f3d1096e4c6171427 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 19 Nov 2010 01:32:04 +0100 Subject: Print && Find actions for the parts :) - handle print & find with different signals in mainwindow - show right tab title (moving titleChanged signal from view to tab) --- src/webpage.cpp | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) (limited to 'src/webpage.cpp') diff --git a/src/webpage.cpp b/src/webpage.cpp index f08aebd6..67a33047 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -229,7 +229,13 @@ WebPage::~WebPage() bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type) { - _isOnRekonqPage = false; + if(_isOnRekonqPage) + { + WebView *view = qobject_cast(parent()); + WebTab *tab = qobject_cast(view->parent()); + _isOnRekonqPage = false; + tab->setPart(0, KUrl()); // re-enable the view page + } _loadingUrl = request.url(); KIO::AccessManager *manager = qobject_cast(networkAccessManager()); @@ -439,32 +445,15 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) } // case KParts::BrowserRun::Embed - KService::List partServices = KMimeTypeTrader::self()->query(mimeType, QL1S("KParts/ReadOnlyPart")); - if (partServices.count() > 0) + KParts::ReadOnlyPart *pa = KMimeTypeTrader::createPartInstanceFromQuery(mimeType, view(), this, QString()); + if (pa) { - QString p = replyUrl.pathOrUrl(); - - // A part can handle this. Embed it! - QString html; - html += ""; - html += ""; - html += ""; - html += p; - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; - - mainFrame()->setHtml(html); _isOnRekonqPage = true; - + WebView *view = qobject_cast(parent()); WebTab *tab = qobject_cast(view->parent()); + tab->setPart(pa,replyUrl); + UrlBar *bar = tab->urlBar(); bar->setQUrl(replyUrl); -- cgit v1.2.1