| Summary: | My personnal picture doesn't appear cause of l10n | ||
|---|---|---|---|
| Product: | [Unmaintained] kopete | Reporter: | fab <mailing.galac> |
| Component: | general | Assignee: | Kopete Developers <kopete-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | goneri, sven.burmeister |
| Priority: | NOR | ||
| Version First Reported In: | 0.11.1 | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
fab
2006-03-24 11:50:28 UTC
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. |