Profile: open pictures using local file path

Make the behavior of the profile-pictures consistent with the pictures
in the photos-tab: Use the local file path to open the picture in the
system viewer instead of the canonical filename (which might point to
a non-existing location).

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-06-03 17:51:59 +02:00 committed by Robert C. Helling
parent 2209054226
commit 9d73b66024

View file

@ -3,6 +3,7 @@
#include "profile-widget/animationfunctions.h"
#include "qt-models/divepicturemodel.h"
#include "core/pref.h"
#include "core/qthelper.h"
#ifndef SUBSURFACE_MOBILE
#include "desktop-widgets/preferences/preferencesdialog.h"
#endif
@ -106,9 +107,8 @@ void DivePictureItem::hoverLeaveEvent(QGraphicsSceneHoverEvent*)
void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
QDesktopServices::openUrl(QUrl::fromLocalFile(fileUrl));
}
if (event->button() == Qt::LeftButton)
QDesktopServices::openUrl(QUrl::fromLocalFile(localFilePath(fileUrl)));
}
void DivePictureItem::removePicture()