diff options
author | 2023-09-19 02:01:41 +0600 | |
---|---|---|
committer | 2023-09-19 02:01:41 +0600 | |
commit | 36d10b4b6359b5cf3ff0e37f2330dfaf91cbf530 (patch) | |
tree | cad68505e3dcff4e8d37c5a6a052240d8a935efb /src/widgets | |
parent | 35d85d38d02d97e1c63729bb3301f46bb6f96728 (diff) | |
parent | 906ca7eb436dc9944d43f5b7f6ae7b44afc2a3e7 (diff) | |
download | whatsie-36d10b4b6359b5cf3ff0e37f2330dfaf91cbf530.tar.gz whatsie-36d10b4b6359b5cf3ff0e37f2330dfaf91cbf530.zip |
Update upstream source from tag 'upstream/4.14.1'
Update to upstream version '4.14.1'
with Debian dir 267b96a979689ac47077c72b576cf79da29f8ff2
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/MoreApps/moreapps.cpp | 14 | ||||
-rw-r--r-- | src/widgets/scrolltext/scrolltext.cpp | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/widgets/MoreApps/moreapps.cpp b/src/widgets/MoreApps/moreapps.cpp index b8e8c17..c333751 100644 --- a/src/widgets/MoreApps/moreapps.cpp +++ b/src/widgets/MoreApps/moreapps.cpp @@ -11,6 +11,7 @@ #include <algorithm> #include <cstdlib> #include <ctime> +#include <random> MoreApps::MoreApps(QWidget *parent, QNetworkAccessManager *nam, const QString &publisherName, const QUrl &remoteFilterUrl, @@ -217,7 +218,7 @@ void MoreApps::setRemoteIcon(const QUrl &iconUrl, QLabel *lb) { auto replyBytes = reply->readAll(); QPixmap pixmap; pixmap.loadFromData(replyBytes); - //qDebug() << "after load" << lb->size(); + // qDebug() << "after load" << lb->size(); lb->setPixmap(pixmap.scaled(lb->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation)); } @@ -239,11 +240,10 @@ void MoreApps::showApps() { qDebug() << "showing apps..."; - std::srand(unsigned(std::time(0))); - // rand generator - auto rand = [](auto i) { return std::rand() % i; }; - // shuffle appList before adding - std::random_shuffle(mAppList.begin(), mAppList.end(), rand); + std::random_device rd; + std::mt19937 rng(rd()); + + std::shuffle(mAppList.begin(), mAppList.end(), rng); auto fallbackIconUrl = QUrl("https://dashboard.snapcraft.io/site_media/appmedia/" @@ -254,7 +254,7 @@ void MoreApps::showApps() { setRemoteIcon(fallbackIconUrl, nullptr); foreach (auto a, mAppList) { auto iconUrl = a.getIconUrl(); - //qDebug() << "pre-caching icon for" << a.getName(); + // qDebug() << "pre-caching icon for" << a.getName(); setRemoteIcon(iconUrl, nullptr); } } diff --git a/src/widgets/scrolltext/scrolltext.cpp b/src/widgets/scrolltext/scrolltext.cpp index b03b761..cac212f 100644 --- a/src/widgets/scrolltext/scrolltext.cpp +++ b/src/widgets/scrolltext/scrolltext.cpp @@ -15,7 +15,7 @@ ScrollText::ScrollText(QWidget *parent) : QWidget(parent), scrollPos(0) { setSeparator(" "); - connect(&timer, SIGNAL(timeout()), this, SLOT(timer_timeout())); + connect(&timer, &QTimer::timeout, this, &ScrollText::timer_timeout); timer.setInterval(50); } |