diff --git a/src/apps/aboutsystem/AboutSystem.cpp b/src/apps/aboutsystem/AboutSystem.cpp index c36f5a7da60..d2eb569faa5 100644 --- a/src/apps/aboutsystem/AboutSystem.cpp +++ b/src/apps/aboutsystem/AboutSystem.cpp @@ -677,9 +677,7 @@ AboutView::AboutView() } else buildTimeDate.SetTo(kernelTimeDate); - snprintf(string, sizeof(string), buildTimeDate); - - BStringView* kernelView = new BStringView("kerneltext", string); + BStringView* kernelView = new BStringView("kerneltext", buildTimeDate); kernelView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET)); diff --git a/src/apps/expander/ExpanderWindow.cpp b/src/apps/expander/ExpanderWindow.cpp index d667d5701d1..2b3a6e8b818 100644 --- a/src/apps/expander/ExpanderWindow.cpp +++ b/src/apps/expander/ExpanderWindow.cpp @@ -150,34 +150,32 @@ ExpanderWindow::ValidateDest() BVolume volume; if (!entry.Exists()) { BAlert* alert = new BAlert("destAlert", - B_TRANSLATE("Destination folder doesn't exist, create?"), - B_TRANSLATE("Yes"), B_TRANSLATE("No"), NULL, + B_TRANSLATE("Destination folder doesn't exist. " + "Would you like to create it?"), + B_TRANSLATE("Create"), B_TRANSLATE("Cancel"), NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT); alert->SetShortcut(0, B_ESCAPE); - if (alert->Go() == 0) { - if (create_directory(fDestText->Text(), 0755) == B_OK) { - BEntry newEntry(fDestText->Text(), true); - newEntry.GetRef(&fDestRef); - return true; - } else { - BAlert* alert = new BAlert("stopAlert", - B_TRANSLATE("Failed to create the destination folder."), - B_TRANSLATE("Cancel"), NULL, NULL, - B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT); - alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); - alert->Go(); - return false; - } - } else { + + if (alert->Go() != 0) + return false; + + if (create_directory(fDestText->Text(), 0755) != B_OK) { BAlert* alert = new BAlert("stopAlert", - B_TRANSLATE("The extraction operation aborted."), + B_TRANSLATE("Failed to create the destination folder."), B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); alert->Go(); return false; } - } else if (!entry.IsDirectory()) { + + BEntry newEntry(fDestText->Text(), true); + newEntry.GetRef(&fDestRef); + return true; + + } + + if (!entry.IsDirectory()) { BAlert* alert = new BAlert("destAlert", B_TRANSLATE("The destination is not a folder."), B_TRANSLATE("Cancel"), NULL, NULL, @@ -185,7 +183,9 @@ ExpanderWindow::ValidateDest() alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); alert->Go(); return false; - } else if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) { + } + + if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) { BAlert* alert = new BAlert("destAlert", B_TRANSLATE("The destination is read only."), B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL, @@ -193,10 +193,10 @@ ExpanderWindow::ValidateDest() alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); alert->Go(); return false; - } else { - entry.GetRef(&fDestRef); - return true; } + + entry.GetRef(&fDestRef); + return true; }