kdelibs/khtml/rendering

Koos Vriezen koos.vriezen at xs4all.nl
Sat Oct 23 17:47:28 BST 2004


On Sat, Oct 23, 2004 at 05:59:21PM +0200, Waldo Bastian wrote:
> On Saturday 23 October 2004 16:36, Koos Vriezen wrote:
> > CVS commit by vriezen:
> >
> > We strip '-plugin' elsewhere, so don't add it here for classid from
> > RealAudio Also do the classid check for these
> >   <object CLASSID="...">
> >     <embed SRC="...">
> >   </object>
> > cases where embed has no servicetype set.
> 
> Does this fix BR64610 ?

No but it's true then, the realplay plugin doesn't set the
audio/x-pn-realaudio mimetype. Well, I brought up this issue a few times
and none responds to this. So should we allow the '-plugin' suffix and
duplicate many mimetypes (1) (I've seen it for java and ms-player mimes
too), or have KHTMLPart stips the '-plugin' when first attempt on
loading a kpart fails (2). (There is an issue though, that's currently not
possible to manually add audio/x-pn-realaudio-plugin in the file ass.
dialog).
Or we don't allow it (ie. strip the '-plugin') like we do now. The
BR can be fixed by simply strip the
suffix by the nspluginscan application (3). However this can be tricky if
both are generated. Another thing is that this means users have
regenerate their plugin list.

Added a patch for (2).

Koos

Index: rendering/render_frames.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_frames.cpp,v
retrieving revision 1.189
diff -u -3 -p -r1.189 render_frames.cpp
--- rendering/render_frames.cpp	23 Oct 2004 14:40:18 -0000	1.189
+++ rendering/render_frames.cpp	23 Oct 2004 16:35:22 -0000
@@ -692,9 +692,7 @@ void RenderPartObject::updateWidget()
                   serviceType = "application/x-shockwave-flash";
               }
               else if(objbase->classId.contains(QString::fromLatin1("CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA")))
-                  //if we support -plugin suffixes
-                  //serviceType = "audio/x-pn-realaudio-plugin";
-                  serviceType = "audio/x-pn-realaudio";
+                  serviceType = "audio/x-pn-realaudio-plugin";
               else if(objbase->classId.contains(QString::fromLatin1("8AD9C840-044E-11D1-B3E9-00805F499D93")) ||
                       objbase->classId.contains(QString::fromLatin1("CAFEEFAC-0014-0000-0000-ABCDEFFEDCBA")))
                   serviceType = "application/x-java-applet";
Index: html/html_objectimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_objectimpl.cpp,v
retrieving revision 1.120
diff -u -3 -p -r1.120 html_objectimpl.cpp
--- html/html_objectimpl.cpp	15 Aug 2004 00:00:11 -0000	1.120
+++ html/html_objectimpl.cpp	23 Oct 2004 16:35:22 -0000
@@ -60,9 +60,6 @@ void HTMLObjectBaseElementImpl::setServi
     int pos = serviceType.find( ";" );
     if ( pos!=-1 )
         serviceType.truncate( pos );
-    pos = serviceType.find( "-plugin" );
-    if ( pos!=-1 )
-        serviceType.truncate( pos );
 }
 
 void HTMLObjectBaseElementImpl::parseAttribute(AttributeImpl *attr)
Index: khtml_part.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtml_part.cpp,v
retrieving revision 1.1031
diff -u -3 -p -r1.1031 khtml_part.cpp
--- khtml_part.cpp	23 Oct 2004 08:48:03 -0000	1.1031
+++ khtml_part.cpp	23 Oct 2004 16:35:24 -0000
@@ -4199,8 +4199,15 @@ KParts::ReadOnlyPart *KHTMLPart::createP
 
   KTrader::OfferList offers = KTrader::self()->query( mimetype, "KParts/ReadOnlyPart", constr, QString::null );
 
-  if ( offers.isEmpty() )
-    return 0L;
+  if ( offers.isEmpty() ) {
+    int pos = mimetype.find( "-plugin" );
+    if (pos < 0)
+        return 0L;
+    QString stripped_mime = mimetype.left( pos );
+    offers = KTrader::self()->query( stripped_mime, "KParts/ReadOnlyPart", constr, QString::null );
+    if ( offers.isEmpty() )
+        return 0L;
+  }
 
   KTrader::OfferList::Iterator it = offers.begin();
   for (  ; it != offers.end() ; ++it )





More information about the kfm-devel mailing list