diff --git a/src/app/utilsadapter.cpp b/src/app/utilsadapter.cpp index 386a09d80db893c6860d6488c3217a102dd8d58e..5926ae00cc23e78159fd707b7155ab3d3fb040d8 100644 --- a/src/app/utilsadapter.cpp +++ b/src/app/utilsadapter.cpp @@ -154,9 +154,18 @@ UtilsAdapter::getLocalDataPath() const QString UtilsAdapter::getCachePath() { - QDir dataDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)); - dataDir.cdUp(); - return dataDir.absolutePath() + "/jami"; + const auto cacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); + + // Remove old mistaken cache dir. + // NOTE: this can be removed once we give a chance for users to upgrade. + QDir oldCacheDir(cacheDir); + oldCacheDir.cdUp(); + oldCacheDir.setPath(oldCacheDir.absolutePath() + "/jami"); + if (oldCacheDir.exists()) { + oldCacheDir.removeRecursively(); + } + + return cacheDir; } QString