Skip to content

Commit 7e3abcb

Browse files
committed
Improve cloud projects list loading process
1 parent 920d6ae commit 7e3abcb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/core/management_layer/content/projects/projects_manager.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,21 @@ void ProjectsManager::addOrUpdateCloudProject(const Domain::ProjectInfo& _projec
11111111
} else {
11121112
const auto posterPath = d->projectPosterPath(projectPath);
11131113
QFile posterFile(posterPath);
1114-
if (posterFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
1114+
//
1115+
// Если постер не изменился
1116+
//
1117+
if (posterFile.exists() && posterFile.size() == _projectInfo.poster.size()) {
1118+
//
1119+
// ... ничего не делаем
1120+
//
1121+
}
1122+
//
1123+
// А если изменился
1124+
//
1125+
else if (posterFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
1126+
//
1127+
// ... то сохраним его в файл
1128+
//
11151129
posterFile.write(_projectInfo.poster);
11161130
posterFile.close();
11171131
}

0 commit comments

Comments
 (0)