Skip to content

Commit

Permalink
LaunchBox: remove redundant Locking. Thanks Stippi!
Browse files Browse the repository at this point in the history
  • Loading branch information
stpere committed Dec 14, 2012
1 parent bafbb92 commit 8a24526
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/apps/launchbox/MainWindow.cpp
Expand Up @@ -91,20 +91,18 @@ MainWindow::QuitRequested()
padWindowCount++;
}
bool canClose = true;
if (Lock()) {
if (padWindowCount == 1) {
be_app->PostMessage(B_QUIT_REQUESTED);

if (padWindowCount == 1) {
be_app->PostMessage(B_QUIT_REQUESTED);
canClose = false;
} else {
BAlert* alert = new BAlert(B_TRANSLATE("last chance"),
B_TRANSLATE("Really close this pad?\n"
"(The pad will not be remembered.)"),
B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL);
alert->SetShortcut(1, B_ESCAPE);
if (alert->Go() == 1)
canClose = false;
} else {
BAlert* alert = new BAlert(B_TRANSLATE("last chance"),
B_TRANSLATE("Really close this pad?\n"
"(The pad will not be remembered.)"),
B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL);
alert->SetShortcut(1, B_ESCAPE);
if (alert->Go() == 1)
canClose = false;
}
Unlock();
}
return canClose;
}
Expand Down

0 comments on commit 8a24526

Please sign in to comment.