mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cloud storage: try to work around weird Windows rename issue
In some cases the rename of the cache directory would fail in my testing. Based on code that Lubomir provided, this tries a Windows specific implementation of folder rename if the QDir based one fails for some reason - but obviously only if we are running on Windows. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b1dca1176f
commit
8e76456149
3 changed files with 51 additions and 1 deletions
|
@ -644,7 +644,12 @@ extern "C" char *move_away(const char *old_path)
|
|||
if (!oldDir.rename(old_path, newPath)) {
|
||||
if (verbose)
|
||||
qDebug() << "rename of" << old_path << "to" << newPath << "failed";
|
||||
return strdup("");
|
||||
// this next one we only try on Windows... if we are on a different platform
|
||||
// we simply give up and return an empty string
|
||||
#ifdef WIN32
|
||||
if (subsurface_dir_rename(old_path, qPrintable(newPath)) == 0)
|
||||
#endif
|
||||
return strdup("");
|
||||
}
|
||||
return strdup(qPrintable(newPath));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue