Qt: Restore the filename in the status bar.
authorGerald Combs <gerald@zing.org>
Sun, 10 Jan 2016 20:24:35 +0000 (12:24 -0800)
committerGerald Combs <gerald@wireshark.org>
Sun, 10 Jan 2016 23:02:39 +0000 (23:02 +0000)
Change isNull checks to isEmpty. This keeps us from pushing an empty
field status and clobbering the file name in the status bar. Make sure
we do the same for other statuses.

Change-Id: I68ea669bdafc6e1177c1b8aaa07781464371de96
Reviewed-on: https://code.wireshark.org/review/13175
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
ui/qt/main_status_bar.cpp

index 71a27feed408733204ab6b860c16100f492e4378..a1ccba21105f0858816945699204e937e044dcc3 100644 (file)
@@ -294,7 +294,7 @@ void MainStatusBar::popFileStatus() {
 }
 
 void MainStatusBar::pushFieldStatus(const QString &message) {
-    if (message.isNull()) {
+    if (message.isEmpty()) {
         popFieldStatus();
     } else {
         info_status_.pushText(message, STATUS_CTX_FIELD);
@@ -307,7 +307,7 @@ void MainStatusBar::popFieldStatus() {
 
 void MainStatusBar::pushByteStatus(const QString &message)
 {
-    if (message.isNull()) {
+    if (message.isEmpty()) {
         popByteStatus();
     } else {
         info_status_.pushText(message, STATUS_CTX_BYTE);
@@ -320,7 +320,11 @@ void MainStatusBar::popByteStatus()
 }
 
 void MainStatusBar::pushFilterStatus(const QString &message) {
-    info_status_.pushText(message, STATUS_CTX_FILTER);
+    if (message.isEmpty()) {
+        popFilterStatus();
+    } else {
+        info_status_.pushText(message, STATUS_CTX_FILTER);
+    }
     expertUpdate();
 }
 
@@ -329,7 +333,11 @@ void MainStatusBar::popFilterStatus() {
 }
 
 void MainStatusBar::pushPacketStatus(const QString &message) {
-    packet_status_.pushText(message, STATUS_CTX_MAIN);
+    if (message.isEmpty()) {
+        popPacketStatus();
+    } else {
+        packet_status_.pushText(message, STATUS_CTX_MAIN);
+    }
 }
 
 void MainStatusBar::popPacketStatus() {