From 6a07ccbad273cdcbea3f984c5c2e9d1b272aae05 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 7 Jan 2018 15:42:28 +0100 Subject: Use helper function empty_string() instead of manual checks For code consistency, substitute boolean expressions: s && *s -> !empty_string(s) s && s[0] -> !empty_string(s) !s || !*s -> empty_string(s) !s || !s[0] -> empty_string(s) Signed-off-by: Berthold Stoeger --- desktop-widgets/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 93df3aea9..5cf3dc27f 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -102,7 +102,7 @@ extern "C" void showErrorFromC() void MainWindow::showErrors() { const char *error = get_error_string(); - if (error && error[0]) + if (!empty_string(error)) getNotificationWidget()->showNotification(error, KMessageWidget::Error); } @@ -1766,7 +1766,7 @@ void MainWindow::setAutomaticTitle() void MainWindow::setTitle() { - if (!existing_filename || !existing_filename[0]) { + if (empty_string(existing_filename)) { setWindowTitle("Subsurface"); return; } -- cgit v1.2.3-70-g09d2