summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-01-07 18:53:20 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-01-07 18:53:20 +0100
commit39413862a2d2355d3765d986073b29c1c2a1b7d7 (patch)
tree5be5777239fc6031b0fbc4f92ff668c31ca68f08 /src/mainwindow.cpp
parentThis GCI task adds a combobox with different settings to choice when hovering... (diff)
downloadrekonq-39413862a2d2355d3765d986073b29c1c2a1b7d7.tar.xz
Put ioslaves on hold.
This patch couples those merged in KIO & KDEWebKit in SC 4.6. I have to say it is probably NOT perfect and ready to merge, but I'd like to because it is anyway a nice step over actual behavior. It basically holds and (re)publish slave for apps needing it, letting us fixing a long standing bug against the infamous TWO connections to do ONE thing (download, move, etc...) It also gave me the possibility to and/or improve these things: - better handling filenames, studying content disposition header for "attachment" and "inline" values - better history handling, when working with kparts (also if this part needs a proper fix, IMHO reimplementing QWebHistory class...) - a (proper?) fix for POST operations returning content. I admit I am dubious with this part and I need more testing. The nice thing is that this patch "circumscribes" this problem, letting it easy eventually fix it again I also copied from kdewebkit a check for exec text files mimetypes (converted to text/plain) and cleaned-up some kDebugs (and as usual, added a lot..) Last, sorry for the big commit message and the big/not so big patch here. It is a special case. commit 29f3021d94e26b39f3e8172a980a6cafcebe5095 Author: Andrea Diamantini <adjam7@gmail.com> Date: Wed Jan 5 12:17:45 2011 +0100 cleanup comments commit fc88a37322810fd25c5bfcd16880fc617e7de9f5 Author: Andrea Diamantini <adjam7@gmail.com> Date: Wed Jan 5 12:06:55 2011 +0100 content-disposition: inline commit 7c2789a1733e1089b9c66cd6c553185792ec3a72 Author: Andrea Diamantini <adjam7@gmail.com> Date: Tue Jan 4 12:04:03 2011 +0100 Fix history handling. For a proper fix here, I think we need to reimplement the tab history, otherwise we cannot manage tab history browsing on the so called "rekonq" pages... commit 892c4d8dc78fda43f67566a3e359bd9805ee3282 Author: Andrea Diamantini <adjam7@gmail.com> Date: Tue Jan 4 11:57:29 2011 +0100 Two cases here: 1) POST operations returning content 2) right file names commit 3b1d5873b7eb743406f3b8c5abb79ce6728d0103 Author: Andrea Diamantini <adjam7@gmail.com> Date: Tue Jan 4 03:24:21 2011 +0100 Stupid kDebugs... commit 73d038a757185816f40795d4dd4a68e11659c971 Author: Andrea Diamantini <adjam7@gmail.com> Date: Tue Jan 4 02:32:45 2011 +0100 It needs testing from people (just) having last KDE SC 4.6 code on...
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 11c00c28..599295f7 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -619,26 +619,28 @@ void MainWindow::openLocation()
void MainWindow::fileSaveAs()
{
- KUrl srcUrl;
WebTab *w = currentTab();
- if (w->page()->isOnRekonqPage())
- {
- QWebElement el = w->page()->mainFrame()->documentElement();
- srcUrl = KUrl( el.findFirst("object").attribute("data") );
- }
- else
+ KUrl srcUrl = w->url();
+
+ // First, try with suggested file name...
+ QString name = w->page()->suggestedFileName();
+
+ // Second, with KUrl fileName...
+ if (name.isEmpty())
{
- srcUrl = w->url();
+ name = srcUrl.fileName();
}
- kDebug() << "URL to save: " << srcUrl;
-
- QString name = srcUrl.fileName();
- if (name.isNull())
+
+ // Last chance...
+ if(name.isEmpty())
{
name = srcUrl.host() + QString(".html");
}
+
const QString destUrl = KFileDialog::getSaveFileName(name, QString(), this);
- if (destUrl.isEmpty()) return;
+ if (destUrl.isEmpty())
+ return;
+
KIO::Job *job = KIO::file_copy(srcUrl, KUrl(destUrl), -1, KIO::Overwrite);
job->addMetaData("MaxCacheSize", "0"); // Don't store in http cache.
job->addMetaData("cache", "cache"); // Use entry from cache if available.
@@ -984,7 +986,6 @@ void MainWindow::openPrevious(Qt::MouseButtons mouseButtons, Qt::KeyboardModifie
if (currentTab()->page()->isOnRekonqPage())
{
item = new QWebHistoryItem(history->currentItem());
- currentTab()->view()->page()->setIsOnRekonqPage(false);
}
else
{
@@ -1018,7 +1019,6 @@ void MainWindow::openNext(Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers k
if (currentTab()->view()->page()->isOnRekonqPage())
{
item = new QWebHistoryItem(history->currentItem());
- currentTab()->view()->page()->setIsOnRekonqPage(false);
}
else
{