summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2024-04-14 10:38:02 +0200
committerSlávek Banko <slavek.banko@axis.cz>2024-04-14 10:55:43 +0200
commitd996d03391ddf450d51439489b5313f4d5ef6542 (patch)
tree62b5e80fe1d5716279b5df067b0093957c99656f
parentce857b090b6c6437718c80bb473b3e1ada826bd5 (diff)
downloadtdeaddons-r14.1.x.tar.gz
tdeaddons-r14.1.x.zip
Fix compatibility with C++17.r14.1.2r14.1.x
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit ad4afbbabf617caaf7eda7ac9b7f8a200e754b33)
-rw-r--r--noatun-plugins/dub/dub/dub.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/noatun-plugins/dub/dub/dub.cpp b/noatun-plugins/dub/dub/dub.cpp
index b5ff637..286ff95 100644
--- a/noatun-plugins/dub/dub/dub.cpp
+++ b/noatun-plugins/dub/dub/dub.cpp
@@ -35,6 +35,7 @@
#include <vector>
#include <algorithm>
+#include <random>
using std::vector;
using std::iterator;
@@ -548,9 +549,9 @@ void Dub::Shuffle_OneDir::init(const TQString& dir)
kdDebug(90010) << num_items << " file items" << endl;
for (int i=0; i<num_items; i++)
play_order[i] = i;
- Random random;
- Random::init();
- std::random_shuffle(play_order.begin(), play_order.end(), random);
+ std::random_device randomDev;
+ std::mt19937 randomGenerator(randomDev());
+ std::shuffle(play_order.begin(), play_order.end(), randomGenerator);
}
}
}