aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-07-16 09:14:07 -0700
committerGerald Combs <gerald@wireshark.org>2015-07-16 16:17:33 +0000
commit6d33c124d55c1fdbe8225e82256b77e8f0a13e3c (patch)
treea9d579439c752f04154b1394b948c72e4d3938c0 /ui
parent78bc3dd93a562ca1b1c5dbc8f71d2967008be7ed (diff)
Add display_is_remote.
Add a display_is_remote function and use it instead of get_conn_cfilter to check for remoteness. Change-Id: Ia93d113afec36ede55daf7dc8394b2dc0d8c9abf Reviewed-on: https://code.wireshark.org/review/9659 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/accordion_frame.cpp4
-rw-r--r--ui/qt/splash_overlay.cpp2
-rw-r--r--ui/util.c11
-rw-r--r--ui/util.h5
4 files changed, 19 insertions, 3 deletions
diff --git a/ui/qt/accordion_frame.cpp b/ui/qt/accordion_frame.cpp
index ff8a6a47dd..d7a587711e 100644
--- a/ui/qt/accordion_frame.cpp
+++ b/ui/qt/accordion_frame.cpp
@@ -60,7 +60,7 @@ void AccordionFrame::animatedShow()
return;
}
- if (strlen (get_conn_cfilter()) < 1) {
+ if (!display_is_remote()) {
QWidget *parent = parentWidget();
if (parent && parent->layout()) {
@@ -89,7 +89,7 @@ void AccordionFrame::animatedHide()
return;
}
- if (strlen (get_conn_cfilter()) < 1) {
+ if (!display_is_remote()) {
animation_->setStartValue(frame_height_);
animation_->setEndValue(0);
animation_->start();
diff --git a/ui/qt/splash_overlay.cpp b/ui/qt/splash_overlay.cpp
index 18242ed0ad..4241e869ab 100644
--- a/ui/qt/splash_overlay.cpp
+++ b/ui/qt/splash_overlay.cpp
@@ -83,7 +83,7 @@ SplashOverlay::SplashOverlay(QWidget *parent) :
#ifndef THROTTLE_STARTUP
// Check for a remote connection
- if (strlen (get_conn_cfilter()) > 0)
+ if (display_is_remote())
info_update_freq_ = 1000;
#endif
diff --git a/ui/util.c b/ui/util.c
index 75dd273f72..29a6811321 100644
--- a/ui/util.c
+++ b/ui/util.c
@@ -336,6 +336,17 @@ const gchar *get_conn_cfilter(void) {
return filter_str->str;
}
+gboolean display_is_remote(void)
+{
+ static gboolean remote_display_checked;
+ static gboolean is_remote;
+
+ if (!remote_display_checked) {
+ is_remote = (strlen(get_conn_cfilter()) > 0);
+ }
+ return is_remote;
+}
+
/*
* Editor modelines
*
diff --git a/ui/util.h b/ui/util.h
index 5e88428907..22898fd0af 100644
--- a/ui/util.h
+++ b/ui/util.h
@@ -50,6 +50,11 @@ void compute_timestamp_diff(gint *diffsec, gint *diffusec,
*/
const char *get_conn_cfilter(void);
+/** Check if we're running on a remote connection.
+ * @return TRUE if we're running remotely, FALSE if local.
+ */
+gboolean display_is_remote(void);
+
/** Set the latest opened directory.
* Will already be done when using file_selection_new().
*