Version: 0.11.1 (using KDE 3.5.1, Debian Package 4:3.5.1-4 (testing/unstable)) Compiler: Target: i486-linux-gnu OS: Linux (i686) release 2.6.15.6 Hello, In the configuration panel, when I set my personnal picture in the identity part, it creates a picture in ~/.kde/share/apps/kopete/globalindentitiespictures called "Identité-par-défaut.png" (french l10n). To that point it works well. But when I come back to the configuration panel, I can see ~/.kde/share/apps/kopete/globalindentitiespictures/Identit%E9-par-d%E9faut.png and the picture doesn't display... So I can't provide a beautifull picture of myself to my friends... snif...
the name of the identity should not be translated when saving photos, etc. to disk, since the URL escaping will cause problems. That is what is happening here.
*** Bug 125215 has been marked as a duplicate of this bug. ***
*** Bug 125221 has been marked as a duplicate of this bug. ***
SVN commit 527913 by mlarouche: BUG: 124175 Use MD5 Hash as filename to save custom images in global identity. So no non-ASCII characters will be in filename. M +15 -2 kopeteidentityconfig.cpp --- branches/kopete/0.12/kopete/kopete/config/identity/kopeteidentityconfig.cpp #527912:527913 @@ -26,6 +26,7 @@ #include <qradiobutton.h> #include <qcombobox.h> #include <qapplication.h> +#include <qbuffer.h> // KDE includes #include <kcombobox.h> @@ -41,6 +42,7 @@ #include <kurlrequester.h> #include <kinputdialog.h> #include <kpixmapregionselectordialog.h> +#include <kmdcodec.h> // KDE KIO includes #include <kio/netaccess.h> @@ -515,8 +517,8 @@ void KopeteIdentityConfig::slotChangePhoto(const QString &photoUrl) { - QString saveLocation = locateLocal("appdata", "globalidentitiespictures/"+d->selectedIdentity.replace(" ", "-")+".png"); - + QString saveLocation; + QImage photo(photoUrl); // use KABC photo size 100x140 photo = KPixmapRegionSelectorDialog::getSelectedImage( QPixmap(photo), 100, 140, this ); @@ -531,6 +533,17 @@ photo = photo.scaleWidth(100); } + // Use MD5 hash to save the filename, so no problems will occur with the filename because of non-ASCII characters. + // Bug 124175: My personnal picture doesn't appear cause of l10n + QByteArray tempArray; + QBuffer tempBuffer(tempArray); + tempBuffer.open( IO_WriteOnly ); + photo.save(&tempBuffer, "PNG"); + KMD5 context(tempArray); + // Save the image to a file. + saveLocation = context.hexDigest() + ".png"; + saveLocation = locateLocal( "appdata", QString::fromUtf8("globalidentitiespictures/%1").arg( saveLocation ) ); + if(!photo.save(saveLocation, "PNG")) { KMessageBox::sorry(this,
*** Bug 124847 has been marked as a duplicate of this bug. ***
This is still valid in 0.12.2. I have set-up a new jabber-account and it does not use the global-identity's photo.