Skip to content

Commit

Permalink
Set dir list job cancellation error to mild
Browse files Browse the repository at this point in the history
Fixes lxqt/pcmanfm-qt#789

A directory list job may be legally cancelled at `Folder::reload()`, in which case, pcmanfm-qt shouldn't show an error message (pcmanfm-qt only shows errors with severities greater than `ErrorSeverity::MILD`).
  • Loading branch information
tsujan authored and agaida committed Oct 3, 2018
1 parent 202b20f commit 670d806
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/dirlistjob.cpp
Expand Up @@ -127,7 +127,9 @@ void DirListJob::exec() {
g_file_enumerator_close(enu.get(), cancellable().get(), &err);
}
else {
emitError(err, ErrorSeverity::CRITICAL);
emitError(err, err.domain() == G_IO_ERROR && err.code() == G_IO_ERROR_CANCELLED
? ErrorSeverity::MILD // may happen at Folder::reload()
: ErrorSeverity::CRITICAL);
}

// qDebug() << "END LISTING:" << dir_path.toString().get();
Expand Down

0 comments on commit 670d806

Please sign in to comment.