summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Graham <[email protected]>2018-12-26 20:49:56 -0700
committerNate Graham <[email protected]>2018-12-27 13:08:59 -0700
commitb9549351c2c7044584d75e40f0a55e7497a915c0 (patch)
tree68b4c9cb053911243ca2f9076e8a79eb5e49e64f
parentd2654a50e7851a244b6ea04567ed4f419d69093d (diff)
[Wallpaper] Allow adding multiple images at once from the file picker dialog
Summary: BUG: 402223 FIXED-IN: 5.15.0 Test Plan: Added multiple images from the file dialog. They all showed up in the wallpaper grid. Reviewers: #konsole, broulik, davidedmundson Reviewed By: davidedmundson Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D17815
-rw-r--r--wallpapers/image/image.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/wallpapers/image/image.cpp b/wallpapers/image/image.cpp
index c3b38f3..5d3e388 100644
--- a/wallpapers/image/image.cpp
+++ b/wallpapers/image/image.cpp
@@ -661,7 +661,7 @@ void Image::showFileDialog()
i18n("Image Files") + " ("+imageGlobPatterns.join(' ') + ')');
//i18n people, this isn't a "word puzzle". there is a specific string format for QFileDialog::setNameFilters
- m_dialog->setFileMode(QFileDialog::ExistingFile);
+ m_dialog->setFileMode(QFileDialog::ExistingFiles);
connect(m_dialog, &QDialog::accepted, this, &Image::wallpaperBrowseCompleted);
}
@@ -679,7 +679,9 @@ void Image::wallpaperBrowseCompleted()
{
Q_ASSERT(m_model);
if (m_dialog && m_dialog->selectedFiles().count() > 0) {
- addUsersWallpaper(m_dialog->selectedFiles().first());
+ for (const QString image : m_dialog->selectedFiles()) {
+ addUsersWallpaper(image);
+ }
emit customWallpaperPicked(m_dialog->selectedFiles().first());
}
}