Skip to content

Commit

Permalink
clean up strange if-else structure
Browse files Browse the repository at this point in the history
  • Loading branch information
pvuorela committed Jan 17, 2018
1 parent a8b343a commit 662184a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/transferengine.cpp
Expand Up @@ -363,8 +363,7 @@ void TransferEnginePrivate::sendNotification(TransferEngineData::TransferType ty
qWarning() << "TransferEnginePrivate::sendNotification: unknown state";
break;
}
} else {
if (status == TransferEngineData::TransferInterrupted) {
} else if (status == TransferEngineData::TransferInterrupted) {
category = TRANSFER_ERROR_EVENT_CATEGORY;

switch (type) {
Expand All @@ -391,15 +390,14 @@ void TransferEnginePrivate::sendNotification(TransferEngineData::TransferType ty
summary = fileName;
previewSummary = summary;
previewBody = body;
} else {
if (status == TransferEngineData::TransferCanceled) {
} else if (status == TransferEngineData::TransferCanceled) {
// Exit, no banners or events when user has canceled a transfer

// Remove any existing notification
if (existing) {
existing->close();
}
}}}
}

if (!category.isEmpty()) {
Notification notification;
Expand Down

0 comments on commit 662184a

Please sign in to comment.