diff --git a/ui/preference_utils.c b/ui/preference_utils.c index 3ce241dc9e..70684f5a55 100644 --- a/ui/preference_utils.c +++ b/ui/preference_utils.c @@ -154,13 +154,7 @@ prefs_store_ext_multiple(const char * module, GHashTable * pref_values) } gint -column_prefs_add_custom(gint fmt, const gchar *title, const gchar *custom_fields, gint custom_occurrence) -{ - return column_prefs_add_custom_with_position(fmt, title, custom_fields, custom_occurrence, -1); -} - -gint -column_prefs_add_custom_with_position(gint fmt, const gchar *title, const gchar *custom_fields, gint custom_occurrence, gint position) +column_prefs_add_custom(gint fmt, const gchar *title, const gchar *custom_fields, gint position) { GList *clp; fmt_data *cfmt, *last_cfmt; @@ -175,7 +169,7 @@ column_prefs_add_custom_with_position(gint fmt, const gchar *title, const gchar cfmt->title = g_strdup(title); cfmt->fmt = fmt; cfmt->custom_fields = g_strdup(custom_fields); - cfmt->custom_occurrence = custom_occurrence; + cfmt->custom_occurrence = 0; cfmt->resolved = TRUE; colnr = g_list_length(prefs.col_list); diff --git a/ui/preference_utils.h b/ui/preference_utils.h index 791eb55b1b..0b9eb656b8 100644 --- a/ui/preference_utils.h +++ b/ui/preference_utils.h @@ -63,29 +63,13 @@ extern gboolean prefs_store_ext_multiple(const char * module, GHashTable * pref_ * @param fmt column format * @param title column title * @param custom_field column custom field - * @param custom_occurrence custom occurrence + * @param position the intended position of the insert * * @return The index of the inserted column */ gint column_prefs_add_custom(gint fmt, const gchar *title, const gchar *custom_field, - gint custom_occurrence); - -/** Add a custom column at the given position - * - * @param fmt column format - * @param title column title - * @param custom_field column custom field - * @param custom_occurrence custom occurrence - * @param position the intended position of the insert - * - * @return The index of the inserted column - */ -gint -column_prefs_add_custom_with_position(gint fmt, const gchar *title, - const gchar *custom_fields, - gint custom_occurrence, - gint position); + gint position); /** Remove a column. * diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 909ce154e3..f82589624c 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -3776,7 +3776,7 @@ void MainWindow::insertColumn(QString name, QString abbrev, gint pos) gint colnr = 0; if ( name.length() > 0 && abbrev.length() > 0 ) { - colnr = column_prefs_add_custom_with_position(COL_CUSTOM, name.toStdString().c_str(), abbrev.toStdString().c_str(), 0, pos); + colnr = column_prefs_add_custom(COL_CUSTOM, name.toStdString().c_str(), abbrev.toStdString().c_str(), pos); packet_list_->columnsChanged(); packet_list_->resizeColumnToContents(colnr); prefs_main_write();