mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 05:25:50 +03:00
SocketAPI: Code simplifications as asked for in the review.
This commit is contained in:
parent
361ebf5464
commit
7acdf50a2c
2 changed files with 2 additions and 12 deletions
|
@ -293,16 +293,8 @@ void SocketApi::command_RETRIEVE_FILE_STATUS(const QString& argument, QIODevice*
|
|||
const QString file = QDir::cleanPath(argument).mid(syncFolder->cleanPath().length()+1);
|
||||
|
||||
// future: Send more specific states for paused, disconnected etc.
|
||||
if( syncFolder->syncPaused() ){
|
||||
if( syncFolder->syncPaused() || !syncFolder->accountState()->isConnected() ) {
|
||||
statusString = nopString;
|
||||
} else if( !syncFolder->accountState()->isConnected() ) {
|
||||
if( file.isEmpty() || file == QLatin1String("/") ) {
|
||||
// only the root folder
|
||||
statusString = nopString;
|
||||
} else {
|
||||
// all other files and dirs in unconnected sync
|
||||
statusString = nopString;
|
||||
}
|
||||
} else {
|
||||
SyncFileStatus fileStatus = syncFolder->syncEngine().syncFileStatusTracker().fileStatus(file);
|
||||
|
||||
|
|
|
@ -102,13 +102,11 @@ SyncFileStatus SyncFileStatusTracker::rootStatus()
|
|||
status = SyncFileStatus::StatusSync;
|
||||
} else {
|
||||
// sync is not running. Check dirty list and _syncProblems
|
||||
int errs = 0, warns = 0;
|
||||
int errs = 0;
|
||||
for (auto it = _syncProblems.begin(); it != _syncProblems.end(); ++it) {
|
||||
if( it->second == SyncFileStatus::StatusError ) {
|
||||
errs ++;
|
||||
break; // stop if an error found at all.
|
||||
} if( it->second == SyncFileStatus::StatusWarning ) {
|
||||
warns ++;
|
||||
}
|
||||
}
|
||||
if( errs ) {
|
||||
|
|
Loading…
Reference in a new issue