aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-27 14:33:07 (GMT)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-28 11:23:09 (GMT)
commit583f64f0a6e1cbcb8551f01cd6305f5b138d9c4d (patch)
tree5429f796092bd6dd5093eb75c5dabbfdf1fbc4c5
parent8175aff6177e6ac69fe6bcf6d1cea4922bde8f7d (diff)
Use g_foo() variants instead of gtk_foo()
Several functions were deprecated, as GLib defines an equivalent one, and got removed on Gtk 3. So, use the GLib version. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--src/callbacks.c10
-rw-r--r--src/camorama-window.c4
-rw-r--r--src/main.c4
3 files changed, 9 insertions, 9 deletions
diff --git a/src/callbacks.c b/src/callbacks.c
index 0719573..ccbb31a 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -163,7 +163,7 @@ void acap_func (GtkWidget * rb, cam * cam)
if (cam->acap == TRUE) {
cam->timeout_id =
- gtk_timeout_add (cam->timeout_interval,
+ g_timeout_add (cam->timeout_interval,
(GSourceFunc) timeout_capture_func, cam);
if (cam->debug == TRUE) {
printf ("add autocap - %d - timeout_interval = \n",
@@ -174,7 +174,7 @@ void acap_func (GtkWidget * rb, cam * cam)
printf ("remove autocap - %d - timeout_interval = \n",
cam->timeout_id, cam->timeout_interval);
}
- gtk_timeout_remove (cam->timeout_id);
+ g_source_remove (cam->timeout_id);
}
update_tooltip (cam);
set_sensitive (cam);
@@ -194,9 +194,9 @@ void interval_change (GtkWidget * sb, cam * cam)
("interval_change; old timeout_id = %d old interval = %d\n",
cam->timeout_id, cam->timeout_interval);
}
- gtk_timeout_remove (cam->timeout_id);
+ g_source_remove (cam->timeout_id);
cam->timeout_id =
- gtk_timeout_add (cam->timeout_interval,
+ g_timeout_add (cam->timeout_interval,
(GSourceFunc) timeout_capture_func, cam);
if (cam->debug == TRUE) {
printf ("new timeout_id = %d, new interval = %d\n",
@@ -834,6 +834,6 @@ void update_tooltip (cam * cam)
}
tooltip_text = g_strdup_printf (_("Automatic Capture Disabled"));
}
- gtk_status_icon_set_tooltip(cam->tray_icon, tooltip_text);
+ gtk_status_icon_set_tooltip_text(cam->tray_icon, tooltip_text);
g_free (tooltip_text);
}
diff --git a/src/camorama-window.c b/src/camorama-window.c
index b485d35..22f8e12 100644
--- a/src/camorama-window.c
+++ b/src/camorama-window.c
@@ -167,12 +167,12 @@ tray_clicked_callback (GtkStatusIcon* status, guint button, guint activate_time,
if (gtk_widget_get_visible
(GTK_WIDGET(gtk_builder_get_object(cam->xml, "main_window")))) {
cam->hidden = TRUE;
- gtk_idle_remove (cam->idle_id);
+ g_source_remove (cam->idle_id);
gtk_widget_hide (GTK_WIDGET(gtk_builder_get_object
(cam->xml, "main_window")));
} else {
cam->idle_id =
- gtk_idle_add ((GSourceFunc) pt2Function, (gpointer) cam);
+ g_idle_add ((GSourceFunc) pt2Function, (gpointer) cam);
gtk_widget_show (GTK_WIDGET(gtk_builder_get_object
(cam->xml, "main_window")));
cam->hidden = FALSE;
diff --git a/src/main.c b/src/main.c
index cfe28c2..d7d5cd3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -225,9 +225,9 @@ main(int argc, char *argv[]) {
GtkWidget *widget = GTK_WIDGET (gtk_builder_get_object (cam->xml, "da"));
gtk_widget_show (widget);
- cam->idle_id = gtk_idle_add ((GSourceFunc) pt2Function, (gpointer) cam);
+ cam->idle_id = g_idle_add ((GSourceFunc) pt2Function, (gpointer) cam);
- gtk_timeout_add (2000, (GSourceFunc) fps, cam->status);
+ g_timeout_add (2000, (GSourceFunc) fps, cam->status);
if (cam->debug == TRUE)
print_cam(cam);

Privacy Policy