------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=124175
michael.larouche kdemail net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From michael.larouche kdemail net 2006-04-09 16:54
-------
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,
_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel