aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-gtk
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface-gtk')
-rw-r--r--src/interface-gtk/gtk-info-popup.c4
-rw-r--r--src/interface-gtk/gtk-label.c4
-rw-r--r--src/interface-gtk/gtk-label.h2
-rw-r--r--src/interface-gtk/interface.c7
4 files changed, 9 insertions, 8 deletions
diff --git a/src/interface-gtk/gtk-info-popup.c b/src/interface-gtk/gtk-info-popup.c
index 3ddd10a..20ede5b 100644
--- a/src/interface-gtk/gtk-info-popup.c
+++ b/src/interface-gtk/gtk-info-popup.c
@@ -110,10 +110,10 @@ teco_gtk_info_popup_activated_cb(GtkFlowBox *box, GtkFlowBoxChild *child, gpoint
GList *entry;
for (entry = child_list; entry != NULL && !TECO_IS_GTK_LABEL(entry->data); entry = g_list_next(entry));
g_assert(entry != NULL);
- const teco_string_t *str = teco_gtk_label_get_text(TECO_GTK_LABEL(entry->data));
+ teco_string_t str = teco_gtk_label_get_text(TECO_GTK_LABEL(entry->data));
g_signal_emit(popup, teco_gtk_info_popup_clicked_signal, 0,
- str->data, (gulong)str->len);
+ str.data, (gulong)str.len);
}
static void
diff --git a/src/interface-gtk/gtk-label.c b/src/interface-gtk/gtk-label.c
index e148652..3ac51a9 100644
--- a/src/interface-gtk/gtk-label.c
+++ b/src/interface-gtk/gtk-label.c
@@ -274,10 +274,10 @@ teco_gtk_label_set_text(TecoGtkLabel *self, const gchar *str, gssize len)
gtk_label_set_text(GTK_LABEL(self), plaintext);
}
-const teco_string_t *
+teco_string_t
teco_gtk_label_get_text(TecoGtkLabel *self)
{
- return &self->string;
+ return self->string;
}
/**
diff --git a/src/interface-gtk/gtk-label.h b/src/interface-gtk/gtk-label.h
index 3cd4cb9..86d71d8 100644
--- a/src/interface-gtk/gtk-label.h
+++ b/src/interface-gtk/gtk-label.h
@@ -27,7 +27,7 @@ G_DECLARE_FINAL_TYPE(TecoGtkLabel, teco_gtk_label, TECO, GTK_LABEL, GtkLabel)
GtkWidget *teco_gtk_label_new(const gchar *str, gssize len);
void teco_gtk_label_set_text(TecoGtkLabel *self, const gchar *str, gssize len);
-const teco_string_t *teco_gtk_label_get_text(TecoGtkLabel *self);
+teco_string_t teco_gtk_label_get_text(TecoGtkLabel *self);
void teco_gtk_label_parse_string(const gchar *str, gssize len,
PangoColor *fg, guint16 fg_alpha,
diff --git a/src/interface-gtk/interface.c b/src/interface-gtk/interface.c
index 2b292a3..a86e3fd 100644
--- a/src/interface-gtk/interface.c
+++ b/src/interface-gtk/interface.c
@@ -1134,7 +1134,7 @@ teco_interface_event_loop(GError **error)
if (!scitecoconfig_reg->vtable->get_string(scitecoconfig_reg,
&scitecoconfig.data, &scitecoconfig.len, NULL, error))
return FALSE;
- if (teco_string_contains(&scitecoconfig, '\0')) {
+ if (teco_string_contains(scitecoconfig, '\0')) {
g_set_error_literal(error, TECO_ERROR, TECO_ERROR_FAILED,
"Null-character not allowed in filenames");
return FALSE;
@@ -1478,7 +1478,8 @@ teco_interface_popup_clicked_cb(GtkWidget *popup, gchar *str, gulong len, gpoint
{
g_assert(len >= teco_interface.popup_prefix_len);
/* str is an empty string for the "(Unnamed)" buffer */
- const teco_string_t insert = {str+teco_interface.popup_prefix_len, len-teco_interface.popup_prefix_len};
+ const teco_string_t insert = {str+teco_interface.popup_prefix_len,
+ len-teco_interface.popup_prefix_len};
teco_machine_t *machine = &teco_cmdline.machine.parent;
const teco_view_t *last_view = teco_interface_current_view;
@@ -1488,7 +1489,7 @@ teco_interface_popup_clicked_cb(GtkWidget *popup, gchar *str, gulong len, gpoint
* A auto completion should never result in program termination.
*/
if (machine->current->insert_completion_cb &&
- !machine->current->insert_completion_cb(machine, &insert, NULL))
+ !machine->current->insert_completion_cb(machine, insert, NULL))
return;
teco_interface_popup_clear();
teco_cmdline_update();