aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-18 01:06:01 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-19 00:02:13 -0300
commitf835fb0566fecd0336159cae9f04425745613870 (patch)
treedb941fe523f92aa85ee5238ed6b4eb72d9a2edb7 /src
parent0af3fee360089b2f5c160896f33850c79e493a93 (diff)
Use GSettings instead of Gconf-2
While it works fine, Gconf was deprecated in favor of Gsettings. Replace its usage inside camorama. Please notice that the changed notifications for the values are not used here. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in6
-rw-r--r--src/callbacks.c88
-rw-r--r--src/callbacks.h7
-rw-r--r--src/fileio.c8
-rw-r--r--src/interface.h51
-rw-r--r--src/main.c94
-rw-r--r--src/v4l.h3
7 files changed, 98 insertions, 159 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index 79b5482..7e93ed8 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -191,13 +191,12 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-GCONFTOOL = @GCONFTOOL@
-GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@
-GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
+GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -267,6 +266,7 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
diff --git a/src/callbacks.c b/src/callbacks.c
index 7966014..be7a4ac 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -36,14 +36,14 @@ extern const gchar *const protos[];
void ts_func(GtkWidget *rb, cam_t *cam)
{
cam->timestamp = gtk_toggle_button_get_active((GtkToggleButton *) rb);
- gconf_client_set_bool(cam->gc, GCONF_TIMESTAMP, cam->timestamp, NULL);
+ g_settings_set_boolean(cam->gc, CAM_SETTINGS_TIMESTAMP, cam->timestamp);
}
void customstring_func(GtkWidget *rb, cam_t *cam)
{
cam->usestring = gtk_toggle_button_get_active((GtkToggleButton *) rb);
- gconf_client_set_bool(cam->gc, GCONF_USE_CUSTOM_STRING,
- cam->usestring, NULL);
+ g_settings_set_boolean(cam->gc, CAM_SETTINGS_USE_CUSTOM_STRING,
+ cam->usestring);
gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(cam->xml, "string_entry")),
cam->usestring);
}
@@ -51,40 +51,40 @@ void customstring_func(GtkWidget *rb, cam_t *cam)
void drawdate_func(GtkWidget *rb, cam_t *cam)
{
cam->usedate = gtk_toggle_button_get_active((GtkToggleButton *) rb);
- gconf_client_set_bool(cam->gc, GCONF_DRAWDATE, cam->usedate, NULL);
+ g_settings_set_boolean(cam->gc, CAM_SETTINGS_DRAWDATE, cam->usedate);
}
void append_func(GtkWidget *rb, cam_t *cam)
{
cam->timefn = gtk_toggle_button_get_active((GtkToggleButton *) rb);
- gconf_client_set_bool(cam->gc, GCONF_LOCAL_APPEND_TS, cam->timefn, NULL);
+ g_settings_set_boolean(cam->gc, CAM_SETTINGS_LOCAL_APPEND_TS, cam->timefn);
}
void rappend_func(GtkWidget *rb, cam_t *cam)
{
cam->rtimefn = gtk_toggle_button_get_active((GtkToggleButton *) rb);
- gconf_client_set_bool(cam->gc, GCONF_REMOTE_APPEND_TS, cam->rtimefn, NULL);
+ g_settings_set_boolean(cam->gc, CAM_SETTINGS_REMOTE_APPEND_TS, cam->rtimefn);
}
void jpg_func(GtkWidget *rb, cam_t *cam)
{
cam->savetype = JPEG;
- gconf_client_set_int(cam->gc, GCONF_FILE_TYPE, cam->savetype, NULL);
+ g_settings_set_int(cam->gc, CAM_SETTINGS_FILE_TYPE, cam->savetype);
}
void png_func(GtkWidget *rb, cam_t *cam)
{
cam->savetype = PNG;
- gconf_client_set_int(cam->gc, GCONF_FILE_TYPE, cam->savetype, NULL);
+ g_settings_set_int(cam->gc, CAM_SETTINGS_FILE_TYPE, cam->savetype);
}
void ppm_func(GtkWidget *rb, cam_t *cam)
{
cam->savetype = PPM;
- gconf_client_set_int(cam->gc, GCONF_FILE_TYPE, cam->savetype, NULL);
+ g_settings_set_int(cam->gc, CAM_SETTINGS_FILE_TYPE, cam->savetype);
}
void set_sensitive(cam_t *cam)
@@ -118,7 +118,7 @@ void cap_func(GtkWidget *rb, cam_t *cam)
{
cam->cap = gtk_toggle_button_get_active((GtkToggleButton *) rb);
- gconf_client_set_bool(cam->gc, GCONF_LOCAL_CAPTURE, cam->cap, NULL);
+ g_settings_set_boolean(cam->gc, CAM_SETTINGS_LOCAL_CAPTURE, cam->cap);
set_sensitive(cam);
}
@@ -126,7 +126,7 @@ void rcap_func(GtkWidget *rb, cam_t *cam)
{
cam->rcap = gtk_toggle_button_get_active((GtkToggleButton *) rb);
- gconf_client_set_bool(cam->gc, GCONF_REMOTE_CAPTURE, cam->rcap, NULL);
+ g_settings_set_boolean(cam->gc, CAM_SETTINGS_REMOTE_CAPTURE, cam->rcap);
set_sensitive(cam);
}
@@ -135,7 +135,7 @@ void acap_func(GtkWidget *rb, cam_t *cam)
{
cam->acap = gtk_toggle_button_get_active((GtkToggleButton *) rb);
- gconf_client_set_bool(cam->gc, GCONF_AUTO_CAPTURE, cam->acap, NULL);
+ g_settings_set_boolean(cam->gc, CAM_SETTINGS_AUTO_CAPTURE, cam->acap);
if (cam->acap == TRUE) {
cam->timeout_id = g_timeout_add(cam->timeout_interval,
@@ -157,8 +157,8 @@ void acap_func(GtkWidget *rb, cam_t *cam)
void interval_change(GtkWidget *sb, cam_t *cam)
{
cam->timeout_interval = gtk_spin_button_get_value((GtkSpinButton *) sb) * 60000;
- gconf_client_set_int(cam->gc, GCONF_AUTO_CAPTURE_INTERVAL,
- cam->timeout_interval, NULL);
+ g_settings_set_int(cam->gc, CAM_SETTINGS_AUTO_CAPTURE_INTERVAL,
+ cam->timeout_interval);
if (cam->acap == TRUE) {
if (cam->debug == TRUE) {
printf("interval_change; old timeout_id = %d old interval = %d\n",
@@ -177,57 +177,27 @@ void interval_change(GtkWidget *sb, cam_t *cam)
void rjpg_func(GtkWidget *rb, cam_t *cam)
{
cam->rsavetype = JPEG;
- gconf_client_set_int(cam->gc, GCONF_REMOTE_FILE_TYPE, cam->rsavetype, NULL);
+ g_settings_set_int(cam->gc, CAM_SETTINGS_REMOTE_FILE_TYPE, cam->rsavetype);
}
void rpng_func(GtkWidget *rb, cam_t *cam)
{
cam->rsavetype = PNG;
- gconf_client_set_int(cam->gc, GCONF_REMOTE_FILE_TYPE, cam->rsavetype, NULL);
+ g_settings_set_int(cam->gc, CAM_SETTINGS_REMOTE_FILE_TYPE, cam->rsavetype);
}
void rppm_func(GtkWidget *rb, cam_t *cam)
{
cam->rsavetype = PPM;
- gconf_client_set_int(cam->gc, GCONF_REMOTE_FILE_TYPE, cam->rsavetype, NULL);
+ g_settings_set_int(cam->gc, CAM_SETTINGS_REMOTE_FILE_TYPE, cam->rsavetype);
}
void rts_func(GtkWidget *rb, cam_t *cam)
{
cam->rtimestamp = gtk_toggle_button_get_active((GtkToggleButton *) rb);
- gconf_client_set_bool(cam->gc, GCONF_REMOTE_TIMESTAMP,
- cam->rtimestamp, NULL);
-
-}
-
-void gconf_notify_func(GConfClient *client, guint cnxn_id, GConfEntry *entry,
- char **str)
-{
- GConfValue *value;
-
- value = gconf_entry_get_value(entry);
- *str = g_strdup(gconf_value_get_string(value));
-}
-
-void gconf_notify_func_bool(GConfClient *client, guint cnxn_id,
- GConfEntry *entry, gboolean *val)
-{
- GConfValue *value;
-
- value = gconf_entry_get_value(entry);
- *val = gconf_value_get_bool(value);
-
-}
-
-void gconf_notify_func_int(GConfClient *client, guint cnxn_id,
- GConfEntry *entry, int *val)
-{
- GConfValue *value;
-
- value = gconf_entry_get_value(entry);
- *val = gconf_value_get_int(value);
-
+ g_settings_set_boolean(cam->gc, CAM_SETTINGS_REMOTE_TIMESTAMP,
+ cam->rtimestamp);
}
static int apply_remote_pref(cam_t *cam)
@@ -305,7 +275,7 @@ void prefs_func(GtkWidget *okbutton, cam_t *cam)
if (cam->pixdir)
g_free(cam->pixdir);
cam->pixdir = gtk_file_chooser_get_current_folder((GtkFileChooser *) dentry);
- gconf_client_set_string(cam->gc, GCONF_SAVE_DIR, cam->pixdir, NULL);
+ g_settings_set_string(cam->gc, CAM_SETTINGS_SAVE_DIR, cam->pixdir);
} else {
if (cam->debug == TRUE)
fprintf(stderr, "null directory\ndirectory unchanged.");
@@ -322,16 +292,16 @@ void prefs_func(GtkWidget *okbutton, cam_t *cam)
if(cam->capturefile)
g_free(cam->capturefile);
cam->capturefile = g_strdup(gtk_entry_get_text((GtkEntry *) entry2));
- gconf_client_set_string(cam->gc, GCONF_SAVE_FILE,
- cam->capturefile, NULL);
+ g_settings_set_string(cam->gc, CAM_SETTINGS_SAVE_FILE,
+ cam->capturefile);
}
if (strlen(gtk_entry_get_text((GtkEntry *) string_entry)) > 0) {
if (cam->ts_string)
g_free(cam->ts_string);
cam->ts_string = g_strdup(gtk_entry_get_text((GtkEntry *)string_entry));
- gconf_client_set_string(cam->gc, GCONF_TIMESTAMP_STRING,
- cam->ts_string, NULL);
+ g_settings_set_string(cam->gc, CAM_SETTINGS_TIMESTAMP_STRING,
+ cam->ts_string);
}
if (cam->debug == TRUE) {
fprintf(stderr, "dir now = %s\nfile now = %s\n", cam->pixdir,
@@ -395,8 +365,8 @@ void set_image_scale(cam_t *cam)
title);
g_free(title);
- gconf_client_set_int(cam->gc, GCONF_WIDTH, cam->width, NULL);
- gconf_client_set_int(cam->gc, GCONF_HEIGHT, cam->height, NULL);
+ g_settings_set_int(cam->gc, CAM_SETTINGS_WIDTH, cam->width);
+ g_settings_set_int(cam->gc, CAM_SETTINGS_HEIGHT, cam->height);
}
void on_change_size_activate(GtkWidget *widget, cam_t *cam)
@@ -452,8 +422,8 @@ void on_show_adjustments_activate(GtkToggleButton *button, cam_t *cam)
gtk_widget_show(GTK_WIDGET(gtk_builder_get_object(cam->xml, "adjustments_table")));
cam->show_adjustments = TRUE;
}
- gconf_client_set_bool(cam->gc, GCONF_SHOW_ADJUSTMENTS,
- cam->show_adjustments, NULL);
+ g_settings_set_boolean(cam->gc, CAM_SETTINGS_SHOW_ADJUSTMENTS,
+ cam->show_adjustments);
}
void on_show_effects_activate(GtkMenuItem *menuitem, cam_t *cam)
@@ -470,7 +440,7 @@ void on_show_effects_activate(GtkMenuItem *menuitem, cam_t *cam)
gtk_widget_show(effects);
}
- gconf_client_set_bool(cam->gc, GCONF_SHOW_EFFECTS, cam->show_effects, NULL);
+ g_settings_set_boolean(cam->gc, CAM_SETTINGS_SHOW_EFFECTS, cam->show_effects);
}
static void about_widget_destroy(GtkWidget *widget)
diff --git a/src/callbacks.h b/src/callbacks.h
index 1b55606..678d261 100644
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -3,18 +3,11 @@
#include "v4l.h"
#include "fileio.h"
-#include <gconf/gconf-client.h>
G_BEGIN_DECLS
void on_change_size_activate(GtkWidget * widget, cam_t *cam);
void on_quit_activate(GtkMenuItem *menuitem, cam_t *cam);
-void gconf_notify_func(GConfClient *client, guint cnxn_id,
- GConfEntry *entry, char **);
-void gconf_notify_func_bool(GConfClient *client, guint cnxn_id,
- GConfEntry *entry, gboolean *val);
-void gconf_notify_func_int(GConfClient *client, guint cnxn_id,
- GConfEntry *entry, int *val);
int delete_event(GtkWidget *, gpointer data);
void cap_func(GtkWidget *, cam_t *);
void rcap_func(GtkWidget *, cam_t *);
diff --git a/src/fileio.c b/src/fileio.c
index 79bd7d4..4f684a2 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -164,10 +164,10 @@ static void mount_cb(GObject *obj, GAsyncResult *res, gpointer user_data)
if (ret) {
cam->rdir_ok = TRUE;
- gconf_client_set_string(cam->gc, GCONF_HOSTNAME, cam->host, NULL);
- gconf_client_set_string(cam->gc, GCONF_REMOTE_PROTO, cam->proto, NULL);
- gconf_client_set_string(cam->gc, GCONF_REMOTE_SAVE_DIR, cam->rdir, NULL);
- gconf_client_set_string(cam->gc, GCONF_REMOTE_SAVE_FILE, cam->rcapturefile, NULL);
+ g_settings_set_string(cam->gc, CAM_SETTINGS_HOSTNAME, cam->host);
+ g_settings_set_string(cam->gc, CAM_SETTINGS_REMOTE_PROTO, cam->proto);
+ g_settings_set_string(cam->gc, CAM_SETTINGS_REMOTE_SAVE_DIR, cam->rdir);
+ g_settings_set_string(cam->gc, CAM_SETTINGS_REMOTE_SAVE_FILE, cam->rcapturefile);
} else {
gchar *error_message = g_strdup_printf(_("An error occurred mounting %s:%s."),
cam->uri, err->message);
diff --git a/src/interface.h b/src/interface.h
index 7083b38..857d147 100644
--- a/src/interface.h
+++ b/src/interface.h
@@ -1,27 +1,26 @@
-#define GCONF_PARENT "/apps/camorama"
-#define GCONF_PREFS GCONF_PARENT "/preferences"
+#define CAM_SETTINGS_SCHEMA "org.gnome.camorama"
-#define GCONF_DEVICE GCONF_PARENT "/device"
-#define GCONF_WIDTH GCONF_PARENT "/width"
-#define GCONF_HEIGHT GCONF_PARENT "/height"
-#define GCONF_SAVE_DIR GCONF_PREFS "/save_dir"
-#define GCONF_SAVE_FILE GCONF_PREFS "/save_file"
-#define GCONF_FILE_TYPE GCONF_PREFS "/file_type"
-#define GCONF_TIMESTAMP GCONF_PREFS "/timestamp"
-#define GCONF_HOSTNAME GCONF_PREFS "/hostname"
-#define GCONF_REMOTE_PROTO GCONF_PREFS "/remote_proto"
-#define GCONF_REMOTE_SAVE_DIR GCONF_PREFS "/remote_save_dir"
-#define GCONF_REMOTE_SAVE_FILE GCONF_PREFS "/remote_save_file"
-#define GCONF_REMOTE_FILE_TYPE GCONF_PREFS "/remote_file_type"
-#define GCONF_REMOTE_TIMESTAMP GCONF_PREFS "/remote_timestamp"
-#define GCONF_LOCAL_CAPTURE GCONF_PREFS "/local_capture"
-#define GCONF_REMOTE_CAPTURE GCONF_PREFS "/remote_capture"
-#define GCONF_LOCAL_APPEND_TS GCONF_PREFS "/append_ts_to_file"
-#define GCONF_REMOTE_APPEND_TS GCONF_PREFS "/remote_append_ts_to_file"
-#define GCONF_TIMESTAMP_STRING GCONF_PREFS "/timestamp_string"
-#define GCONF_USE_CUSTOM_STRING GCONF_PREFS "/use_custom_string"
-#define GCONF_DRAWDATE GCONF_PREFS "/drawdate"
-#define GCONF_AUTO_CAPTURE GCONF_PREFS "/auto_capture"
-#define GCONF_AUTO_CAPTURE_INTERVAL GCONF_PREFS "/auto_capture_interval"
-#define GCONF_SHOW_ADJUSTMENTS GCONF_PREFS "/show_adjustments"
-#define GCONF_SHOW_EFFECTS GCONF_PREFS "/show_effects"
+#define CAM_SETTINGS_DEVICE "device"
+#define CAM_SETTINGS_WIDTH "width"
+#define CAM_SETTINGS_HEIGHT "height"
+#define CAM_SETTINGS_SAVE_DIR "save-dir"
+#define CAM_SETTINGS_SAVE_FILE "save-file"
+#define CAM_SETTINGS_FILE_TYPE "file-type"
+#define CAM_SETTINGS_TIMESTAMP "timestamp"
+#define CAM_SETTINGS_HOSTNAME "hostname"
+#define CAM_SETTINGS_REMOTE_PROTO "remote-proto"
+#define CAM_SETTINGS_REMOTE_SAVE_DIR "remote-save-dir"
+#define CAM_SETTINGS_REMOTE_SAVE_FILE "remote-save-file"
+#define CAM_SETTINGS_REMOTE_FILE_TYPE "remote-file-type"
+#define CAM_SETTINGS_REMOTE_TIMESTAMP "remote-timestamp"
+#define CAM_SETTINGS_LOCAL_CAPTURE "local-capture"
+#define CAM_SETTINGS_REMOTE_CAPTURE "remote-capture"
+#define CAM_SETTINGS_LOCAL_APPEND_TS "append-ts-to-file"
+#define CAM_SETTINGS_REMOTE_APPEND_TS "remote-append-ts-to-file"
+#define CAM_SETTINGS_TIMESTAMP_STRING "timestamp-string"
+#define CAM_SETTINGS_USE_CUSTOM_STRING "use-custom-string"
+#define CAM_SETTINGS_DRAWDATE "drawdate"
+#define CAM_SETTINGS_AUTO_CAPTURE "auto-capture"
+#define CAM_SETTINGS_AUTO_CAPTURE_INTERVAL "auto-capture-interval"
+#define CAM_SETTINGS_SHOW_ADJUSTMENTS "show-adjustments"
+#define CAM_SETTINGS_SHOW_EFFECTS "show-effects"
diff --git a/src/main.c b/src/main.c
index d49e1f2..b38d368 100644
--- a/src/main.c
+++ b/src/main.c
@@ -106,7 +106,7 @@ static void activate(GtkApplication *app)
#endif
{
cam_t *cam = &cam_object;
- GConfClient *gc;
+ GSettings *gc;
GtkWidget *widget, *window;
unsigned int bufsize;
@@ -148,32 +148,11 @@ static void activate(GtkApplication *app)
printf("Forcing read mode\n");
cam->read = TRUE;
}
- gc = gconf_client_get_default();
+ gc = g_settings_new(CAM_SETTINGS_SCHEMA);
cam->gc = gc;
- gconf_client_add_dir(cam->gc, GCONF_PARENT, GCONF_CLIENT_PRELOAD_NONE, NULL);
- gconf_client_notify_add(cam->gc, GCONF_SAVE_DIR, (void *)gconf_notify_func,
- &cam->pixdir, NULL, NULL);
- gconf_client_notify_add(cam->gc, GCONF_SAVE_FILE, (void *)gconf_notify_func,
- &cam->capturefile, NULL, NULL);
- gconf_client_notify_add(cam->gc, GCONF_FILE_TYPE,
- (void *)gconf_notify_func_int,
- &cam->savetype, NULL, NULL);
- gconf_client_notify_add(cam->gc, GCONF_TIMESTAMP,
- (void *)gconf_notify_func_bool,
- &cam->timestamp, NULL, NULL);
- gconf_client_notify_add(cam->gc, GCONF_HOSTNAME, (void *)gconf_notify_func,
- &cam->host, NULL, NULL);
- gconf_client_notify_add(cam->gc, GCONF_REMOTE_PROTO, (void *)gconf_notify_func,
- &cam->proto, NULL, NULL);
- gconf_client_notify_add(cam->gc, GCONF_REMOTE_SAVE_DIR, (void *)gconf_notify_func,
- &cam->rdir, NULL, NULL);
- gconf_client_notify_add(cam->gc, GCONF_REMOTE_SAVE_FILE, (void *)gconf_notify_func,
- &cam->rcapturefile, NULL, NULL);
-
if (!poopoo) {
- gchar const *gconf_device = gconf_client_get_string(cam->gc, GCONF_DEVICE,
- NULL);
+ gchar const *gconf_device = g_settings_get_string(cam->gc, CAM_SETTINGS_DEVICE);
if (gconf_device)
cam->video_dev = g_strdup(gconf_device);
else
@@ -187,46 +166,45 @@ static void activate(GtkApplication *app)
cam->date_format = "%Y-%m-%d %H:%M:%S";
#pragma GCC diagnostic pop
- cam->pixdir = gconf_client_get_string(cam->gc, GCONF_SAVE_DIR, NULL);
- cam->capturefile = gconf_client_get_string(cam->gc, GCONF_SAVE_FILE, NULL);
- cam->savetype = gconf_client_get_int(cam->gc, GCONF_FILE_TYPE, NULL);
- cam->host = gconf_client_get_string(cam->gc, GCONF_HOSTNAME, NULL);
- cam->proto = gconf_client_get_string(cam->gc, GCONF_REMOTE_PROTO, NULL);
- cam->rdir = gconf_client_get_string(cam->gc, GCONF_REMOTE_SAVE_DIR, NULL);
- cam->rcapturefile = gconf_client_get_string(cam->gc,
- GCONF_REMOTE_SAVE_FILE, NULL);
- cam->rsavetype = gconf_client_get_int(cam->gc,
- GCONF_REMOTE_FILE_TYPE, NULL);
- cam->ts_string = gconf_client_get_string(cam->gc,
- GCONF_TIMESTAMP_STRING, NULL);
- cam->timestamp = gconf_client_get_bool(cam->gc, GCONF_TIMESTAMP, NULL);
- cam->rtimestamp = gconf_client_get_bool(cam->gc, GCONF_REMOTE_TIMESTAMP, NULL);
-
- cam->cap = gconf_client_get_bool(cam->gc, GCONF_LOCAL_CAPTURE, NULL);
- cam->rcap = gconf_client_get_bool(cam->gc, GCONF_REMOTE_CAPTURE, NULL);
- cam->timefn = gconf_client_get_bool(cam->gc, GCONF_LOCAL_APPEND_TS, NULL);
- cam->rtimefn = gconf_client_get_bool(cam->gc,
- GCONF_REMOTE_APPEND_TS, NULL);
- cam->usestring = gconf_client_get_bool(cam->gc,
- GCONF_USE_CUSTOM_STRING, NULL);
- cam->usedate = gconf_client_get_bool(cam->gc, GCONF_DRAWDATE, NULL);
- cam->acap = gconf_client_get_bool(cam->gc, GCONF_AUTO_CAPTURE, NULL);
- cam->timeout_interval = gconf_client_get_int(cam->gc,
- GCONF_AUTO_CAPTURE_INTERVAL, NULL);
- cam->show_adjustments = gconf_client_get_bool(cam->gc,
- GCONF_SHOW_ADJUSTMENTS,
- NULL);
- cam->show_effects = gconf_client_get_bool(cam->gc,
- GCONF_SHOW_EFFECTS, NULL);
+ cam->pixdir = g_settings_get_string(cam->gc, CAM_SETTINGS_SAVE_DIR);
+ cam->capturefile = g_settings_get_string(cam->gc, CAM_SETTINGS_SAVE_FILE);
+ cam->savetype = g_settings_get_int(cam->gc, CAM_SETTINGS_FILE_TYPE);
+ cam->host = g_settings_get_string(cam->gc, CAM_SETTINGS_HOSTNAME);
+ cam->proto = g_settings_get_string(cam->gc, CAM_SETTINGS_REMOTE_PROTO);
+ cam->rdir = g_settings_get_string(cam->gc, CAM_SETTINGS_REMOTE_SAVE_DIR);
+ cam->rcapturefile = g_settings_get_string(cam->gc,
+ CAM_SETTINGS_REMOTE_SAVE_FILE);
+ cam->rsavetype = g_settings_get_int(cam->gc,
+ CAM_SETTINGS_REMOTE_FILE_TYPE);
+ cam->ts_string = g_settings_get_string(cam->gc,
+ CAM_SETTINGS_TIMESTAMP_STRING);
+ cam->timestamp = g_settings_get_boolean(cam->gc, CAM_SETTINGS_TIMESTAMP);
+ cam->rtimestamp = g_settings_get_boolean(cam->gc, CAM_SETTINGS_REMOTE_TIMESTAMP);
+
+ cam->cap = g_settings_get_boolean(cam->gc, CAM_SETTINGS_LOCAL_CAPTURE);
+ cam->rcap = g_settings_get_boolean(cam->gc, CAM_SETTINGS_REMOTE_CAPTURE);
+ cam->timefn = g_settings_get_boolean(cam->gc, CAM_SETTINGS_LOCAL_APPEND_TS);
+ cam->rtimefn = g_settings_get_boolean(cam->gc,
+ CAM_SETTINGS_REMOTE_APPEND_TS);
+ cam->usestring = g_settings_get_boolean(cam->gc,
+ CAM_SETTINGS_USE_CUSTOM_STRING);
+ cam->usedate = g_settings_get_boolean(cam->gc, CAM_SETTINGS_DRAWDATE);
+ cam->acap = g_settings_get_boolean(cam->gc, CAM_SETTINGS_AUTO_CAPTURE);
+ cam->timeout_interval = g_settings_get_int(cam->gc,
+ CAM_SETTINGS_AUTO_CAPTURE_INTERVAL);
+ cam->show_adjustments = g_settings_get_boolean(cam->gc,
+ CAM_SETTINGS_SHOW_ADJUSTMENTS);
+ cam->show_effects = g_settings_get_boolean(cam->gc,
+ CAM_SETTINGS_SHOW_EFFECTS);
if (x)
cam->width = x;
else
- cam->width = gconf_client_get_int(cam->gc, GCONF_WIDTH, NULL);
+ cam->width = g_settings_get_int(cam->gc, CAM_SETTINGS_WIDTH);
if (y)
cam->height = y;
else
- cam->height = gconf_client_get_int(cam->gc, GCONF_HEIGHT, NULL);
+ cam->height = g_settings_get_int(cam->gc, CAM_SETTINGS_HEIGHT);
if (use_read)
cam->dev = v4l2_open(cam->video_dev, O_RDWR);
@@ -270,7 +248,7 @@ static void activate(GtkApplication *app)
exit(1);
}
- gconf_client_set_string(cam->gc, GCONF_DEVICE, cam->video_dev, NULL);
+ g_settings_set_string(cam->gc, CAM_SETTINGS_DEVICE, cam->video_dev);
load_interface(cam);
diff --git a/src/v4l.h b/src/v4l.h
index 7b1391c..2fc706e 100644
--- a/src/v4l.h
+++ b/src/v4l.h
@@ -17,7 +17,6 @@
#include <libv4l2.h>
#include <signal.h>
#include <png.h>
-#include <gconf/gconf-client.h>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
@@ -80,7 +79,7 @@ typedef struct camera {
unsigned char *pic_buf, *tmp;
guint timeout_id, timeout_fps_id, idle_id;
guint32 timeout_interval;
- GConfClient *gc;
+ GSettings *gc;
GtkBuilder *xml;
GdkPixbuf *pb;

Privacy Policy