Re: bugfix for KBabel

Jens Herden <jens-W20+MoKGEJdEHWO/[email protected]> Thu, 1 Sep 2005 10:50:00 +0700
Newsgroups gmane.comp.kde.devel.kbabel
Message-ID <[email protected]>
Hi,

I reply to my mail in order to submit a new patch.

> Can we use KMimeType::findByURL on the url that is in the private data?
> Then I would not need to pass the url as parameter at all and the filename
> of the temp file would not be important.

The new patch does exactly this and is cleaner than the others. And it does 
solve the same bugs ;-)

Please have a look again

Jens

_______________________________________________
kbabel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kbabel
catalog.diff (text/x-diff, 915 B)
Index: kbabel/common/catalog.cpp
===================================================================
--- kbabel/common/catalog.cpp	(revision 455643)
+++ kbabel/common/catalog.cpp	(working copy)
@@ -1863,8 +1863,7 @@
 
       if(status == OK)
       {
-         KURL temp(tempFile);
-         if( !KIO::NetAccess::upload( temp.url(), targetURL, NULL ) )
+         if( !KIO::NetAccess::upload( tempFile, targetURL, NULL ) )
          {
             status = OS_ERROR;
          }
@@ -1930,7 +1929,7 @@
     CatalogExportPlugin* filter=0;
 
     // gimme plugin for this MIME type
-    KMimeType::Ptr mime = KMimeType::findByURL( KURL::fromPathOrURL( localFile ) );
+    KMimeType::Ptr mime = KMimeType::findByURL( KURL::fromPathOrURL( currentURL().url() ) );
     KTrader::OfferList offers = KTrader::self()->query("KBabelFilter", "('"+mime->name()+"' in [X-KDE-Export])");
     KService::Ptr ptr = offers.first();
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQBDFnpvkYmIVB8IV+ARAm8eAJ9To4FeDY2iib3jL0eTKG0L49hiqQCfX3qd
e+HPMbOA4JwjFvuPfAIH3ZA=
=92p2
-----END PGP SIGNATURE-----