mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-05 00:49:09 +02:00
fine tuning
This commit is contained in:
@ -318,7 +318,8 @@ void FirstLaunchView::extractGogData()
|
|||||||
QTimer::singleShot(100, this, [this, fileExe, fileBin](){ // background to make sure FileDialog is closed...
|
QTimer::singleShot(100, this, [this, fileExe, fileBin](){ // background to make sure FileDialog is closed...
|
||||||
QDir tempDir(pathToQString(VCMIDirs::get().userDataPath()));
|
QDir tempDir(pathToQString(VCMIDirs::get().userDataPath()));
|
||||||
tempDir.mkdir("tmp");
|
tempDir.mkdir("tmp");
|
||||||
tempDir.cd("tmp");
|
if(!tempDir.cd("tmp"))
|
||||||
|
return; // should not happen - but avoid deleting wrong folder in any case
|
||||||
|
|
||||||
QString tmpFileExe = tempDir.filePath("h3_gog.exe");
|
QString tmpFileExe = tempDir.filePath("h3_gog.exe");
|
||||||
QFile(fileExe).copy(tmpFileExe);
|
QFile(fileExe).copy(tmpFileExe);
|
||||||
@ -350,6 +351,7 @@ void FirstLaunchView::extractGogData()
|
|||||||
if(dirData.empty() || QDir(tempDir.filePath(dirData.front())).entryList({"*.lod"}, QDir::Filter::Files).empty())
|
if(dirData.empty() || QDir(tempDir.filePath(dirData.front())).entryList({"*.lod"}, QDir::Filter::Files).empty())
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, tr("No Heroes III data!"), tr("Selected files do not contain Heroes III data!"), QMessageBox::Ok, QMessageBox::Ok);
|
QMessageBox::critical(this, tr("No Heroes III data!"), tr("Selected files do not contain Heroes III data!"), QMessageBox::Ok, QMessageBox::Ok);
|
||||||
|
tempDir.removeRecursively();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
copyHeroesData(tempDir.path(), true);
|
copyHeroesData(tempDir.path(), true);
|
||||||
|
Reference in New Issue
Block a user