mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-06-30 18:33:39 +00:00
Fixed a crash after extracting or repacking a pak
This commit is contained in:
parent
843ea96ceb
commit
0ca82afbfe
@ -11,6 +11,7 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QProgressDialog>
|
#include <QProgressDialog>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
class CPakToolDialog : public QProgressDialog
|
class CPakToolDialog : public QProgressDialog
|
||||||
{
|
{
|
||||||
@ -29,9 +30,12 @@ private:
|
|||||||
EResult mResult;
|
EResult mResult;
|
||||||
|
|
||||||
QString mPartialString;
|
QString mPartialString;
|
||||||
bool mSetMax;
|
|
||||||
bool mUpdating;
|
bool mUpdating;
|
||||||
|
|
||||||
|
int mCur;
|
||||||
|
int mMax;
|
||||||
|
bool mSetMax;
|
||||||
|
|
||||||
// Private Functions
|
// Private Functions
|
||||||
CPakToolDialog(QWidget *pParent = 0)
|
CPakToolDialog(QWidget *pParent = 0)
|
||||||
: QProgressDialog(pParent)
|
: QProgressDialog(pParent)
|
||||||
@ -122,27 +126,30 @@ private slots:
|
|||||||
|
|
||||||
if (Result != -1)
|
if (Result != -1)
|
||||||
{
|
{
|
||||||
int Cur = rkRegExp.cap(1).toInt();
|
mCur = rkRegExp.cap(1).toInt();
|
||||||
int Count = rkRegExp.cap(2).toInt();
|
mMax = rkRegExp.cap(2).toInt();
|
||||||
|
|
||||||
if (!mSetMax)
|
if (!mSetMax)
|
||||||
{
|
{
|
||||||
setMinimum(0);
|
setMinimum(0);
|
||||||
setMaximum(Count);
|
setMaximum(mMax);
|
||||||
mSetMax = true;
|
mSetMax = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
setLabelText(QString("%1 file %2 of %3...").arg(mMode == eExtract ? "Extracting" : "Repacking").arg(Cur).arg(Count));
|
QTimer::singleShot(0, this, SLOT(UpdateUI()));
|
||||||
setWindowTitle(labelText());
|
|
||||||
setValue(Cur);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mUpdating = false;
|
mUpdating = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdateUI()
|
||||||
|
{
|
||||||
|
setLabelText(QString("%1 file %2 of %3...").arg(mMode == eExtract ? "Extracting" : "Repacking").arg(mCur).arg(mMax));
|
||||||
|
setWindowTitle(labelText());
|
||||||
|
setValue(mCur);
|
||||||
|
}
|
||||||
|
|
||||||
void PakToolFinished(int ExitCode)
|
void PakToolFinished(int ExitCode)
|
||||||
{
|
{
|
||||||
while (mUpdating) {}
|
while (mUpdating) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user