[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bkwebkitpart=5D_src=3A_Do_not_crash_when_displaying_?=
From: Dawit Alemayehu <adawit () kde ! org>
Date: 2011-02-04 6:43:16
Message-ID: 20110204064316.1FEEFA609B () git ! kde ! org
[Download RAW message or body]
Git commit fbea1eed4f10f2b75f974c9a8a0639e4377a8aea by Dawit Alemayehu.
Committed on 04/02/11 at 07:40.
Pushed by adawit into branch 'master'.
Do not crash when displaying the file dialog for multiple selection.
M +15 -13 src/webpage.cpp
http://commits.kde.org/kwebkitpart/fbea1eed4f10f2b75f974c9a8a0639e4377a8aea
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 552bd87..87db3be 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -245,24 +245,26 @@ bool WebPage::extension(Extension extension, const \
ExtensionOption *option, Exte {
switch (extension) {
case QWebPage::ErrorPageExtension: {
- if (!m_ignoreError) {
- const QWebPage::ErrorPageExtensionOption *extOption = static_cast<const \
QWebPage::ErrorPageExtensionOption*>(option);
- //kDebug() << extOption->domain << extOption->error << \
extOption->errorString;
- if (extOption->domain == QWebPage::QtNetwork) {
- QWebPage::ErrorPageExtensionReturn *extOutput = \
static_cast<QWebPage::ErrorPageExtensionReturn*>(output);
- extOutput->content = errorPage(m_kioErrorCode, \
extOption->errorString, extOption->url).toUtf8();
- extOutput->baseUrl = extOption->url;
- return true;
- }
- }
- break;
+ if (m_ignoreError)
+ break;
+ const QWebPage::ErrorPageExtensionOption *extOption = static_cast<const \
QWebPage::ErrorPageExtensionOption*>(option); + if (extOption->domain != \
QWebPage::QtNetwork) + break;
+ QWebPage::ErrorPageExtensionReturn *extOutput = \
static_cast<QWebPage::ErrorPageExtensionReturn*>(output); + extOutput->content \
= errorPage(m_kioErrorCode, extOption->errorString, extOption->url).toUtf8(); + \
extOutput->baseUrl = extOption->url; + return true;
}
case QWebPage::ChooseMultipleFilesExtension: {
const QWebPage::ChooseMultipleFilesExtensionOption* extOption = \
static_cast<const QWebPage::ChooseMultipleFilesExtensionOption*> \
(option);
QWebPage::ChooseMultipleFilesExtensionReturn *extOutput = \
static_cast<QWebPage::ChooseMultipleFilesExtensionReturn*>(output); if \
(currentFrame() == extOption->parentFrame) {
- extOutput->fileNames = \
KFileDialog::getOpenFileNames(KUrl(extOption->suggestedFileNames.first()),
- QString(), view(), \
i18n("Choose files to upload")); + if \
(extOption->suggestedFileNames.isEmpty()) + extOutput->fileNames = \
KFileDialog::getOpenFileNames(KUrl(), QString(), view(), + \
i18n("Choose files to upload")); + else
+ extOutput->fileNames = \
KFileDialog::getOpenFileNames(KUrl(extOption->suggestedFileNames.first()), + \
QString(), view(), i18n("Choose files to upload")); return true;
}
break;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic