fixed mass import

This commit is contained in:
Syping 2018-06-16 05:28:56 +02:00
parent caffd9f246
commit 06a8657423
2 changed files with 6 additions and 5 deletions

View File

@ -121,6 +121,9 @@ ProfileInterface::ProfileInterface(ProfileDatabase *profileDB, CrewDatabase *cre
} }
#endif #endif
// Seed RNG
pcg32_srandom_r(&rng, time(NULL), (intptr_t)&rng);
setMouseTracking(true); setMouseTracking(true);
installEventFilter(this); installEventFilter(this);
} }
@ -804,7 +807,6 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime
bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool warn) bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool warn)
{ {
QString picFileName = picture->getPictureFileName(); QString picFileName = picture->getPictureFileName();
qDebug() << picFileName;
QString adjustedFileName = picture->getOriginalPictureFileName(); QString adjustedFileName = picture->getOriginalPictureFileName();
if (picFileName.left(4) != "PGTA") if (picFileName.left(4) != "PGTA")
{ {
@ -1946,9 +1948,6 @@ preSelectionTitle:
int ProfileInterface::getRandomUid() int ProfileInterface::getRandomUid()
{ {
pcg32_random_t rng;
pcg32_srandom_r(&rng, time(NULL), (intptr_t)&rng);
int random_int = pcg32_boundedrand_r(&rng, 2147483647); int random_int = pcg32_boundedrand_r(&rng, 2147483647);
qDebug() << random_int;
return random_int; return random_int;
} }

View File

@ -29,6 +29,7 @@
#include "ExportThread.h" #include "ExportThread.h"
#include "SavegameData.h" #include "SavegameData.h"
#include "CrewDatabase.h" #include "CrewDatabase.h"
#include "pcg_basic.h"
#include <QProgressDialog> #include <QProgressDialog>
#include <QSpacerItem> #include <QSpacerItem>
#include <QDateTime> #include <QDateTime>
@ -107,6 +108,7 @@ private:
QString profileName; QString profileName;
QString loadingStr; QString loadingStr;
QString language; QString language;
pcg32_random_t rng;
bool contextMenuOpened; bool contextMenuOpened;
bool isProfileLoaded; bool isProfileLoaded;
int selectedWidgts; int selectedWidgts;
@ -124,7 +126,7 @@ private:
void insertSnapmaticIPI(QWidget *widget); void insertSnapmaticIPI(QWidget *widget);
void insertSavegameIPI(QWidget *widget); void insertSavegameIPI(QWidget *widget);
void sortingProfileInterface(); void sortingProfileInterface();
static int getRandomUid(); int getRandomUid();
signals: signals:
void profileLoaded(); void profileLoaded();