rpms/konq-plugins/devel konq-plugins-4.4.0-babelfish-kwebkitpart.patch, NONE, 1.1 konq-plugins.spec, 1.43, 1.44

Kevin Kofler kkofler at fedoraproject.org
Sat Feb 13 17:54:35 UTC 2010


Author: kkofler

Update of /cvs/pkgs/rpms/konq-plugins/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24783/devel

Modified Files:
	konq-plugins.spec 
Added Files:
	konq-plugins-4.4.0-babelfish-kwebkitpart.patch 
Log Message:
* Sat Feb 13 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.4.0-2
- backport upstream patch to fix BabelFish plugin WebKitPart support (#564552)

konq-plugins-4.4.0-babelfish-kwebkitpart.patch:
 CMakeLists.txt       |   48 ++++++++++++------------------------------------
 plugin_babelfish.cpp |   21 ++++++++++++---------
 2 files changed, 24 insertions(+), 45 deletions(-)

--- NEW FILE konq-plugins-4.4.0-babelfish-kwebkitpart.patch ---
Index: babelfish/CMakeLists.txt
===================================================================
--- babelfish/CMakeLists.txt	(revision 1089029)
+++ babelfish/CMakeLists.txt	(revision 1089030)
@@ -6,36 +6,19 @@
 if(DEPEND_PACKAGE_KWebKitPart)
         macro_optional_find_package(KWebKitPart QUIET)
 else(DEPEND_PACKAGE_KWebKitPart)
-        set(WEBKITPART_FOUND FALSE)
+        set(KWEBKITPART_FOUND FALSE)
 endif(DEPEND_PACKAGE_KWebKitPart)
 
+if(KWEBKITPART_FOUND)
+    add_definitions(-DHAVE_KWEBKITPART)
+    include_directories(${KWEBKITPART_INCLUDE_DIR})
+    set(KWEBKITPART_FOUND true)
+endif(KWEBKITPART_FOUND)
 
-if(${KDE_VERSION} VERSION_LESS 4.3.74) # newer kdelibs versions include webkitkde
-    MACRO_OPTIONAL_DEPEND_PACKAGE(KdeWebKit "kdewebkit")
-    if(DEPEND_PACKAGE_KdeWebKit)
-            macro_optional_find_package(KdeWebKit QUIET)
-    else(DEPEND_PACKAGE_KdeWebKit)
-            set(WEBKITPART_FOUND FALSE)
-    endif(DEPEND_PACKAGE_KdeWebKit)
-endif(${KDE_VERSION} VERSION_LESS 4.3.74)
 
+macro_log_feature(KWEBKITPART_FOUND "KWebKitPart" "KWebKitPart libraries and header files" "https://svn.kde.org/home/kde/trunk/extragear/base/kwebkitpart" FALSE "" "KWebKitPart is necessary to compile KGet support for KWebKitPart.")
 
-macro_log_feature(WEBKITPART_FOUND "WebKitKde" "Webkitkde libraries and header files" "https://svn.kde.org/home/kde/trunk/playground/libs/webkitkde" FALSE "" "Webkitkde is necessary to compile Babelfish support for WebKitKde.")
 
-macro_bool_to_01(WEBKITPART_FOUND HAVE_WEBKITPART)
-
-
-if( WEBKITPART_FOUND )
-    if(${KDE_VERSION} VERSION_LESS 4.3.74)
-        include_directories(kwebkit ${KDEWEBKIT_INCLUDE_DIR})
-    endif(${KDE_VERSION} VERSION_LESS 4.3.74)
-
-    include_directories(${WEBKITPART_INCLUDE_DIR})
-endif(WEBKITPART_FOUND)
-
-
-
-
 configure_file(config-babelfish.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-babelfish.h )
 
 ########### next target ###############
@@ -47,17 +30,10 @@
 
 
 target_link_libraries(babelfishplugin  ${KDE4_KHTML_LIBS} )
-if( WEBKITPART_FOUND)
-    if(${KDE_VERSION} VERSION_LESS 4.3.74)
-        target_link_libraries(babelfishplugin ${KDEWEBKIT_LIBRARIES})
-    else(${KDE_VERSION} VERSION_LESS 4.3.74)
-        target_link_libraries(babelfishplugin ${KDE4_KDEWEBKIT_LIBS})
-    endif(${KDE_VERSION} VERSION_LESS 4.3.74)
+if(KWEBKITPART_FOUND)
+    target_link_libraries(babelfishplugin ${KWEBKITPART_LIBRARIES} ${KDE4_KDEUI_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
+endif(KWEBKITPART_FOUND)
 
-    target_link_libraries(babelfishplugin ${WEBKITPART_LIBRARIES} ${QT_QTWEBKIT_LIBRARY})
-endif(WEBKITPART_FOUND)
-
-
 install(TARGETS babelfishplugin  DESTINATION ${PLUGIN_INSTALL_DIR} )
 
 
@@ -65,7 +41,7 @@
 
 install( FILES plugin_babelfish.rc plugin_babelfish.desktop  DESTINATION  ${DATA_INSTALL_DIR}/khtml/kpartplugins )
 install( FILES translaterc  DESTINATION  ${CONFIG_INSTALL_DIR} )
-if(WEBKITPART_FOUND)
+if(KWEBKITPART_FOUND)
    install( FILES plugin_babelfish.rc plugin_babelfish.desktop  DESTINATION  ${DATA_INSTALL_DIR}/kwebkitpart/kpartplugins )
-endif(WEBKITPART_FOUND)
+endif(KWEBKITPART_FOUND)
 kde4_install_icons(${ICON_INSTALL_DIR})
Index: babelfish/plugin_babelfish.cpp
===================================================================
--- babelfish/plugin_babelfish.cpp	(revision 1089029)
+++ babelfish/plugin_babelfish.cpp	(revision 1089030)
@@ -41,7 +41,7 @@
 #include <KConfigGroup>
 #include <KHTMLPart>
 
-#ifdef HAVE_WEBKITPART
+#ifdef HAVE_KWEBKITPART
 #include <KWebKitPart>
 #include <QWebView>
 #endif
@@ -175,9 +175,9 @@
   m_menu->setEnabled( true );
 
   // TODO: we could also support plain text viewers...
-  if ( parent  )
+  KParts::ReadOnlyPart* part = qobject_cast<KParts::ReadOnlyPart *>(parent);  
+  if ( part )
   {
-    KParts::ReadOnlyPart* part = static_cast<KParts::ReadOnlyPart *>(parent);
     connect( part, SIGNAL(started(KIO::Job*)), this,
              SLOT(slotStarted(KIO::Job*)) );
   }
@@ -190,9 +190,12 @@
 
 void PluginBabelFish::slotStarted( KIO::Job* )
 {
-  if ( ( parent()->inherits("KHTMLPart")||parent()->inherits("KWebKitPart") ) &&
-  // Babelfish wants http URLs only. No https.
-       static_cast<KParts::ReadOnlyPart *>(parent())->url().protocol().toLower() == "http" )
+  KParts::ReadOnlyPart* part = qobject_cast<KParts::ReadOnlyPart *>(parent());  
+
+    // Babelfish wants http URLs only. No https.
+  if ( part && 
+       part->url().protocol().compare (QLatin1String("http"), Qt::CaseInsensitive) == 0 && 
+       ( part->inherits("KHTMLPart")|| part->inherits("KWebKitPart") ) )
   {
       m_menu->setEnabled( true );
   }
@@ -234,7 +237,7 @@
   QString totrans;
 
 
-  KHTMLPart *part = dynamic_cast<KHTMLPart *>(parent());
+  KHTMLPart *part = qobject_cast<KHTMLPart *>(parent());
   bool hasSelection = false;
   QString selection;
   KUrl url;
@@ -246,8 +249,8 @@
   }
   else
   {
-#ifdef HAVE_WEBKITPART
-      KWebKitPart *part = dynamic_cast<KWebKitPart *>(parent());
+#ifdef HAVE_KWEBKITPART
+      KWebKitPart *part = qobject_cast<KWebKitPart *>(parent());
       hasSelection = !part->view()->selectedText().isEmpty();
       selection = part->view()->selectedText();
       url = KUrl( part->view()->url() );


Index: konq-plugins.spec
===================================================================
RCS file: /cvs/pkgs/rpms/konq-plugins/devel/konq-plugins.spec,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -p -r1.43 -r1.44
--- konq-plugins.spec	12 Feb 2010 21:08:58 -0000	1.43
+++ konq-plugins.spec	13 Feb 2010 17:54:35 -0000	1.44
@@ -2,13 +2,15 @@
 
 Name:           konq-plugins
 Version:        4.4.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Additional plugins that interact with konqueror
 
 Group:          Applications/Internet
 License:        GPLv2+ and LGPLv2+
 URL:            http://extragear.kde.org
 Source0:        ftp://ftp.kde.org/pub/kde/stable/%{version}/src/extragear/konq-plugins-%{version}.tar.bz2
+# http://websvn.kde.org/?view=revision&revision=1089030
+Patch100:       konq-plugins-4.4.0-babelfish-kwebkitpart.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires: cmake
@@ -49,6 +51,7 @@ Some additional plugins that interact wi
 
 %prep
 %setup -q
+%patch100 -p0 -b .babelfish-kwebkitpart
 
 
 %build
@@ -139,6 +142,9 @@ gtk-update-icon-cache %{_kde4_iconsdir}/
 
 
 %changelog
+* Sat Feb 13 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.4.0-2
+- backport upstream patch to fix BabelFish plugin WebKitPart support (#564552)
+
 * Fri Feb 12 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.4.0-1
 - konq-plugins-4.4.0 for real
 



More information about the scm-commits mailing list