From 06a8657423d7dd247d52fae5e51e672b7c99ea88 Mon Sep 17 00:00:00 2001 From: Syping Date: Sat, 16 Jun 2018 05:28:56 +0200 Subject: [PATCH] fixed mass import --- ProfileInterface.cpp | 7 +++---- ProfileInterface.h | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp index 02411d6..9bab574 100644 --- a/ProfileInterface.cpp +++ b/ProfileInterface.cpp @@ -121,6 +121,9 @@ ProfileInterface::ProfileInterface(ProfileDatabase *profileDB, CrewDatabase *cre } #endif + // Seed RNG + pcg32_srandom_r(&rng, time(NULL), (intptr_t)&rng); + setMouseTracking(true); installEventFilter(this); } @@ -804,7 +807,6 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool warn) { QString picFileName = picture->getPictureFileName(); - qDebug() << picFileName; QString adjustedFileName = picture->getOriginalPictureFileName(); if (picFileName.left(4) != "PGTA") { @@ -1946,9 +1948,6 @@ preSelectionTitle: int ProfileInterface::getRandomUid() { - pcg32_random_t rng; - pcg32_srandom_r(&rng, time(NULL), (intptr_t)&rng); int random_int = pcg32_boundedrand_r(&rng, 2147483647); - qDebug() << random_int; return random_int; } diff --git a/ProfileInterface.h b/ProfileInterface.h index 4aef151..34acde6 100644 --- a/ProfileInterface.h +++ b/ProfileInterface.h @@ -29,6 +29,7 @@ #include "ExportThread.h" #include "SavegameData.h" #include "CrewDatabase.h" +#include "pcg_basic.h" #include #include #include @@ -107,6 +108,7 @@ private: QString profileName; QString loadingStr; QString language; + pcg32_random_t rng; bool contextMenuOpened; bool isProfileLoaded; int selectedWidgts; @@ -124,7 +126,7 @@ private: void insertSnapmaticIPI(QWidget *widget); void insertSavegameIPI(QWidget *widget); void sortingProfileInterface(); - static int getRandomUid(); + int getRandomUid(); signals: void profileLoaded();