Skip to content

Commit 3a5c61a

Browse files
qarkaicaclark
authored andcommitted
Simplify log_window_line_wrap_cb()
1 parent 7e0baea commit 3a5c61a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/logwindow.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,9 @@ static void log_window_pause_cb(GtkWidget *, gpointer)
141141

142142
static void log_window_line_wrap_cb(GtkWidget *, gpointer data)
143143
{
144-
auto logwin = static_cast<LogWindow *>(data);
145-
146144
options->log_window.line_wrap = !options->log_window.line_wrap;
147145

148-
text_view_set_line_wrap(GTK_TEXT_VIEW(logwin->text), options->log_window.line_wrap);
146+
text_view_set_line_wrap(GTK_TEXT_VIEW(data), options->log_window.line_wrap);
149147
}
150148

151149
static void log_window_timer_data_cb(GtkWidget *, gpointer)
@@ -393,7 +391,7 @@ static LogWindow *log_window_create(LayoutWindow *lw)
393391
GtkWidget *wrap = gtk_toggle_button_new_with_label("Wrap");
394392
gtk_widget_set_tooltip_text(wrap, _("Enable line wrap"));
395393
gq_gtk_box_pack_start(GTK_BOX(hbox), wrap, FALSE, FALSE, 0);
396-
g_signal_connect(wrap, "toggled", G_CALLBACK(log_window_line_wrap_cb), logwin);
394+
g_signal_connect(wrap, "toggled", G_CALLBACK(log_window_line_wrap_cb), text);
397395
gq_gtk_widget_show_all(wrap);
398396

399397
GtkWidget *timer_data = gtk_toggle_button_new_with_label(_("Timer"));

0 commit comments

Comments
 (0)