diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-12-31 20:14:08 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-01-01 04:15:29 +0000 |
commit | ee9f102aa9ec36b28992512d840f971be4eba571 (patch) | |
tree | 8251e2c26ba9f6c3680633a03901dd386c3d349d /ui/qt/coloring_rules_dialog.cpp | |
parent | 93f9416c3660b87896e8b59a4d952fb851002bb5 (diff) |
No need for toolkit-dependent color initialization.
We're not allocating colors ourselves in GTK+ (and haven't been doing so
since at least 1.12), and all color_t values are valid colors, so
we don't need any toolkit-specific processing to fill in a color_t.
While we're at it, catch read errors when reading color filter files.
Change-Id: Ieb520d141cf15e371a31a01459d466c95ba2209b
Reviewed-on: https://code.wireshark.org/review/12985
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/qt/coloring_rules_dialog.cpp')
-rw-r--r-- | ui/qt/coloring_rules_dialog.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/ui/qt/coloring_rules_dialog.cpp b/ui/qt/coloring_rules_dialog.cpp index 264cda04d8..5ba48a91a6 100644 --- a/ui/qt/coloring_rules_dialog.cpp +++ b/ui/qt/coloring_rules_dialog.cpp @@ -324,7 +324,7 @@ void ColoringRulesDialog::on_buttonBox_clicked(QAbstractButton *button) QString file_name = QFileDialog::getOpenFileName(this, wsApp->windowTitleString(tr("Import Coloring Rules")), wsApp->lastOpenDir().path()); gchar* err_msg = NULL; - if (!color_filters_import(file_name.toUtf8().constData(), this, &err_msg, initialize_color, color_filter_add_cb)) { + if (!color_filters_import(file_name.toUtf8().constData(), this, &err_msg, color_filter_add_cb)) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg); g_free(err_msg); } @@ -436,27 +436,6 @@ void ColoringRulesTreeDelegate::ruleNameChanged(const QString name) } -/* - * Initialize a color with R, G, and B values, including any toolkit-dependent - * work that needs to be done. - */ -gboolean -initialize_color(color_t *color, guint16 red, guint16 green, guint16 blue) -{ - QColor qc; - - // color_t uses 16-bit components to match Gtk+. Qt use 8. - qc.setRgb(red>>8, green>>8, blue>>8); - if (!qc.isValid()) - return FALSE; - - // Match what color_filters.c does. - color->red = red; - color->green = green; - color->blue = blue; - return TRUE; -} - // Callback for color_filters_clone. void color_filter_add_cb(color_filter_t *colorf, gpointer user_data) |