Commit e8f277a1 authored by Laurent Montel's avatar Laurent Montel 😁 Committed by Pali Rohár

Try to fix qt warning

parent 78d8b004
......@@ -704,7 +704,10 @@ QString nameFromContact(Kopete::Contact *c) /*const*/
QUrl MetaContact::customPhoto() const
{
return QUrl(d->customPicture.path());
if (d->customPicture.path().isEmpty()) {
return QUrl();
}
return QUrl::fromLocalFile(d->customPicture.path());
}
void MetaContact::setPhoto(const QUrl &url)
......
......@@ -18,6 +18,7 @@
#include <kcontacts/picture.h>
#include <QDir>
#include <kcodecs.h>
#include <kdebug.h>
......@@ -119,6 +120,7 @@ QString Picture::path()
context.addData(tempArray);
// Save the image to a file.
localPhotoPath = context.result() + QLatin1String(".png");
QDir().mkpath(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + QStringLiteral("metacontactpicturecache/"));
localPhotoPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + QStringLiteral("metacontactpicturecache/%1").arg(localPhotoPath);
if (image().save(localPhotoPath, "PNG")) {
d->picturePath = localPhotoPath;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment