diff --git a/sdk/plugins/gallery.cpp b/sdk/plugins/gallery.cpp index 42253d4..03f2c42 100644 --- a/sdk/plugins/gallery.cpp +++ b/sdk/plugins/gallery.cpp @@ -590,10 +590,10 @@ class dbGallery : public Gallery } QStringList labels = entries.keys(); + qSort(labels); + if (hasFilter && ((labels.size() > numSubjects) || (numSubjects == std::numeric_limits::max()))) std::random_shuffle(labels.begin(), labels.end()); - else - qSort(labels); foreach (const QString &label, labels) { QList entryList = entries[label];