diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-05-05 21:13:46 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-05-06 08:07:16 -0700 |
commit | 462797396b082f31060df6706bfce416aebce037 (patch) | |
tree | 577ab4fc5450c068fb9146ebb72d1617f0fe1bd2 /desktop-widgets/divelistview.cpp | |
parent | 59bbaa78203fafe3f66ed34c281733fe6eea0940 (diff) | |
download | subsurface-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/divelistview.cpp')
-rw-r--r-- | desktop-widgets/divelistview.cpp | 7 |
1 files changed, 6 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()); |