|
|
|
@ -46,21 +46,6 @@ QList<ModelInfo> Download::modelList() const
|
|
|
|
|
|
|
|
|
|
QString Download::downloadLocalModelsPath() const
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
QString exePath = QCoreApplication::applicationDirPath() + QDir::separator();
|
|
|
|
|
QString testWritePath = exePath + QString("test_write.txt");
|
|
|
|
|
QString canonicalExePath = QFileInfo(exePath).canonicalFilePath() + QDir::separator();
|
|
|
|
|
if (QFileInfo::exists(testWritePath))
|
|
|
|
|
return canonicalExePath;
|
|
|
|
|
|
|
|
|
|
QFile testWriteFile(testWritePath);
|
|
|
|
|
if (testWriteFile.open(QIODeviceBase::ReadWrite)) {
|
|
|
|
|
testWriteFile.close();
|
|
|
|
|
return canonicalExePath;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
QString localPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
|
|
|
|
|
+ QDir::separator();
|
|
|
|
|
QString testWritePath = localPath + QString("test_write.txt");
|
|
|
|
@ -84,7 +69,6 @@ QString Download::downloadLocalModelsPath() const
|
|
|
|
|
|
|
|
|
|
qWarning() << "ERROR: Local download path appears not writeable:" << canonicalLocalPath;
|
|
|
|
|
return canonicalLocalPath;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Download::updateModelList()
|
|
|
|
|