[kwebkitpart] 1.3.0-1

Rex Dieter rdieter at fedoraproject.org
Thu Oct 4 14:26:52 UTC 2012


commit f14d7be46f817dd282f0452bce8a282b1d6c1e1a
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Thu Oct 4 09:27:09 2012 -0500

    1.3.0-1
    
    - generate tarball from v1.3.0 tag
    - include a few post v1.3.0 patches
    - default web browsing KPart unexpectedly changed to WebKitPart (#862601)
    - BR: pkgconfig(QtWebKit)
    - .spec cosmetics

 .gitignore                                         |    3 +-
 0001-Removed-unnecessary-debug-statements.patch    |   40 ++
 ...h-when-QWebHitTestResult-frame-returns-NU.patch |   28 ++
 ...pplet-tag-to-the-ondemand-plugin-loader-l.patch |   31 ++
 0004-Fix-search-shortcuts.patch                    |   43 +++
 ...Removed-no-longer-necessary-namespace-use.patch |  393 ++++++++++++++++++++
 ...me-or-document-source-open-the-actual-fil.patch |   82 ++++
 kwebkitpart.spec                                   |   82 +++--
 sources                                            |    2 +-
 9 files changed, 672 insertions(+), 32 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 9a3dfa9..503756b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1 @@
-/kwebkitpart-1.2-20111030.tar.bz2
-/kwebkitpart-1.3-20120726.tar.xz
+/kwebkitpart-1.3.0.tar.xz
diff --git a/0001-Removed-unnecessary-debug-statements.patch b/0001-Removed-unnecessary-debug-statements.patch
new file mode 100644
index 0000000..cd856ff
--- /dev/null
+++ b/0001-Removed-unnecessary-debug-statements.patch
@@ -0,0 +1,40 @@
+From 12ca7d4feb3f9501b34088d9dd823cb4d93f0eab Mon Sep 17 00:00:00 2001
+From: Dawit Alemayehu <adawit at kde.org>
+Date: Thu, 6 Sep 2012 14:58:14 -0400
+Subject: [PATCH 1/7] Removed unnecessary debug statements
+
+---
+ src/kwebkitpart.cpp | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/kwebkitpart.cpp b/src/kwebkitpart.cpp
+index a288218..1d4cbcb 100644
+--- a/src/kwebkitpart.cpp
++++ b/src/kwebkitpart.cpp
+@@ -433,7 +433,6 @@ bool KWebKitPart::openFile()
+ 
+ void KWebKitPart::slotLoadStarted()
+ {
+-    kDebug() << "main frame:" << page()->mainFrame() << "current frame:" << page()->currentFrame();
+     emit started(0);
+     updateActions();
+ }
+@@ -441,7 +440,6 @@ void KWebKitPart::slotLoadStarted()
+ void KWebKitPart::slotFrameLoadFinished(bool ok)
+ {
+     QWebFrame* frame = (sender() ? qobject_cast<QWebFrame*>(sender()) : page()->mainFrame());
+-    kDebug() << "finished ok?" << ok << "FRAME:" << frame << "SENDER:" << sender();
+ 
+     if (ok) {
+         const QUrl currentUrl (frame->baseUrl().resolved(frame->url()));
+@@ -455,7 +453,6 @@ void KWebKitPart::slotFrameLoadFinished(bool ok)
+             } else {
+                 // Attempt to fill the web form...
+                 KWebWallet *webWallet = page() ? page()->wallet() : 0;
+-                kDebug() << "FOUND WALLET:" << webWallet;
+                 if (webWallet) {
+                     webWallet->fillFormData(frame, false);
+                 }
+-- 
+1.7.12.1
+
diff --git a/0002-Do-not-crash-when-QWebHitTestResult-frame-returns-NU.patch b/0002-Do-not-crash-when-QWebHitTestResult-frame-returns-NU.patch
new file mode 100644
index 0000000..1b04aa1
--- /dev/null
+++ b/0002-Do-not-crash-when-QWebHitTestResult-frame-returns-NU.patch
@@ -0,0 +1,28 @@
+From 894334963a729b92a968e65b91f79e5556f65037 Mon Sep 17 00:00:00 2001
+From: Dawit Alemayehu <adawit at kde.org>
+Date: Thu, 6 Sep 2012 15:00:06 -0400
+Subject: [PATCH 2/7] Do not crash when QWebHitTestResult::frame() returns
+ NULL.
+
+BUG: 306102
+FIXED-IN: 1.3
+---
+ src/webview.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/webview.cpp b/src/webview.cpp
+index e0d2407..b6ba0e8 100644
+--- a/src/webview.cpp
++++ b/src/webview.cpp
+@@ -547,7 +547,7 @@ void WebView::partActionPopupMenu(KParts::BrowserExtension::ActionGroupMap& part
+                 partActions.append(action);
+             }
+         }
+-    } else if (m_result.frame()->parentFrame() && !m_result.isContentSelected() && m_result.linkUrl().isEmpty()) {
++    } else if (m_result.frame() && m_result.frame()->parentFrame() && !m_result.isContentSelected() && m_result.linkUrl().isEmpty()) {
+         KActionMenu * menu = new KActionMenu(i18nc("@title:menu HTML frame/iframe", "Frame"), this);
+ 
+         KAction* action = new KAction(KIcon("window-new"), i18n("Open in New &Window"), this);
+-- 
+1.7.12.1
+
diff --git a/0003-Added-the-applet-tag-to-the-ondemand-plugin-loader-l.patch b/0003-Added-the-applet-tag-to-the-ondemand-plugin-loader-l.patch
new file mode 100644
index 0000000..a24f440
--- /dev/null
+++ b/0003-Added-the-applet-tag-to-the-ondemand-plugin-loader-l.patch
@@ -0,0 +1,31 @@
+From 2b7fab9d0141973ee2b6772560bd25f9f1b9db5f Mon Sep 17 00:00:00 2001
+From: Dawit Alemayehu <adawit at kde.org>
+Date: Sat, 22 Sep 2012 11:58:43 -0400
+Subject: [PATCH 3/7] Added the <applet> tag to the ondemand plugin loader
+ list
+
+---
+ src/webpluginfactory.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/webpluginfactory.cpp b/src/webpluginfactory.cpp
+index c3791c1..56e2f2c 100644
+--- a/src/webpluginfactory.cpp
++++ b/src/webpluginfactory.cpp
+@@ -107,10 +107,12 @@ void FakePluginWidget::load (bool loadAll)
+     QList<QWebFrame*> frames;
+     frames.append(view->page()->mainFrame());
+ 
+-    QString selector = QLatin1String("object:not([type]),embed:not([type]),object[type=\"");
++    QString selector (QLatin1String("applet:not([type]),embed:not([type]),object:not([type]),applet[type=\""));
+     selector += m_mimeType;
+     selector += QLatin1String("\"],embed[type=\"");
+     selector += m_mimeType;
++    selector += QLatin1String("\"],object[type=\"");
++    selector += m_mimeType;
+     selector += QLatin1String("\"]");
+ 
+     while (!frames.isEmpty()) {
+-- 
+1.7.12.1
+
diff --git a/0004-Fix-search-shortcuts.patch b/0004-Fix-search-shortcuts.patch
new file mode 100644
index 0000000..99e8a2d
--- /dev/null
+++ b/0004-Fix-search-shortcuts.patch
@@ -0,0 +1,43 @@
+From a6ef9d566bbcb816469cb5e7f79d51cf44a02984 Mon Sep 17 00:00:00 2001
+From: Dawit Alemayehu <adawit at kde.org>
+Date: Wed, 26 Sep 2012 18:14:17 -0400
+Subject: [PATCH 4/7] Fix search shortcuts.
+
+BUG: 307394
+FIXED-IN: 1.3.1
+---
+ src/kwebkitpart.cpp | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/src/kwebkitpart.cpp b/src/kwebkitpart.cpp
+index 1d4cbcb..dd15bbe 100644
+--- a/src/kwebkitpart.cpp
++++ b/src/kwebkitpart.cpp
+@@ -246,11 +246,6 @@ void KWebKitPart::initActions()
+     action = actionCollection()->addAction(KStandardAction::Find, "find", this, SLOT(slotShowSearchBar()));
+     action->setWhatsThis(i18nc("find action \"whats this\" text", "<h3>Find text</h3>"
+                               "Shows a dialog that allows you to find text on the displayed page."));
+-
+-    action = actionCollection()->addAction(KStandardAction::FindNext, "findnext",
+-                                           m_searchBar, SLOT(findNext()));
+-    action = actionCollection()->addAction(KStandardAction::FindPrev, "findprev",
+-                                           m_searchBar, SLOT(findPrevious()));
+ }
+ 
+ void KWebKitPart::updateActions()
+@@ -757,6 +752,12 @@ void KWebKitPart::slotShowSearchBar()
+         m_searchBar = new KDEPrivate::SearchBar(widget());
+         connect(m_searchBar, SIGNAL(searchTextChanged(QString,bool)),
+                 this, SLOT(slotSearchForText(QString,bool)));
++
++        actionCollection()->addAction(KStandardAction::FindNext, "findnext",
++                                      m_searchBar, SLOT(findNext()));
++        actionCollection()->addAction(KStandardAction::FindPrev, "findprev",
++                                      m_searchBar, SLOT(findPrevious()));
++
+         QBoxLayout* lay = qobject_cast<QBoxLayout*>(widget()->layout());
+         if (lay) {
+           lay->addWidget(m_searchBar);
+-- 
+1.7.12.1
+
diff --git a/0005-Removed-no-longer-necessary-namespace-use.patch b/0005-Removed-no-longer-necessary-namespace-use.patch
new file mode 100644
index 0000000..aeb6994
--- /dev/null
+++ b/0005-Removed-no-longer-necessary-namespace-use.patch
@@ -0,0 +1,393 @@
+From 1ef0faa649799fcc03e2ee5e4e3d401208894f3b Mon Sep 17 00:00:00 2001
+From: Dawit Alemayehu <adawit at kde.org>
+Date: Thu, 27 Sep 2012 01:11:44 -0400
+Subject: [PATCH 5/7] - Removed no longer necessary namespace use. - Make sure
+ the curent focus widget is restored when closing the
+ searchbar. - Removed no longer necessary #include
+ statements.
+
+---
+ src/kwebkitpart.cpp    |   4 +-
+ src/kwebkitpart.h      |  11 ++---
+ src/ui/passwordbar.cpp |   3 --
+ src/ui/passwordbar.h   |   2 -
+ src/ui/searchbar.cpp   | 130 +++++++++++++++++++++++--------------------------
+ src/ui/searchbar.h     |  11 ++---
+ src/ui/searchbar.ui    |   2 +-
+ 7 files changed, 71 insertions(+), 92 deletions(-)
+
+diff --git a/src/kwebkitpart.cpp b/src/kwebkitpart.cpp
+index dd15bbe..282f179 100644
+--- a/src/kwebkitpart.cpp
++++ b/src/kwebkitpart.cpp
+@@ -749,7 +749,7 @@ void KWebKitPart::slotShowSearchBar()
+ {
+     if (!m_searchBar) {
+         // Create the search bar...
+-        m_searchBar = new KDEPrivate::SearchBar(widget());
++        m_searchBar = new SearchBar(widget());
+         connect(m_searchBar, SIGNAL(searchTextChanged(QString,bool)),
+                 this, SLOT(slotSearchForText(QString,bool)));
+ 
+@@ -887,7 +887,7 @@ void KWebKitPart::slotSaveFormDataRequested (const QString& key, const QUrl& url
+         return;
+ 
+     if (!m_passwordBar) {
+-        m_passwordBar = new KDEPrivate::PasswordBar(widget());
++        m_passwordBar = new PasswordBar(widget());
+         KWebWallet* wallet = page()->wallet();
+         if (!wallet) {
+             kWarning() << "No wallet instance found! This should never happen!";
+diff --git a/src/kwebkitpart.h b/src/kwebkitpart.h
+index 8231b24..ffcb1ab 100644
+--- a/src/kwebkitpart.h
++++ b/src/kwebkitpart.h
+@@ -29,16 +29,13 @@ namespace KParts {
+   class StatusBarExtension;
+ }
+ 
+-namespace KDEPrivate {
+-  class PasswordBar;
+-  class SearchBar;
+-}
+-
+ class QWebView;
+ class QWebFrame;
+ class QWebHistoryItem;
+ class WebView;
+ class WebPage;
++class SearchBar;
++class PasswordBar;
+ class KUrlLabel;
+ class WebKitBrowserExtension;
+ 
+@@ -151,8 +148,8 @@ private:
+     bool m_hasCachedFormData;
+     bool m_doLoadFinishedActions;
+     KUrlLabel* m_statusBarWalletLabel;
+-    KDEPrivate::SearchBar* m_searchBar;
+-    KDEPrivate::PasswordBar* m_passwordBar;
++    SearchBar* m_searchBar;
++    PasswordBar* m_passwordBar;
+     WebKitBrowserExtension* m_browserExtension;
+     KParts::StatusBarExtension* m_statusBarExtension;
+     WebView* m_webView;
+diff --git a/src/ui/passwordbar.cpp b/src/ui/passwordbar.cpp
+index f25f0a5..178379c 100644
+--- a/src/ui/passwordbar.cpp
++++ b/src/ui/passwordbar.cpp
+@@ -32,7 +32,6 @@
+ #include <QAction>
+ #include <QPalette>
+ 
+-namespace KDEPrivate {
+ 
+ PasswordBar::PasswordBar(QWidget *parent)
+             :KMessageWidget(parent)
+@@ -105,6 +104,4 @@ void PasswordBar::clear()
+     m_url.clear();
+ }
+ 
+-}
+-
+ #include "passwordbar.moc"
+diff --git a/src/ui/passwordbar.h b/src/ui/passwordbar.h
+index 48bbb09..0e64c53 100644
+--- a/src/ui/passwordbar.h
++++ b/src/ui/passwordbar.h
+@@ -26,7 +26,6 @@
+ 
+ #include <QUrl>
+ 
+-namespace KDEPrivate {
+ 
+ class PasswordBar : public KMessageWidget
+ {
+@@ -58,5 +57,4 @@ private:
+     QString m_requestKey;
+ };
+ 
+-}
+ #endif // PASSWORDBAR_H
+diff --git a/src/ui/searchbar.cpp b/src/ui/searchbar.cpp
+index 2f33982..4efed95 100644
+--- a/src/ui/searchbar.cpp
++++ b/src/ui/searchbar.cpp
+@@ -24,56 +24,46 @@
+  */
+ 
+ #include "searchbar.h"
+-#include "ui_searchbar.h"
+ 
+ #include <KDE/KLineEdit>
+ #include <KDE/KColorScheme>
+-#include <KDE/KDebug>
+ #include <KDE/KIcon>
+ #include <KDE/KLocalizedString>
+ 
+ #include <QResizeEvent>
+-#include <QShortcut>
+ 
+ 
+-namespace KDEPrivate {
+-
+-
+-class SearchBar::SearchBarPrivate
+-{
+-public:
+-    void init (SearchBar* searchBar)
+-    {
+-        ui.setupUi(searchBar);
+-        ui.optionsButton->addAction(ui.actionMatchCase);
+-        ui.optionsButton->addAction(ui.actionHighlightMatch);
+-        ui.optionsButton->addAction(ui.actionSearchAutomatically);
+-        ui.closeButton->setIcon(KIcon("dialog-close"));
+-        ui.previousButton->setIcon(KIcon("go-up-search"));
+-        ui.nextButton->setIcon(KIcon("go-down-search"));
+-        ui.previousButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+-        ui.nextButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+-        ui.searchInfo->setText(i18nc("label for input line to find text", "&Find:"));
+-
+-        connect(ui.nextButton, SIGNAL(clicked()),
+-                searchBar, SLOT(findNext()));
+-        connect(ui.previousButton, SIGNAL(clicked()),
+-                searchBar, SLOT(findPrevious()));
+-        connect(ui.searchComboBox, SIGNAL(returnPressed()),
+-                searchBar, SLOT(findNext()));
+-        connect(ui.searchComboBox, SIGNAL(editTextChanged(QString)),
+-                searchBar, SLOT(textChanged(QString)));
+-    }
+-
+-    Ui::SearchBar ui;
+-};
+-
+ SearchBar::SearchBar(QWidget *parent)
+-          :QWidget(parent), d (new SearchBarPrivate)
++    :QWidget(parent)
+ {
+ 
++    // Get the widget that currently has the focus so we can properly
++    // restore it when the filter bar is closed.
++    QWidget* widgetWindow = (parent ? parent->window() : 0);
++    m_focusWidget = (widgetWindow ? widgetWindow->focusWidget() : 0);
++
+     // Initialize the user interface...
+-    d->init(this);
++    m_ui.setupUi(this);
++    m_ui.optionsButton->addAction(m_ui.actionMatchCase);
++    m_ui.optionsButton->addAction(m_ui.actionHighlightMatch);
++    m_ui.optionsButton->addAction(m_ui.actionSearchAutomatically);
++    m_ui.closeButton->setIcon(KIcon("dialog-close"));
++    m_ui.previousButton->setIcon(KIcon("go-up-search"));
++    m_ui.nextButton->setIcon(KIcon("go-down-search"));
++    m_ui.previousButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
++    m_ui.nextButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
++    m_ui.searchInfo->setText(i18nc("label for input line to find text", "&Find:"));
++
++    setFocusProxy(m_ui.searchComboBox);
++    
++    connect(m_ui.nextButton, SIGNAL(clicked()),
++            this, SLOT(findNext()));
++    connect(m_ui.previousButton, SIGNAL(clicked()),
++            this, SLOT(findPrevious()));
++    connect(m_ui.searchComboBox, SIGNAL(returnPressed()),
++            this, SLOT(findNext()));
++    connect(m_ui.searchComboBox, SIGNAL(editTextChanged(QString)),
++            this, SLOT(textChanged(QString)));
+ 
+     // Start off hidden by default...
+     setVisible(false);
+@@ -83,22 +73,21 @@ SearchBar::~SearchBar()
+ {
+     // NOTE: For some reason, if we do not clear the focus from the line edit
+     // widget before we delete this object, it seems to cause a crash!!
+-    d->ui.searchComboBox->clearFocus();
+-    delete d;
++    m_ui.searchComboBox->clearFocus();
+ }
+ 
+ void SearchBar::clear()
+ {
+-    d->ui.searchComboBox->clear();
++    m_ui.searchComboBox->clear();
+ }
+ 
+ void SearchBar::setVisible (bool visible)
+ {
+     if (visible) {
+-        d->ui.searchComboBox->setFocus( Qt::ActiveWindowFocusReason );
+-        d->ui.searchComboBox->lineEdit()->selectAll();
++        m_ui.searchComboBox->setFocus(Qt::ActiveWindowFocusReason);
++        m_ui.searchComboBox->lineEdit()->selectAll();
+     } else {
+-        d->ui.searchComboBox->setPalette(QPalette());
++        m_ui.searchComboBox->setPalette(QPalette());
+         emit searchTextChanged(QString());
+     }
+ 
+@@ -107,37 +96,37 @@ void SearchBar::setVisible (bool visible)
+ 
+ QString SearchBar::searchText() const
+ {
+-    return d->ui.searchComboBox->currentText();
++    return m_ui.searchComboBox->currentText();
+ }
+ 
+ bool SearchBar::caseSensitive() const
+ {
+-    return d->ui.actionMatchCase->isChecked();
++    return m_ui.actionMatchCase->isChecked();
+ }
+ 
+ bool SearchBar::highlightMatches() const
+ {
+-    return d->ui.actionHighlightMatch->isChecked();
++    return m_ui.actionHighlightMatch->isChecked();
+ }
+ 
+ void SearchBar::setSearchText(const QString& text)
+ {
+     show();
+-    d->ui.searchComboBox->setEditText(text);
++    m_ui.searchComboBox->setEditText(text);
+ }
+ 
+ void SearchBar::setFoundMatch(bool match)
+ {
+     //kDebug() << match;
+-    if (d->ui.searchComboBox->currentText().isEmpty()) {
+-        d->ui.searchComboBox->setPalette(QPalette());
++    if (m_ui.searchComboBox->currentText().isEmpty()) {
++        m_ui.searchComboBox->setPalette(QPalette());
+         return;
+     }
+ 
+     KColorScheme::BackgroundRole role = (match ? KColorScheme::PositiveBackground : KColorScheme::NegativeBackground);
+-    QPalette newPal( d->ui.searchComboBox->palette() );
+-    KColorScheme::adjustBackground(newPal, role );
+-    d->ui.searchComboBox->setPalette(newPal);
++    QPalette newPal(m_ui.searchComboBox->palette());
++    KColorScheme::adjustBackground(newPal, role);
++    m_ui.searchComboBox->setPalette(newPal);
+ }
+ 
+ void SearchBar::findNext()
+@@ -145,9 +134,9 @@ void SearchBar::findNext()
+     if (!isVisible())
+         return;
+ 
+-    const QString text (d->ui.searchComboBox->currentText());
+-    if (d->ui.searchComboBox->findText(text) == -1) {
+-        d->ui.searchComboBox->addItem(text);
++    const QString text (m_ui.searchComboBox->currentText());
++    if (m_ui.searchComboBox->findText(text) == -1) {
++        m_ui.searchComboBox->addItem(text);
+     }
+ 
+     emit searchTextChanged(text);
+@@ -158,27 +147,27 @@ void SearchBar::findPrevious()
+     if (!isVisible())
+         return;
+ 
+-    const QString text (d->ui.searchComboBox->currentText());
+-    if (d->ui.searchComboBox->findText(text) == -1) {
+-        d->ui.searchComboBox->addItem(text);
++    const QString text (m_ui.searchComboBox->currentText());
++    if (m_ui.searchComboBox->findText(text) == -1) {
++        m_ui.searchComboBox->addItem(text);
+     }
+ 
+-    emit searchTextChanged(d->ui.searchComboBox->currentText(), true);
++    emit searchTextChanged(m_ui.searchComboBox->currentText(), true);
+ }
+ 
+ void SearchBar::textChanged(const QString &text)
+ {
+     if (text.isEmpty()) {
+-        d->ui.searchComboBox->setPalette(QPalette());
+-        d->ui.nextButton->setEnabled(false);
+-        d->ui.previousButton->setEnabled(false);
++        m_ui.searchComboBox->setPalette(QPalette());
++        m_ui.nextButton->setEnabled(false);
++        m_ui.previousButton->setEnabled(false);
+     } else {
+-        d->ui.nextButton->setEnabled(true);
+-        d->ui.previousButton->setEnabled(true);
++        m_ui.nextButton->setEnabled(true);
++        m_ui.previousButton->setEnabled(true);
+     }
+ 
+-    if (d->ui.actionSearchAutomatically->isChecked()) {
+-        emit searchTextChanged(d->ui.searchComboBox->currentText());
++    if (m_ui.actionSearchAutomatically->isChecked()) {
++        emit searchTextChanged(m_ui.searchComboBox->currentText());
+     }
+ }
+ 
+@@ -191,14 +180,15 @@ bool SearchBar::event(QEvent* e)
+         QKeyEvent* kev = static_cast<QKeyEvent*>(e);
+         if (kev->key() == Qt::Key_Escape) {
+             e->accept();
+-            clearFocus();
+-            setVisible(false);
++            close();
++            if (m_focusWidget) {
++                m_focusWidget->setFocus();
++                m_focusWidget = 0;
++            }
+             return true;
+         }
+     }
+     return QWidget::event(e);
+ }
+ 
+-}
+-
+ #include "searchbar.moc"
+diff --git a/src/ui/searchbar.h b/src/ui/searchbar.h
+index 62b0a72..c01acd2 100644
+--- a/src/ui/searchbar.h
++++ b/src/ui/searchbar.h
+@@ -27,10 +27,10 @@
+ 
+ #include <QWidget>
+ 
++#include "ui_searchbar.h"
++
+ class QEvent;
+ 
+-namespace KDEPrivate {
+- 
+ /**
+  * This is the widget that shows up when the search is initiated.
+  */
+@@ -61,11 +61,8 @@ Q_SIGNALS:
+     void searchTextChanged(const QString& text, bool backward = false);
+ 
+ private:
+-    class SearchBarPrivate;
+-    SearchBarPrivate * const d;
+-
++    Ui::SearchBar m_ui;
++    QPointer<QWidget> m_focusWidget;
+ };
+ 
+-}
+-
+ #endif // SEARCHBAR_P_H
+diff --git a/src/ui/searchbar.ui b/src/ui/searchbar.ui
+index e57c508..0ed50bd 100644
+--- a/src/ui/searchbar.ui
++++ b/src/ui/searchbar.ui
+@@ -152,7 +152,7 @@
+    <sender>closeButton</sender>
+    <signal>clicked()</signal>
+    <receiver>SearchBar</receiver>
+-   <slot>hide()</slot>
++   <slot>close()</slot>
+    <hints>
+     <hint type="sourcelabel">
+      <x>16</x>
+-- 
+1.7.12.1
+
diff --git a/0006-On-view-frame-or-document-source-open-the-actual-fil.patch b/0006-On-view-frame-or-document-source-open-the-actual-fil.patch
new file mode 100644
index 0000000..02f4d97
--- /dev/null
+++ b/0006-On-view-frame-or-document-source-open-the-actual-fil.patch
@@ -0,0 +1,82 @@
+From 89ff3fcfaac967f26e54fd1a193ac3652c5a4113 Mon Sep 17 00:00:00 2001
+From: Dawit Alemayehu <adawit at kde.org>
+Date: Fri, 28 Sep 2012 01:09:39 -0400
+Subject: [PATCH 6/7] On view frame or document source, open the actual file
+ when it is local page
+
+---
+ src/kwebkitpart_ext.cpp | 50 ++++++++++++++++++++++++-------------------------
+ 1 file changed, 24 insertions(+), 26 deletions(-)
+
+diff --git a/src/kwebkitpart_ext.cpp b/src/kwebkitpart_ext.cpp
+index a31de06..a5d9a02 100644
+--- a/src/kwebkitpart_ext.cpp
++++ b/src/kwebkitpart_ext.cpp
+@@ -528,40 +528,38 @@ void WebKitBrowserExtension::slotViewDocumentSource()
+ {
+     if (!view())
+         return;
+-#if 0
+-    //FIXME: This workaround is necessary because freakin' QtWebKit does not provide
+-    //a means to obtain the original content of the frame. Actually it does, but the
+-    //returned content is royally screwed up! *sigh*
+-    KRun::runUrl(view()->page()->mainFrame()->url(), QL1S("text/plain"), view(), false);
+-#else
+-    KTemporaryFile tempFile;
+-    tempFile.setSuffix(QL1S(".html"));
+-    tempFile.setAutoRemove(false);
+-    if (tempFile.open()) {
+-        tempFile.write(view()->page()->mainFrame()->toHtml().toUtf8());
+-        KRun::runUrl(tempFile.fileName(), QL1S("text/plain"), view(), true, false);
++
++    const KUrl pageUrl (view()->url());
++    if (pageUrl.isLocalFile()) {
++        KRun::runUrl(pageUrl, QL1S("text/plain"), view(), false);
++    } else {
++        KTemporaryFile tempFile;
++        tempFile.setSuffix(QL1S(".html"));
++        tempFile.setAutoRemove(false);
++        if (tempFile.open()) {
++            tempFile.write(view()->page()->mainFrame()->toHtml().toUtf8());
++            KRun::runUrl(tempFile.fileName(), QL1S("text/plain"), view(), true, false);
++        }
+     }
+-#endif
+ }
+ 
+ void WebKitBrowserExtension::slotViewFrameSource()
+ {
+     if (!view())
+         return;
+-#if 0
+-    //FIXME: This workaround is necessary because freakin' QtWebKit does not provide
+-    //a means to obtain the original content of the frame. Actually it does, but the
+-    //returned content is royally screwed up! *sigh*
+-    KRun::runUrl(view()->page()->mainFrame()->url(), QL1S("text/plain"), view(), false);
+-#else
+-    KTemporaryFile tempFile;
+-    tempFile.setSuffix(QL1S(".html"));
+-    tempFile.setAutoRemove(false);
+-    if (tempFile.open()) {
+-        tempFile.write(view()->page()->currentFrame()->toHtml().toUtf8());
+-        KRun::runUrl(tempFile.fileName(), QL1S("text/plain"), view(), true, false);
++
++    const KUrl frameUrl(view()->page()->currentFrame()->url());
++    if (frameUrl.isLocalFile()) {
++        KRun::runUrl(frameUrl, QL1S("text/plain"), view(), false);
++    } else {
++        KTemporaryFile tempFile;
++        tempFile.setSuffix(QL1S(".html"));
++        tempFile.setAutoRemove(false);
++        if (tempFile.open()) {
++            tempFile.write(view()->page()->currentFrame()->toHtml().toUtf8());
++            KRun::runUrl(tempFile.fileName(), QL1S("text/plain"), view(), true, false);
++        }
+     }
+-#endif
+ }
+ 
+ static bool isMultimediaElement(const QWebElement& element)
+-- 
+1.7.12.1
+
diff --git a/kwebkitpart.spec b/kwebkitpart.spec
index 6dd780a..cf35316 100644
--- a/kwebkitpart.spec
+++ b/kwebkitpart.spec
@@ -1,29 +1,32 @@
-%define snap 20120726
-
-Name:             kwebkitpart
-Version:          1.3
-Release:          0.1.%{snap}git%{?dist}
-Summary:          A KPart based on QtWebKit
-Group:            System Environment/Libraries
-License:          LGPLv2+
-URL:              https://projects.kde.org/projects/extragear/base/kwebkitpart
-%if 0%{?snap}
-# git clone git://anongit.kde.org/kwebkitpart
-# git archive --prefix=kwebkitpart-%{version}/ 1.3 | xz > ../kwebkitpart-%{version}-%{snap}.tar.bz2
-Source0:          kwebkitpart-%{version}-%{snap}.tar.xz
-%else
-# Official release
-Source0:          http://kde-apps.org/CONTENT/content-files/127960-%{name}-%{version}.tar.bz2
-%endif
 
-BuildRequires:    gettext
-BuildRequires:    kdelibs4-devel >= 4.8.3
+Name:    kwebkitpart
+Summary: A KPart based on QtWebKit
+Version: 1.3.0
+Release: 1%{?dist}
 
-%{?_kde4_version:Requires: kdelibs4%{?_isa} >= %{_kde4_version}}
+License: LGPLv2+
+URL:     https://projects.kde.org/projects/extragear/base/kwebkitpart
+# git clone git://anongit.kde.org/kwebkitpart
+# git archive --prefix=kwebkitpart-%{version}/ v1.3.0 | xz > ../kwebkitpart-%{version}.tar.xz
+Source0: kwebkitpart-%{version}.tar.xz
+
+## upstream patches
+Patch101: 0001-Removed-unnecessary-debug-statements.patch
+Patch102: 0002-Do-not-crash-when-QWebHitTestResult-frame-returns-NU.patch
+Patch103: 0003-Added-the-applet-tag-to-the-ondemand-plugin-loader-l.patch
+Patch104: 0004-Fix-search-shortcuts.patch
+Patch105: 0005-Removed-no-longer-necessary-namespace-use.patch
+Patch106: 0006-On-view-frame-or-document-source-open-the-actual-fil.patch
+
+BuildRequires: gettext
+BuildRequires: git-core
+BuildRequires: kdelibs4-devel >= 4.8.3
+BuildRequires: pkgconfig(QtWebKit)
 
-Obsoletes:        kwebkitpart-devel < 1.1
-Obsoletes:        webkitpart < 0.0.6
-Provides:         webkitpart = %{version}-%{release}
+%{?_kde4_version:Requires: kdelibs4%{?_isa} >= %{_kde4_version}}
+Obsoletes: kwebkitpart-devel < 1.1
+Obsoletes: webkitpart < 0.0.6
+Provides:  webkitpart = %{version}-%{release}
 
 %description
 KWebKitPart is a web browser component for KDE (KPart)
@@ -34,6 +37,25 @@ browsing the web in Konqueror.
 %prep
 %setup -q
 
+git init
+if [ -z "$GIT_COMMITTER_NAME" ]; then
+git config user.email "kde at lists.fedoraproject.org"
+git config user.name "Fedora KDE SIG"
+fi
+git add .
+git commit -a -q -m "%{version} baseline."
+
+# Apply all the patches
+git am -p1 %{patches} < /dev/null
+
+%if 0%{?fedora} < 18
+# revert commit that gives kwebkitpart higher priority than khtml
+# https://projects.kde.org/projects/extragear/base/kwebkitpart/repository/revisions/49ea6284cc46e8a24d04a564d4c8680ebd2b0f74
+sed -i.InitialPreference \
+  -e 's|^InitialPreference=.*|-InitialPreference=9|g' \
+  src/kwebkitpart.desktop
+%endif
+
 
 %build
 mkdir -p %{_target_platform}
@@ -44,14 +66,9 @@ popd
 make %{?_smp_mflags} -C %{_target_platform}
 
 %install
-rm -rf $RPM_BUILD_ROOT
-
 make install/fast DESTDIR=$RPM_BUILD_ROOT -C %{_target_platform}
 
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
 %post
 touch --no-create %{_kde4_iconsdir}/hicolor &> /dev/null ||:
 
@@ -65,14 +82,21 @@ if [ $1 -eq 0 ] ; then
 fi
 
 %files
-%defattr(-,root,root,-)
 %doc README COPYING.LIB TODO
 %{_kde4_libdir}/kde4/kwebkitpart.so
 %{_kde4_iconsdir}/hicolor/*/apps/webkit.*
 %{_kde4_datadir}/kde4/services/kwebkitpart.desktop
 %{_kde4_appsdir}/kwebkitpart/
 
+
 %changelog
+* Thu Oct 04 2012 Rex Dieter <rdieter at fedoraproject.org> 1.3.0-1
+- generate tarball from v1.3.0 tag
+- include a few post v1.3.0 patches
+- default web browsing KPart unexpectedly changed to WebKitPart (#862601)
+- BR: pkgconfig(QtWebKit)
+- .spec cosmetics
+
 * Thu Jul 26 2012 Rex Dieter <rdieter at fedoraproject.org> 1.3-0.1.20120726git
 - 1.3 branch 20120726 snapshot
 
diff --git a/sources b/sources
index 5719823..6a08a3a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-e3bf0e036cbe3674d9f092bf446ba108  kwebkitpart-1.3-20120726.tar.xz
+df3d529f9aa062eefa2812cdab99d7fe  kwebkitpart-1.3.0.tar.xz


More information about the scm-commits mailing list