mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:44:21 +02:00
fix upload leak, return error for failed load
This commit is contained in:
parent
46990184d6
commit
549c514400
3 changed files with 13 additions and 1 deletions
|
@ -131,6 +131,9 @@ void AssetUploadDialogFactory::handleUploadFinished(AssetUpload* upload, const Q
|
|||
case AssetUpload::TooLarge:
|
||||
additionalError = "The uploaded content was too large and could not be stored in the asset-server.";
|
||||
break;
|
||||
case AssetUpload::ErrorLoadingFile:
|
||||
additionalError = "The file could not be opened. Please check your permissions and try again.";
|
||||
break;
|
||||
default:
|
||||
// not handled, do not show a message box
|
||||
return;
|
||||
|
@ -139,6 +142,8 @@ void AssetUploadDialogFactory::handleUploadFinished(AssetUpload* upload, const Q
|
|||
// display a message box with the error
|
||||
showErrorDialog(QFileInfo(upload->getFilename()).fileName(), additionalError);
|
||||
}
|
||||
|
||||
upload->deleteLater();
|
||||
}
|
||||
|
||||
void AssetUploadDialogFactory::showErrorDialog(const QString& filename, const QString& additionalError) {
|
||||
|
|
|
@ -57,5 +57,11 @@ void AssetUpload::start() {
|
|||
emit finished(this, hash);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// we couldn't open the file - set the error result
|
||||
_result = ErrorLoadingFile;
|
||||
|
||||
// emit that we are done
|
||||
emit finished(this, QString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,8 @@ public:
|
|||
Success = 0,
|
||||
Timeout,
|
||||
TooLarge,
|
||||
PermissionDenied
|
||||
PermissionDenied,
|
||||
ErrorLoadingFile
|
||||
};
|
||||
|
||||
AssetUpload(QObject* parent, const QString& filename);
|
||||
|
|
Loading…
Reference in a new issue