Commit 93a58836 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Check whether the folder still exists before creating the temp dir

If the tempdir isn't valid, then it's pretty likely it used to be
on a disk that's no longer mounted, which we should handle by going
back to the default.

BUG:408246
parent 4e564297
......@@ -28,10 +28,11 @@ struct KRITAUI_NO_EXPORT KisFrameDataSerializer::Private
{
Private(const QString &frameCachePath)
: framesDir(
(!frameCachePath.isEmpty() ? frameCachePath : QDir::tempPath()) +
QDir::separator() + "KritaFrameCacheXXXXXX")
(!frameCachePath.isEmpty() && QTemporaryDir(frameCachePath + "/KritaFrameCacheXXXXXX").isValid()
? frameCachePath
: QDir::tempPath())
+ "/KritaFrameCacheXXXXXX")
{
KIS_SAFE_ASSERT_RECOVER_NOOP(framesDir.isValid());
framesDirObject = QDir(framesDir.path());
framesDirObject.makeAbsolute();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment