fix(cpn): simulator application images cache (#7459)
This commit is contained in:
@@ -236,12 +236,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (!tempDir.isValid()) {
|
if (!tempDir.isValid()) {
|
||||||
qDebug() << "Unable to create application temporary directory";
|
qDebug() << "Unable to create application temporary directory";
|
||||||
gAppTempPath = "";
|
gAppTempPath.clear();
|
||||||
} else {
|
} else {
|
||||||
gAppTempPath = tempDir.path();
|
gAppTempPath = tempDir.path();
|
||||||
|
|
||||||
if (!QDir(gAppTempPath).mkdir("IMAGES"))
|
if (!QDir(gAppTempPath).mkdir("IMAGES"))
|
||||||
qDebug() << "Unable to create images cache directory:" << Helpers::getImagesCacheDir();
|
qDebug() << "Unable to create images cache directory:" << Helpers::getImagesCacheDir();
|
||||||
|
else
|
||||||
|
qDebug() << "Created images cache directory:" << Helpers::getImagesCacheDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile & profile = g.currentProfile();
|
Profile & profile = g.currentProfile();
|
||||||
|
|||||||
+13
-11
@@ -368,20 +368,22 @@ int main(int argc, char *argv[])
|
|||||||
Firmware::setCurrentVariant(Firmware::getFirmwareForId(simOptions.firmwareId));
|
Firmware::setCurrentVariant(Firmware::getFirmwareForId(simOptions.firmwareId));
|
||||||
//qDebug() << "current firmware:" << getCurrentFirmware()->getId();
|
//qDebug() << "current firmware:" << getCurrentFirmware()->getId();
|
||||||
|
|
||||||
QString imgDir = Helpers::getImagesCacheDir();
|
QTemporaryDir tempDir(QDir::tempPath() % "/etx-cpn-XXXXXX");
|
||||||
QDir dir(imgDir);
|
|
||||||
|
|
||||||
if (dir.exists()) {
|
if (!tempDir.isValid()) {
|
||||||
if (!dir.removeRecursively())
|
qDebug() << "Unable to create application temporary directory";
|
||||||
qDebug() << "Unable to delete images cache directory" << imgDir;
|
gAppTempPath.clear();
|
||||||
else
|
return finish(1);
|
||||||
qDebug() << "Deleted images cache directory" << imgDir;
|
} else {
|
||||||
|
gAppTempPath = tempDir.path();
|
||||||
|
|
||||||
|
if (!QDir(gAppTempPath).mkdir("IMAGES")) {
|
||||||
|
qDebug() << "Unable to create images cache directory:" << Helpers::getImagesCacheDir();
|
||||||
|
return finish(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!QDir::temp().mkpath(imgDir))
|
qDebug() << "Created images cache directory:" << Helpers::getImagesCacheDir();
|
||||||
qDebug() << "Unable to create images cache directory" << imgDir;
|
|
||||||
else
|
|
||||||
qDebug() << "Created images cache directory" << imgDir;
|
|
||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
SimulatorMainWindow * mainWindow = new SimulatorMainWindow(nullptr, simOptions.simulatorId, (simOptions.flags ? simOptions.flags : SIMULATOR_FLAGS_STANDALONE));
|
SimulatorMainWindow * mainWindow = new SimulatorMainWindow(nullptr, simOptions.simulatorId, (simOptions.flags ? simOptions.flags : SIMULATOR_FLAGS_STANDALONE));
|
||||||
|
|||||||
Reference in New Issue
Block a user