aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2017-05-05 21:13:46 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-05-06 08:07:16 -0700
commit462797396b082f31060df6706bfce416aebce037 (patch)
tree577ab4fc5450c068fb9146ebb72d1617f0fe1bd2 /desktop-widgets
parent59bbaa78203fafe3f66ed34c281733fe6eea0940 (diff)
downloadsubsurface-462797396b082f31060df6706bfce416aebce037.tar.gz
File selector should filter images we can actually handle.
So better ask Qt about image formats known to it. Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/divelistview.cpp7
-rw-r--r--desktop-widgets/simplewidgets.cpp1
2 files changed, 7 insertions, 1 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp
index 9c7c30578..a92afadbd 100644
--- a/desktop-widgets/divelistview.cpp
+++ b/desktop-widgets/divelistview.cpp
@@ -917,7 +917,12 @@ void DiveListView::shiftTimes()
void DiveListView::loadImages()
{
- QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Open image files"), lastUsedImageDir(), tr("Image files (*.jpg *.jpeg *.pnm *.tif *.tiff)"));
+ QStringList filters = imageExtensionFilters();
+ QStringList fileNames = QFileDialog::getOpenFileNames(this,
+ tr("Open image files"),
+ lastUsedImageDir(),
+ tr("Image files (%1)").arg(filters.join(" ")));
+
if (fileNames.isEmpty())
return;
updateLastUsedImageDir(QFileInfo(fileNames[0]).dir().path());
diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp
index f985a0f01..e6bbe87d9 100644
--- a/desktop-widgets/simplewidgets.cpp
+++ b/desktop-widgets/simplewidgets.cpp
@@ -19,6 +19,7 @@
#include "core/display.h"
#include "profile-widget/profilewidget2.h"
#include "desktop-widgets/undocommands.h"
+#include "core/qthelper.h"
class MinMaxAvgWidgetPrivate {
public: