23 #include "checkwadsdlg.h" 24 #include "configuration/doomseekerconfig.h" 25 #include "pathfinder/pathfinder.h" 26 #include "pathfinder/wadpathfinder.h" 29 #include <QScopedPointer> 32 DClass<CheckWadsDlg> :
public Ui::CheckWadsDlg
38 QScopedPointer<QTimer> checkWadTimer;
39 QScopedPointer<QTimer> showWindow;
40 bool checkIncompatibility;
47 assert(pathFinder !=
nullptr);
48 d->pathFinder = pathFinder;
49 d->checkIncompatibility = gConfig.doomseeker.bCheckTheIntegrityOfWads;
50 d->checkWadTimer.reset(
new QTimer);
51 d->showWindow.reset(
new QTimer);
54 connect(d->checkWadTimer.data(), SIGNAL(timeout()),
this, SLOT(performCheckStep()));
55 connect(d->showWindow.data(), SIGNAL(timeout()),
this, SLOT(openWindow()));
56 connect(d->buttonBox, SIGNAL(clicked(QAbstractButton*)), SLOT(abortCheck()));
59 CheckWadsDlg::~CheckWadsDlg()
66 d->progressBar->setMaximum(d->progressBar->value() + wads.size());
71 d->showWindow->setSingleShot(
true);
72 d->showWindow->start(500);
73 d->checkWadTimer->start(0);
77 connect(
this, SIGNAL(finishedChecking()), &loop, SLOT(quit()));
80 d->showWindow->stop();
82 return d->wadsChecked;
85 void CheckWadsDlg::openWindow()
90 void CheckWadsDlg::performCheckStep()
92 if (d->wads.isEmpty())
94 d->checkWadTimer->stop();
95 emit finishedChecking();
99 const PWad wad = d->wads.first();
100 d->wads.removeFirst();
104 if (!findResult.isValid())
105 d->wadsChecked.missingWads << wad;
106 else if (d->checkIncompatibility && !wad.
validFile(findResult.path()))
107 d->wadsChecked.incompatibleWads << wad;
109 d->wadsChecked.foundWads << wad;
111 d->progressBar->setValue(d->progressBar->value() + 1);
114 void CheckWadsDlg::abortCheck()
116 d->checkIncompatibility =
false;
Manages the checking process of wads when trying to enter a server or when executing the "Find missin...
Performs a case-insensitive (OS independent) file searches.
Contains the results of CheckWadsDlg::CheckWads(), categorized in "incomplete", "missing" and "found"...
void addWads(const QList< PWad > &wads)
adds the wads to check.
const CheckResult checkWads()
this function will check for the paths and integrity (if it is turned on in the config). If the process takes more than 500 milliseconds, it will open a loading bar.
bool validFile(const QString &path) const
Verifies if a file has the same checksums as the PWad.
Wrapper for PathFinder that specializes in findings WADs.
const QString & name() const
File name of the WAD.