[KPhotoAlbum] patch: crash, if no video kpart found

Henner Zeller h.zeller at acm.org
Wed Nov 15 18:13:46 GMT 2006


Hi,
If there are no KParts found to display videos, KPA crashes, because
_playerPart is never initialized. Reason: etype is initialized with
NoError .. which it still is after the loop through zero parts.
In addition to that, the actual error was never displayed but always NoWidget.

cheers,
  -henner

--- Viewer/VideoDisplay.cpp     (revision 605173)
+++ Viewer/VideoDisplay.cpp     (working copy)
@@ -99,7 +99,7 @@

     KServiceTypeProfile::OfferList services =
KServiceTypeProfile::offers(mimeType,
QString::fromLatin1("KParts/ReadOnlyPart"));

-    ErrorType etype = NoError;
+    ErrorType etype = NoKPart;

     for( KServiceTypeProfile::OfferList::Iterator it =
services.begin(); it != services.end(); ++it ) {

@@ -136,7 +136,7 @@
        break;
     }
     if (etype != NoError) {
-       showError(NoWidget, info->fileName(), mimeType );
+       showError(etype, info->fileName(), mimeType );
        return false;
     }
     _playerPart->openURL(info->fileName());


-- 
Henner Zeller | h.zeller at acm.org
Bücher kaufen und freie Software fördern | http://bookzilla.de



More information about the Kphotoalbum mailing list