[file-roller] Ported to GSettings
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] Ported to GSettings
- Date: Sun, 11 Jul 2010 10:49:51 +0000 (UTC)
commit 1343cfef5527bb1e88a164078cf4c82871e291b4
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Jul 11 12:39:50 2010 +0200
Ported to GSettings
The port basically works, there are only two remaining issues:
1) at start-up time two critical messages are printed when trying to
set a value but I couldn't find out why, the message is the following:
g_source_get_context: assertion `!SOURCE_DESTROYED (source)' failed
2) The Nautilus port to GSettings is required in order to connect to the
correct "single click policy" key.
configure.ac | 10 +-
data/Makefile.am | 25 +-
data/file-roller.schemas | 184 +++-----
data/org.gnome.file-roller.gschema.xml | 208 ++++++++
src/Makefile.am | 2 -
src/actions.c | 26 +-
src/commands/Makefile.in | 574 +++++++++++++++++++++
src/dlg-add-files.c | 12 +-
src/dlg-add-folder.c | 38 +-
src/dlg-batch-add.c | 25 +-
src/dlg-extract.c | 19 +-
src/dlg-new.c | 26 +-
src/dlg-open-with.c | 86 ++--
src/dlg-password.c | 9 +-
src/dlg-update.c | 1 -
src/file-utils.c | 2 -
src/fr-archive.c | 3 +-
src/fr-window.c | 354 +++++++-------
src/fr-window.h | 1 -
src/gconf-utils.c | 862 --------------------------------
src/gconf-utils.h | 137 -----
src/glib-utils.c | 68 +++
src/glib-utils.h | 11 +
src/main.c | 84 +---
src/preferences.c | 244 +--------
src/preferences.h | 102 ++--
src/typedefs.h | 3 +
27 files changed, 1325 insertions(+), 1791 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b31ede3..c7656b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,10 +10,10 @@ AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADER([config.h])
GNOME_COMMON_INIT
-
AC_PROG_CC
AM_DISABLE_STATIC
AC_PROG_LIBTOOL
+GLIB_GSETTINGS
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
@@ -129,14 +129,6 @@ AM_CONDITIONAL(ENABLE_DEPRECATIONS, test "x$enable_deprecations" = xyes)
dnl ******************************
-AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
-if test x"$GCONFTOOL" = xno; then
- AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
-fi
-AM_GCONF_SOURCE_2
-
-dnl ******************************
-
NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension`
AC_SUBST(NAUTILUS_EXTENSION_DIR)
diff --git a/data/Makefile.am b/data/Makefile.am
index 289c22f..26bf6af 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,29 +1,22 @@
- INTLTOOL_DESKTOP_RULE@
-
SUBDIRS = ui icons
+desktopdir = $(datadir)/applications
desktop_in_in_files = file-roller.desktop.in.in
desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
-
-desktopdir = $(datadir)/applications
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+ INTLTOOL_DESKTOP_RULE@
matchdir = $(datadir)/file-roller
match_DATA = packages.match
-schemadir = @GCONF_SCHEMA_FILE_DIR@
-schema_DATA = file-roller.schemas
+gsettings_SCHEMAS = org.gnome.file-roller.gschema.xml
+ GSETTINGS_RULES@
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
-install-data-local:
-if GCONF_SCHEMAS_INSTALL
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA)
-endif
-
-install-data-hook: update-icon-cache
-uninstall-hook: update-icon-cache
-update-icon-cache:
+install-data-hook: update-cache
+uninstall-hook: update-cache
+update-cache:
if test -z "$(DESTDIR)"; then \
echo "Updating Gtk icon cache."; \
$(gtk_update_icon_cache); \
@@ -32,15 +25,13 @@ update-icon-cache:
echo "*** $(gtk_update_icon_cache)"; \
fi
-
EXTRA_DIST = \
$(desktop_in_in_files) \
$(desktop_in_files) \
$(desktop_DATA) \
packages.match.in \
packages.match \
- $(schema_DATA)
-
+ $(gsettings_SCHEMAS)
DISTCLEANFILES = \
$(desktop_in_files) \
diff --git a/data/file-roller.schemas b/data/file-roller.schemas
index 85265d1..5c323e7 100644
--- a/data/file-roller.schemas
+++ b/data/file-roller.schemas
@@ -1,49 +1,42 @@
+<?xml version="1.0"?>
<gconfschemafile>
<schemalist>
-
<schema>
- <key>/schemas/apps/file-roller/listing/sort_method</key>
- <applyto>/apps/file-roller/listing/sort_method</applyto>
+ <key>/schemas/apps/file-roller/listing/sort-method</key>
+ <applyto>/apps/file-roller/listing/sort-method</applyto>
<owner>file-roller</owner>
<type>string</type>
<default>name</default>
<locale name="C">
<short>How to sort files</short>
- <long>What criteria must be used to arrange files. Possible values:
- name, size, type, time, path.
- </long>
+ <long>What criteria must be used to arrange files. Possible values: name, size, type, time, path.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/listing/sort_type</key>
- <applyto>/apps/file-roller/listing/sort_type</applyto>
+ <key>/schemas/apps/file-roller/listing/sort-type</key>
+ <applyto>/apps/file-roller/listing/sort-type</applyto>
<owner>file-roller</owner>
<type>string</type>
<default>ascending</default>
<locale name="C">
<short>Sort type</short>
- <long>Whether to sort in ascending or descending direction. Possible
- values: ascending, descending.</long>
+ <long>Whether to sort in ascending or descending direction. Possible values: ascending, descending.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/listing/list_mode</key>
- <applyto>/apps/file-roller/listing/list_mode</applyto>
+ <key>/schemas/apps/file-roller/listing/list-mode</key>
+ <applyto>/apps/file-roller/listing/list-mode</applyto>
<owner>file-roller</owner>
<type>string</type>
<default>as_folder</default>
<locale name="C">
<short>List Mode</short>
- <long>Whether to view all files in the archive (all_files), or
- view the archive as a folder (as_folder).</long>
+ <long>Whether to view all files in the archive (all_files), or view the archive as a folder (as_folder).</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/listing/show_type</key>
- <applyto>/apps/file-roller/listing/show_type</applyto>
+ <key>/schemas/apps/file-roller/listing/show-type</key>
+ <applyto>/apps/file-roller/listing/show-type</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>true</default>
@@ -52,10 +45,9 @@
<long>Display the Type column in the main window.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/listing/show_size</key>
- <applyto>/apps/file-roller/listing/show_size</applyto>
+ <key>/schemas/apps/file-roller/listing/show-size</key>
+ <applyto>/apps/file-roller/listing/show-size</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>true</default>
@@ -64,10 +56,9 @@
<long>Display the Size column in the main window.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/listing/show_time</key>
- <applyto>/apps/file-roller/listing/show_time</applyto>
+ <key>/schemas/apps/file-roller/listing/show-time</key>
+ <applyto>/apps/file-roller/listing/show-time</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>true</default>
@@ -76,10 +67,9 @@
<long>Display the Time column in the main window.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/listing/show_path</key>
- <applyto>/apps/file-roller/listing/show_path</applyto>
+ <key>/schemas/apps/file-roller/listing/show-path</key>
+ <applyto>/apps/file-roller/listing/show-path</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>true</default>
@@ -88,24 +78,20 @@
<long>Display the Path column in the main window.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/listing/use_mime_icons</key>
- <applyto>/apps/file-roller/listing/use_mime_icons</applyto>
+ <key>/schemas/apps/file-roller/listing/use-mime-icons</key>
+ <applyto>/apps/file-roller/listing/use-mime-icons</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>Use mime icons</short>
- <long>if TRUE will display icons depending on the file type (slower),
- otherwise will use always the same icon for all files (faster).
- </long>
+ <long>if TRUE will display icons depending on the file type (slower), otherwise will use always the same icon for all files (faster).</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/listing/name_column_width</key>
- <applyto>/apps/file-roller/listing/name_column_width</applyto>
+ <key>/schemas/apps/file-roller/listing/name-column-width</key>
+ <applyto>/apps/file-roller/listing/name-column-width</applyto>
<owner>file-roller</owner>
<type>int</type>
<default>250</default>
@@ -114,10 +100,9 @@
<long>The default width ofthe name column the file list.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/ui/history_len</key>
- <applyto>/apps/file-roller/ui/history_len</applyto>
+ <key>/schemas/apps/file-roller/ui/history-len</key>
+ <applyto>/apps/file-roller/ui/history-len</applyto>
<owner>file-roller</owner>
<type>int</type>
<default>5</default>
@@ -126,49 +111,42 @@
<long>Max number of items in the Open Recents menu.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/ui/window_width</key>
- <applyto>/apps/file-roller/ui/window_width</applyto>
+ <key>/schemas/apps/file-roller/ui/window-width</key>
+ <applyto>/apps/file-roller/ui/window-width</applyto>
<owner>file-roller</owner>
<type>int</type>
<default>600</default>
<locale name="C">
<short></short>
- <long>
- </long>
+ <long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/ui/window_height</key>
- <applyto>/apps/file-roller/ui/window_height</applyto>
+ <key>/schemas/apps/file-roller/ui/window-height</key>
+ <applyto>/apps/file-roller/ui/window-height</applyto>
<owner>file-roller</owner>
<type>int</type>
<default>480</default>
<locale name="C">
<short></short>
- <long>
- </long>
+ <long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/ui/sidebar_width</key>
- <applyto>/apps/file-roller/ui/sidebar_width</applyto>
+ <key>/schemas/apps/file-roller/ui/sidebar-width</key>
+ <applyto>/apps/file-roller/ui/sidebar-width</applyto>
<owner>file-roller</owner>
<type>int</type>
<default>200</default>
<locale name="C">
<short></short>
- <long>
- </long>
+ <long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/ui/view_toolbar</key>
- <applyto>/apps/file-roller/ui/view_toolbar</applyto>
+ <key>/schemas/apps/file-roller/ui/view-toolbar</key>
+ <applyto>/apps/file-roller/ui/view-toolbar</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>true</default>
@@ -177,10 +155,9 @@
<long>Whether to display the toolbar.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/ui/view_statusbar</key>
- <applyto>/apps/file-roller/ui/view_statusbar</applyto>
+ <key>/schemas/apps/file-roller/ui/view-statusbar</key>
+ <applyto>/apps/file-roller/ui/view-statusbar</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>true</default>
@@ -189,10 +166,9 @@
<long>Whether to display the statusbar.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/ui/view_folders</key>
- <applyto>/apps/file-roller/ui/view_folders</applyto>
+ <key>/schemas/apps/file-roller/ui/view-folders</key>
+ <applyto>/apps/file-roller/ui/view-folders</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>false</default>
@@ -201,7 +177,6 @@
<long>Whether to display the folders pane.</long>
</locale>
</schema>
-
<schema>
<key>/schemas/apps/file-roller/general/editors</key>
<applyto>/apps/file-roller/general/editors</applyto>
@@ -211,27 +186,23 @@
<default>[]</default>
<locale name="C">
<short>Editors</short>
- <long>List of applications entered in the Open file dialog and not
- associated with the file type.</long>
+ <long>List of applications entered in the Open file dialog and not associated with the file type.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/general/compression_level</key>
- <applyto>/apps/file-roller/general/compression_level</applyto>
+ <key>/schemas/apps/file-roller/general/compression-level</key>
+ <applyto>/apps/file-roller/general/compression-level</applyto>
<owner>file-roller</owner>
<type>string</type>
<default>normal</default>
<locale name="C">
<short>Compression level</short>
- <long>Compression level used when adding files to an archive.
- Possible values : very_fast, fast, normal, maximum.</long>
+ <long>Compression level used when adding files to an archive. Possible values : very_fast, fast, normal, maximum.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/general/encrypt_header</key>
- <applyto>/apps/file-roller/general/encrypt_header</applyto>
+ <key>/schemas/apps/file-roller/general/encrypt-header</key>
+ <applyto>/apps/file-roller/general/encrypt-header</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>false</default>
@@ -240,20 +211,17 @@
<long>Whether to encrypt the archive header. If the header is encrypted the password will be required to list the archive content as well.</long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/general/migrate_directories</key>
- <applyto>/apps/file-roller/general/migrate_directories</applyto>
+ <key>/schemas/apps/file-roller/general/migrate-directories</key>
+ <applyto>/apps/file-roller/general/migrate-directories</applyto>
<owner>gthumb</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short></short>
- <long>
- </long>
+ <long></long>
</locale>
</schema>
-
<schema>
<key>/schemas/apps/file-roller/dialogs/extract/overwrite</key>
<applyto>/apps/file-roller/dialogs/extract/overwrite</applyto>
@@ -265,10 +233,9 @@
<long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/dialogs/extract/skip_newer</key>
- <applyto>/apps/file-roller/dialogs/extract/skip_newer</applyto>
+ <key>/schemas/apps/file-roller/dialogs/extract/skip-newer</key>
+ <applyto>/apps/file-roller/dialogs/extract/skip-newer</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>false</default>
@@ -277,10 +244,9 @@
<long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/dialogs/extract/recreate_folders</key>
- <applyto>/apps/file-roller/dialogs/extract/recreate_folders</applyto>
+ <key>/schemas/apps/file-roller/dialogs/extract/recreate-folders</key>
+ <applyto>/apps/file-roller/dialogs/extract/recreate-folders</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>true</default>
@@ -289,10 +255,9 @@
<long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/dialogs/add/current_folder</key>
- <applyto>/apps/file-roller/dialogs/add/current_folder</applyto>
+ <key>/schemas/apps/file-roller/dialogs/add/current-folder</key>
+ <applyto>/apps/file-roller/dialogs/add/current-folder</applyto>
<owner>file-roller</owner>
<type>string</type>
<default></default>
@@ -301,7 +266,6 @@
<long></long>
</locale>
</schema>
-
<schema>
<key>/schemas/apps/file-roller/dialogs/add/filename</key>
<applyto>/apps/file-roller/dialogs/add/filename</applyto>
@@ -313,10 +277,9 @@
<long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/dialogs/add/include_files</key>
- <applyto>/apps/file-roller/dialogs/add/include_files</applyto>
+ <key>/schemas/apps/file-roller/dialogs/add/include-files</key>
+ <applyto>/apps/file-roller/dialogs/add/include-files</applyto>
<owner>file-roller</owner>
<type>string</type>
<default></default>
@@ -325,10 +288,9 @@
<long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/dialogs/add/exclude_files</key>
- <applyto>/apps/file-roller/dialogs/add/exclude_files</applyto>
+ <key>/schemas/apps/file-roller/dialogs/add/exclude-files</key>
+ <applyto>/apps/file-roller/dialogs/add/exclude-files</applyto>
<owner>file-roller</owner>
<type>string</type>
<default></default>
@@ -337,10 +299,9 @@
<long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/dialogs/add/exclude_folders</key>
- <applyto>/apps/file-roller/dialogs/add/exclude_folders</applyto>
+ <key>/schemas/apps/file-roller/dialogs/add/exclude-folders</key>
+ <applyto>/apps/file-roller/dialogs/add/exclude-folders</applyto>
<owner>file-roller</owner>
<type>string</type>
<default></default>
@@ -349,7 +310,6 @@
<long></long>
</locale>
</schema>
-
<schema>
<key>/schemas/apps/file-roller/dialogs/extract/update</key>
<applyto>/apps/file-roller/dialogs/extract/update</applyto>
@@ -361,7 +321,6 @@
<long></long>
</locale>
</schema>
-
<schema>
<key>/schemas/apps/file-roller/dialogs/extract/recursive</key>
<applyto>/apps/file-roller/dialogs/extract/recursive</applyto>
@@ -373,10 +332,9 @@
<long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/dialogs/extract/no_symlinks</key>
- <applyto>/apps/file-roller/dialogs/extract/no_symlinks</applyto>
+ <key>/schemas/apps/file-roller/dialogs/extract/no-symlinks</key>
+ <applyto>/apps/file-roller/dialogs/extract/no-symlinks</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>false</default>
@@ -385,10 +343,9 @@
<long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/dialogs/batch-add/default_extension</key>
- <applyto>/apps/file-roller/dialogs/batch-add/default_extension</applyto>
+ <key>/schemas/apps/file-roller/dialogs/batch-add/default-extension</key>
+ <applyto>/apps/file-roller/dialogs/batch-add/default-extension</applyto>
<owner>file-roller</owner>
<type>string</type>
<default>.tar.gz</default>
@@ -397,10 +354,9 @@
<long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/dialogs/batch-add/other_options</key>
- <applyto>/apps/file-roller/dialogs/batch-add/other_options</applyto>
+ <key>/schemas/apps/file-roller/dialogs/batch-add/other-options</key>
+ <applyto>/apps/file-roller/dialogs/batch-add/other-options</applyto>
<owner>file-roller</owner>
<type>bool</type>
<default>false</default>
@@ -409,10 +365,9 @@
<long></long>
</locale>
</schema>
-
<schema>
- <key>/schemas/apps/file-roller/dialogs/batch-add/volume_size</key>
- <applyto>/apps/file-roller/dialogs/batch-add/volume_size</applyto>
+ <key>/schemas/apps/file-roller/dialogs/batch-add/volume-size</key>
+ <applyto>/apps/file-roller/dialogs/batch-add/volume-size</applyto>
<owner>file-roller</owner>
<type>int</type>
<default>0</default>
@@ -421,6 +376,5 @@
<long>The default size for volumes.</long>
</locale>
</schema>
-
</schemalist>
</gconfschemafile>
diff --git a/data/org.gnome.file-roller.gschema.xml b/data/org.gnome.file-roller.gschema.xml
new file mode 100644
index 0000000..10bdaf4
--- /dev/null
+++ b/data/org.gnome.file-roller.gschema.xml
@@ -0,0 +1,208 @@
+<schemalist>
+
+ <enum id="org.gnome.file-roller.sort-method">
+ <value nick="name" value="0"/>
+ <value nick="size" value="1"/>
+ <value nick="type" value="2"/>
+ <value nick="time" value="3"/>
+ <value nick="path" value="4"/>
+ </enum>
+
+ <enum id="org.gnome.file-roller.sort-type">
+ <value nick="ascending" value="0"/>
+ <value nick="descending" value="1"/>
+ </enum>
+
+ <enum id="org.gnome.file-roller.list-mode">
+ <value nick="all-files" value="0"/>
+ <value nick="as-folder" value="1"/>
+ </enum>
+
+ <enum id="org.gnome.file-roller.compression-level">
+ <value nick="very-fast" value="0"/>
+ <value nick="fast" value="1"/>
+ <value nick="normal" value="2"/>
+ <value nick="maximum" value="3"/>
+ </enum>
+
+ <schema id="org.gnome.file-roller" path="/apps/file-roller/">
+ <child name="listing" schema="org.gnome.file-roller.listing"/>
+ <child name="ui" schema="org.gnome.file-roller.ui"/>
+ <child name="general" schema="org.gnome.file-roller.general"/>
+ <child name="dialogs" schema="org.gnome.file-roller.dialogs"/>
+ </schema>
+
+ <schema id="org.gnome.file-roller.listing" path="/apps/file-roller/listing/">
+ <key name="sort-method" enum="org.gnome.file-roller.sort-method">
+ <default>'name'</default>
+ <summary>How to sort files</summary>
+ <description>What criteria must be used to arrange files. Possible values: name, size, type, time, path.</description>
+ </key>
+ <key name="sort-type" enum="org.gnome.file-roller.sort-type">
+ <default>'ascending'</default>
+ <summary>Sort type</summary>
+ <description>Whether to sort in ascending or descending direction. Possible values: ascending, descending.</description>
+ </key>
+ <key name="list-mode" enum="org.gnome.file-roller.list-mode">
+ <default>'as-folder'</default>
+ <summary>List Mode</summary>
+ <description>Use "all-files" to view all the files in the archive in a single list, use "as-folder" to navigate the archive as a folder.</description>
+ </key>
+ <key name="show-type" type="b">
+ <default>true</default>
+ <summary>Display type</summary>
+ <description>Display the Type column in the main window.</description>
+ </key>
+ <key name="show-size" type="b">
+ <default>true</default>
+ <summary>Display size</summary>
+ <description>Display the Size column in the main window.</description>
+ </key>
+ <key name="show-time" type="b">
+ <default>true</default>
+ <summary>Display time</summary>
+ <description>Display the Time column in the main window.</description>
+ </key>
+ <key name="show-path" type="b">
+ <default>true</default>
+ <summary>Display path</summary>
+ <description>Display the Path column in the main window.</description>
+ </key>
+ <key name="use-mime-icons" type="b">
+ <default>true</default>
+ <summary>Use mime icons</summary>
+ <description>if TRUE will display icons depending on the file type (slower), otherwise will use always the same icon for all files (faster).</description>
+ </key>
+ <key name="name-column-width" type="i">
+ <default>250</default>
+ <summary>Name column width</summary>
+ <description>The default width ofthe name column the file list.</description>
+ </key>
+ </schema>
+
+ <schema id="org.gnome.file-roller.ui" path="/apps/file-roller/ui/">
+ <key name="history-len" type="i">
+ <default>5</default>
+ <summary>Max history length</summary>
+ <description>Max number of items in the Open Recents menu.</description>
+ </key>
+ <key name="window-width" type="i">
+ <default>600</default>
+ </key>
+ <key name="window-height" type="i">
+ <default>480</default>
+ </key>
+ <key name="sidebar-width" type="i">
+ <default>200</default>
+ </key>
+ <key name="view-toolbar" type="b">
+ <default>true</default>
+ <summary>View toolbar</summary>
+ <description>Whether to display the toolbar.</description>
+ </key>
+ <key name="view-statusbar" type="b">
+ <default>true</default>
+ <summary>View statusbar</summary>
+ <description>Whether to display the statusbar.</description>
+ </key>
+ <key name="view-folders" type="b">
+ <default>false</default>
+ <summary>View the folders pane</summary>
+ <description>Whether to display the folders pane.</description>
+ </key>
+ </schema>
+
+ <schema id="org.gnome.file-roller.general" path="/apps/file-roller/general/">
+ <key name="editors" type="as">
+ <default>[]</default>
+ <summary>Editors</summary>
+ <description>List of applications entered in the Open file dialog and not associated with the file type.</description>
+ </key>
+ <key name="compression-level" enum="org.gnome.file-roller.compression-level">
+ <default>'normal'</default>
+ <summary>Compression level</summary>
+ <description>Compression level used when adding files to an archive. Possible values : very-fast, fast, normal, maximum.</description>
+ </key>
+ <key name="encrypt-header" type="b">
+ <default>false</default>
+ <summary>Encrypt the archive header</summary>
+ <description>Whether to encrypt the archive header. If the header is encrypted the password will be required to list the archive content as well.</description>
+ </key>
+ <key name="migrate-directories" type="b">
+ <default>true</default>
+ </key>
+ </schema>
+
+ <schema id="org.gnome.file-roller.dialogs" path="/apps/file-roller/dialogs/">
+ <child name="extract" schema="org.gnome.file-roller.dialogs.extract"/>
+ <child name="add" schema="org.gnome.file-roller.dialogs.add"/>
+ <child name="batch-add" schema="org.gnome.file-roller.dialogs.batch-add"/>
+ <child name="last-output" schema="org.gnome.file-roller.dialogs.last-output"/>
+ </schema>
+
+ <schema id="org.gnome.file-roller.dialogs.extract" path="/apps/file-roller/dialogs/extract/">
+ <key name="overwrite" type="b">
+ <default>true</default>
+ <summary>Overwrite existing files</summary>
+ </key>
+ <key name="skip-newer" type="b">
+ <default>false</default>
+ <summary>Do not overwrite newer files</summary>
+ </key>
+ <key name="recreate-folders" type="b">
+ <default>true</default>
+ <summary>Recreate the folders stored in the archive</summary>
+ </key>
+ </schema>
+
+ <schema id="org.gnome.file-roller.dialogs.add" path="/apps/file-roller/dialogs/add/">
+ <key name="current-folder" type="s">
+ <default>''</default>
+ </key>
+ <key name="filename" type="s">
+ <default>''</default>
+ </key>
+ <key name="include-files" type="s">
+ <default>''</default>
+ </key>
+ <key name="exclude-files" type="s">
+ <default>''</default>
+ </key>
+ <key name="exclude-folders" type="s">
+ <default>''</default>
+ </key>
+ <key name="update" type="b">
+ <default>false</default>
+ </key>
+ <key name="recursive" type="b">
+ <default>true</default>
+ </key>
+ <key name="no-symlinks" type="b">
+ <default>false</default>
+ </key>
+ </schema>
+
+ <schema id="org.gnome.file-roller.dialogs.batch-add" path="/apps/file-roller/dialogs/batch-add/">
+ <key name="default-extension" type="s">
+ <default>'.tar.gz'</default>
+ </key>
+ <key name="other-options" type="b">
+ <default>false</default>
+ </key>
+ <key name="volume-size" type="i">
+ <default>0</default>
+ <summary>Default volume size</summary>
+ <description>The default size for volumes.</description>
+ </key>
+ </schema>
+
+ <schema id="org.gnome.file-roller.dialogs.last-output" path="/apps/file-roller/dialogs/last-output/">
+ <key name="width" type="i">
+ <default>-1</default>
+ </key>
+ <key name="height" type="i">
+ <default>-1</default>
+ </key>
+ </schema>
+
+</schemalist>
diff --git a/src/Makefile.am b/src/Makefile.am
index e099e67..f9b0d49 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -136,8 +136,6 @@ file_roller_SOURCES = \
fr-process.h \
fr-window.c \
fr-window.h \
- gconf-utils.c \
- gconf-utils.h \
gio-utils.c \
gio-utils.h \
glib-utils.c \
diff --git a/src/actions.c b/src/actions.c
index 7030c4b..ed9c7ef 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -39,7 +39,6 @@
#include "fr-window.h"
#include "file-utils.h"
#include "fr-process.h"
-#include "gconf-utils.h"
#include "glib-utils.h"
#include "main.h"
#include "typedefs.h"
@@ -428,6 +427,7 @@ save_file_response_cb (GtkWidget *w,
const char *password;
gboolean encrypt_header;
int volume_size;
+ GSettings *settings;
if ((response == GTK_RESPONSE_CANCEL) || (response == GTK_RESPONSE_DELETE_EVENT)) {
gtk_widget_destroy (data->dialog);
@@ -447,7 +447,9 @@ save_file_response_cb (GtkWidget *w,
encrypt_header = dlg_new_data_get_encrypt_header (data);
volume_size = dlg_new_data_get_volume_size (data);
- eel_gconf_set_integer (PREF_BATCH_VOLUME_SIZE, volume_size);
+ settings = g_settings_new (FILE_ROLLER_SCHEMA_BATCH_ADD);
+ g_settings_set_int (settings, PREF_BATCH_ADD_VOLUME_SIZE, volume_size);
+ g_object_unref (settings);
fr_window_archive_save_as (data->window, path, password, encrypt_header, volume_size);
gtk_widget_destroy (data->dialog);
@@ -723,7 +725,11 @@ void
activate_action_view_toolbar (GtkAction *action,
gpointer data)
{
- eel_gconf_set_boolean (PREF_UI_TOOLBAR, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
+ GSettings *settings;
+
+ settings = g_settings_new (FILE_ROLLER_SCHEMA_UI);
+ g_settings_set_boolean (settings, PREF_UI_VIEW_TOOLBAR, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
+ g_object_unref (settings);
}
@@ -731,15 +737,23 @@ void
activate_action_view_statusbar (GtkAction *action,
gpointer data)
{
- eel_gconf_set_boolean (PREF_UI_STATUSBAR, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
+ GSettings *settings;
+
+ settings = g_settings_new (FILE_ROLLER_SCHEMA_UI);
+ g_settings_set_boolean (settings, PREF_UI_VIEW_STATUSBAR, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
+ g_object_unref (settings);
}
void
activate_action_view_folders (GtkAction *action,
- gpointer data)
+ gpointer data)
{
- eel_gconf_set_boolean (PREF_UI_FOLDERS, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
+ GSettings *settings;
+
+ settings = g_settings_new (FILE_ROLLER_SCHEMA_UI);
+ g_settings_set_boolean (settings, PREF_UI_VIEW_FOLDERS, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
+ g_object_unref (settings);
}
diff --git a/src/commands/Makefile.in b/src/commands/Makefile.in
new file mode 100644
index 0000000..bb23b63
--- /dev/null
+++ b/src/commands/Makefile.in
@@ -0,0 +1,574 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+privexec_PROGRAMS = rpm2cpio$(EXEEXT)
+subdir = src/commands
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(privexecdir)"
+PROGRAMS = $(privexec_PROGRAMS)
+am_rpm2cpio_OBJECTS = rpm2cpio.$(OBJEXT)
+rpm2cpio_OBJECTS = $(am_rpm2cpio_OBJECTS)
+am__DEPENDENCIES_1 =
+rpm2cpio_DEPENDENCIES = $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+DEFAULT_INCLUDES = -I am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(rpm2cpio_SOURCES)
+DIST_SOURCES = $(rpm2cpio_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+ALL_LINGUAS = @ALL_LINGUAS@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@
+DOC_USER_FORMATS = @DOC_USER_FORMATS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FR_CFLAGS = @FR_CFLAGS@
+FR_LIBS = @FR_LIBS@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GIO_REQUIRED = @GIO_REQUIRED@
+GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLIB_REQUIRED = @GLIB_REQUIRED@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+GTK_REQUIRED = @GTK_REQUIRED@
+HELP_DIR = @HELP_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLLIBS = @INTLLIBS@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+INTLTOOL_MERGE = @INTLTOOL_MERGE@
+INTLTOOL_PERL = @INTLTOOL_PERL@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGFMT_OPTS = @MSGFMT_OPTS@
+MSGMERGE = @MSGMERGE@
+NAUTILUS_CFLAGS = @NAUTILUS_CFLAGS@
+NAUTILUS_EXTENSION_DIR = @NAUTILUS_EXTENSION_DIR@
+NAUTILUS_LIBS = @NAUTILUS_LIBS@
+NAUTILUS_REQUIRED = @NAUTILUS_REQUIRED@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OMF_DIR = @OMF_DIR@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POFILES = @POFILES@
+POSUB = @POSUB@
+PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
+PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gsettingsschemadir = @gsettingsschemadir@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+privexecdir = $(libexecdir)/$(PACKAGE)
+INCLUDES = $(DISABLE_DEPRECATED) $(FR_CFLAGS)
+rpm2cpio_SOURCES = rpm2cpio.c
+rpm2cpio_LDADD = $(FR_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/commands/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/commands/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-privexecPROGRAMS: $(privexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(privexecdir)" || $(MKDIR_P) "$(DESTDIR)$(privexecdir)"
+ @list='$(privexec_PROGRAMS)'; test -n "$(privexecdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(privexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(privexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-privexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(privexec_PROGRAMS)'; test -n "$(privexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(privexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(privexecdir)" && rm -f $$files
+
+clean-privexecPROGRAMS:
+ @list='$(privexec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+rpm2cpio$(EXEEXT): $(rpm2cpio_OBJECTS) $(rpm2cpio_DEPENDENCIES)
+ @rm -f rpm2cpio$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(rpm2cpio_OBJECTS) $(rpm2cpio_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ AMDEP_TRUE@@am__include@ @am__quote /$(DEPDIR)/rpm2cpio Po am__quote@
+
+.c.o:
+ am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(privexecdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-privexecPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-privexecPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-privexecPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-privexecPROGRAMS ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-privexecPROGRAMS install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-privexecPROGRAMS
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/dlg-add-files.c b/src/dlg-add-files.c
index 031f652..82f0582 100644
--- a/src/dlg-add-files.c
+++ b/src/dlg-add-files.c
@@ -28,13 +28,13 @@
#include "file-utils.h"
#include "fr-stock.h"
#include "fr-window.h"
-#include "gconf-utils.h"
#include "gtk-utils.h"
#include "preferences.h"
typedef struct {
FrWindow *window;
+ GSettings *settings;
GtkWidget *dialog;
GtkWidget *add_if_newer_checkbutton;
} DialogData;
@@ -44,6 +44,7 @@ static void
open_file_destroy_cb (GtkWidget *file_sel,
DialogData *data)
{
+ g_object_unref (data->settings);
g_free (data);
}
@@ -63,9 +64,11 @@ file_sel_response_cb (GtkWidget *widget,
current_folder = gtk_file_chooser_get_current_folder_uri (file_sel);
uri = gtk_file_chooser_get_uri (file_sel);
- eel_gconf_set_string (PREF_ADD_CURRENT_FOLDER, current_folder);
- eel_gconf_set_string (PREF_ADD_FILENAME, uri);
+
+ g_settings_set_string (data->settings, PREF_ADD_CURRENT_FOLDER, current_folder);
+ g_settings_set_string (data->settings, PREF_ADD_FILENAME, uri);
fr_window_set_add_default_dir (window, current_folder);
+
g_free (uri);
if ((response == GTK_RESPONSE_CANCEL) || (response == GTK_RESPONSE_DELETE_EVENT)) {
@@ -138,6 +141,7 @@ add_files_cb (GtkWidget *widget,
data = g_new0 (DialogData, 1);
data->window = callback_data;
+ data->settings = g_settings_new (FILE_ROLLER_SCHEMA_ADD);
data->dialog = file_sel =
gtk_file_chooser_dialog_new (_("Add Files"),
GTK_WINDOW (data->window),
@@ -166,7 +170,7 @@ add_files_cb (GtkWidget *widget,
/* set data */
- folder = eel_gconf_get_string (PREF_ADD_CURRENT_FOLDER, "");
+ folder = g_settings_get_string (data->settings, PREF_ADD_CURRENT_FOLDER);
if ((folder == NULL) || (strcmp (folder, "") == 0))
folder = g_strdup (fr_window_get_add_default_dir (data->window));
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (file_sel), folder);
diff --git a/src/dlg-add-folder.c b/src/dlg-add-folder.c
index ef4391a..258466e 100644
--- a/src/dlg-add-folder.c
+++ b/src/dlg-add-folder.c
@@ -31,12 +31,12 @@
#include "file-utils.h"
#include "fr-stock.h"
#include "fr-window.h"
-#include "gconf-utils.h"
#include "gtk-utils.h"
#include "preferences.h"
typedef struct {
FrWindow *window;
+ GSettings *settings;
GtkWidget *dialog;
GtkWidget *include_subfold_checkbutton;
GtkWidget *add_if_newer_checkbutton;
@@ -59,6 +59,7 @@ static void
open_file_destroy_cb (GtkWidget *widget,
DialogData *data)
{
+ g_object_unref (data->settings);
g_free (data->last_options);
g_free (data);
}
@@ -210,9 +211,8 @@ add_folder_cb (GtkWidget *widget,
GtkWidget *align;
data = g_new0 (DialogData, 1);
-
+ data->settings = g_settings_new (FILE_ROLLER_SCHEMA_ADD);
data->window = callback_data;
-
data->dialog = file_sel =
gtk_file_chooser_dialog_new (_("Add a Folder"),
GTK_WINDOW (data->window),
@@ -505,14 +505,14 @@ dlg_add_folder_load_last_options (DialogData *data)
gboolean recursive;
gboolean no_symlinks;
- base_dir = eel_gconf_get_string (PREF_ADD_CURRENT_FOLDER, "");
- filename = eel_gconf_get_string (PREF_ADD_FILENAME, "");
- include_files = eel_gconf_get_string (PREF_ADD_INCLUDE_FILES, "");
- exclude_files = eel_gconf_get_string (PREF_ADD_EXCLUDE_FILES, "");
- exclude_folders = eel_gconf_get_string (PREF_ADD_EXCLUDE_FOLDERS, "");
- update = eel_gconf_get_boolean (PREF_ADD_UPDATE, FALSE);
- recursive = eel_gconf_get_boolean (PREF_ADD_RECURSIVE, TRUE);
- no_symlinks = eel_gconf_get_boolean (PREF_ADD_NO_SYMLINKS, FALSE);
+ base_dir = g_settings_get_string (data->settings, PREF_ADD_CURRENT_FOLDER);
+ filename = g_settings_get_string (data->settings, PREF_ADD_FILENAME);
+ include_files = g_settings_get_string (data->settings, PREF_ADD_INCLUDE_FILES);
+ exclude_files = g_settings_get_string (data->settings, PREF_ADD_EXCLUDE_FILES);
+ exclude_folders = g_settings_get_string (data->settings, PREF_ADD_EXCLUDE_FOLDERS);
+ update = g_settings_get_boolean (data->settings, PREF_ADD_UPDATE);
+ recursive = g_settings_get_boolean (data->settings, PREF_ADD_RECURSIVE);
+ no_symlinks = g_settings_get_boolean (data->settings, PREF_ADD_NO_SYMLINKS);
sync_widgets_with_options (data,
base_dir,
@@ -629,14 +629,14 @@ dlg_add_folder_save_last_options (DialogData *data)
&recursive,
&no_symlinks);
- eel_gconf_set_string (PREF_ADD_CURRENT_FOLDER, base_dir);
- eel_gconf_set_string (PREF_ADD_FILENAME, filename);
- eel_gconf_set_string (PREF_ADD_INCLUDE_FILES, include_files);
- eel_gconf_set_string (PREF_ADD_EXCLUDE_FILES, exclude_files);
- eel_gconf_set_string (PREF_ADD_EXCLUDE_FOLDERS, exclude_folders);
- eel_gconf_set_boolean (PREF_ADD_UPDATE, update);
- eel_gconf_set_boolean (PREF_ADD_RECURSIVE, recursive);
- eel_gconf_set_boolean (PREF_ADD_NO_SYMLINKS, no_symlinks);
+ g_settings_set_string (data->settings, PREF_ADD_CURRENT_FOLDER, base_dir);
+ g_settings_set_string (data->settings, PREF_ADD_FILENAME, filename);
+ g_settings_set_string (data->settings, PREF_ADD_INCLUDE_FILES, include_files);
+ g_settings_set_string (data->settings, PREF_ADD_EXCLUDE_FILES, exclude_files);
+ g_settings_set_string (data->settings, PREF_ADD_EXCLUDE_FOLDERS, exclude_folders);
+ g_settings_set_boolean (data->settings, PREF_ADD_UPDATE, update);
+ g_settings_set_boolean (data->settings, PREF_ADD_RECURSIVE, recursive);
+ g_settings_set_boolean (data->settings, PREF_ADD_NO_SYMLINKS, no_symlinks);
g_free (base_dir);
g_free (filename);
diff --git a/src/dlg-batch-add.c b/src/dlg-batch-add.c
index 65d9412..c1832f8 100644
--- a/src/dlg-batch-add.c
+++ b/src/dlg-batch-add.c
@@ -28,7 +28,6 @@
#include <gtk/gtk.h>
#include "file-utils.h"
#include "fr-stock.h"
-#include "gconf-utils.h"
#include "fr-window.h"
#include "typedefs.h"
#include "gtk-utils.h"
@@ -38,12 +37,13 @@
#define ARCHIVE_ICON_SIZE (48)
-#define DEFAULT_EXTENSION ".tar.gz"
#define BAD_CHARS "/\\*"
typedef struct {
FrWindow *window;
+ GSettings *settings;
+ GSettings *settings_general;
GtkBuilder *builder;
int *supported_types;
@@ -83,9 +83,9 @@ static void
destroy_cb (GtkWidget *widget,
DialogData *data)
{
- eel_gconf_set_string (PREF_BATCH_ADD_DEFAULT_EXTENSION, get_ext (data));
- /*eel_gconf_set_boolean (PREF_BATCH_OTHER_OPTIONS, data->add_clicked ? FALSE : gtk_expander_get_expanded (GTK_EXPANDER (data->a_other_options_expander)));*/
- eel_gconf_set_boolean (PREF_ENCRYPT_HEADER, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->a_encrypt_header_checkbutton)));
+ g_settings_set_string (data->settings, PREF_BATCH_ADD_DEFAULT_EXTENSION, get_ext (data));
+ /*g_settings_set_boolean (data->settings, PREF_BATCH_ADD_OTHER_OPTIONS, data->add_clicked ? FALSE : gtk_expander_get_expanded (GTK_EXPANDER (data->a_other_options_expander)));*/
+ g_settings_set_boolean (data->settings_general, PREF_GENERAL_ENCRYPT_HEADER, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->a_encrypt_header_checkbutton)));
if (! data->add_clicked) {
fr_window_pop_message (data->window);
@@ -93,6 +93,8 @@ destroy_cb (GtkWidget *widget,
}
g_object_unref (data->builder);
+ g_object_unref (data->settings_general);
+ g_object_unref (data->settings);
g_free (data);
}
@@ -124,7 +126,7 @@ set_archive_options (DialogData *data)
value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (data->a_volume_spinbutton));
size = floor (value * MEGABYTE);
- eel_gconf_set_integer (PREF_BATCH_VOLUME_SIZE, size);
+ g_settings_set_int (data->settings, PREF_BATCH_ADD_VOLUME_SIZE, size);
fr_window_set_volume_size (data->window, (guint) size);
}
}
@@ -479,7 +481,8 @@ dlg_batch_add_files (FrWindow *window,
return;
data = g_new0 (DialogData, 1);
-
+ data->settings = g_settings_new (FILE_ROLLER_SCHEMA_BATCH_ADD);
+ data->settings_general = g_settings_new (FILE_ROLLER_SCHEMA_GENERAL);
data->builder = _gtk_builder_new_from_file ("batch-add-files.ui");
if (data->builder == NULL) {
g_free (data);
@@ -521,9 +524,9 @@ dlg_batch_add_files (FrWindow *window,
gtk_button_set_use_stock (GTK_BUTTON (add_button), TRUE);
gtk_button_set_label (GTK_BUTTON (add_button), FR_STOCK_CREATE_ARCHIVE);
- gtk_expander_set_expanded (GTK_EXPANDER (data->a_other_options_expander), FALSE /*eel_gconf_get_boolean (PREF_BATCH_OTHER_OPTIONS, FALSE)*/);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->a_encrypt_header_checkbutton), eel_gconf_get_boolean (PREF_ENCRYPT_HEADER, FALSE));
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->a_volume_spinbutton), (double) eel_gconf_get_integer (PREF_BATCH_VOLUME_SIZE, 0) / MEGABYTE);
+ gtk_expander_set_expanded (GTK_EXPANDER (data->a_other_options_expander), FALSE /*g_settings_get_boolean (data->settings, PREF_BATCH_ADD_OTHER_OPTIONS)*/);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->a_encrypt_header_checkbutton), g_settings_get_boolean (data->settings_general, PREF_GENERAL_ENCRYPT_HEADER));
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->a_volume_spinbutton), (double) g_settings_get_int (data->settings, PREF_BATCH_ADD_VOLUME_SIZE) / MEGABYTE);
first_filename = (char*) file_list->data;
parent = remove_level_from_path (first_filename);
@@ -596,7 +599,7 @@ dlg_batch_add_files (FrWindow *window,
/* Run dialog. */
- default_ext = eel_gconf_get_string (PREF_BATCH_ADD_DEFAULT_EXTENSION, DEFAULT_EXTENSION);
+ default_ext = g_settings_get_string (data->settings, PREF_BATCH_ADD_DEFAULT_EXTENSION);
update_archive_type_combo_box_from_ext (data, default_ext);
g_free (default_ext);
diff --git a/src/dlg-extract.c b/src/dlg-extract.c
index 27f9115..71726ed 100644
--- a/src/dlg-extract.c
+++ b/src/dlg-extract.c
@@ -29,11 +29,11 @@
#include "gtk-utils.h"
#include "fr-window.h"
#include "typedefs.h"
-#include "gconf-utils.h"
typedef struct {
FrWindow *window;
+ GSettings *settings;
GList *selected_files;
char *base_dir_for_selection;
@@ -63,6 +63,7 @@ destroy_cb (GtkWidget *widget,
}
path_list_free (data->selected_files);
g_free (data->base_dir_for_selection);
+ g_object_unref (data->settings);
g_free (data);
}
@@ -190,10 +191,10 @@ extract_cb (GtkWidget *w,
skip_newer = ! gtk_toggle_button_get_inconsistent (GTK_TOGGLE_BUTTON (data->e_not_newer_checkbutton)) && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->e_not_newer_checkbutton));
junk_paths = ! gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->e_recreate_dir_checkbutton));
- eel_gconf_set_boolean (PREF_EXTRACT_OVERWRITE, overwrite);
- if (!gtk_toggle_button_get_inconsistent (GTK_TOGGLE_BUTTON (data->e_not_newer_checkbutton)))
- eel_gconf_set_boolean (PREF_EXTRACT_SKIP_NEWER, skip_newer);
- eel_gconf_set_boolean (PREF_EXTRACT_RECREATE_FOLDERS, !junk_paths);
+ g_settings_set_boolean (data->settings, PREF_EXTRACT_OVERWRITE, overwrite);
+ if (! gtk_toggle_button_get_inconsistent (GTK_TOGGLE_BUTTON (data->e_not_newer_checkbutton)))
+ g_settings_set_boolean (data->settings, PREF_EXTRACT_SKIP_NEWER, skip_newer);
+ g_settings_set_boolean (data->settings, PREF_EXTRACT_RECREATE_FOLDERS, ! junk_paths);
selected_files = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->e_selected_radiobutton));
pattern_files = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->e_files_radiobutton));
@@ -419,7 +420,7 @@ dlg_extract__common (FrWindow *window,
GtkWidget *file_sel;
data = g_new0 (DialogData, 1);
-
+ data->settings = g_settings_new (FILE_ROLLER_SCHEMA_EXTRACT);
data->window = window;
data->selected_files = selected_files;
data->base_dir_for_selection = base_dir_for_selection;
@@ -453,14 +454,14 @@ dlg_extract__common (FrWindow *window,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->e_all_radiobutton), TRUE);
}
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->e_overwrite_checkbutton), eel_gconf_get_boolean (PREF_EXTRACT_OVERWRITE, FALSE));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->e_not_newer_checkbutton), eel_gconf_get_boolean (PREF_EXTRACT_SKIP_NEWER, FALSE));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->e_overwrite_checkbutton), g_settings_get_boolean (data->settings, PREF_EXTRACT_OVERWRITE));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->e_not_newer_checkbutton), g_settings_get_boolean (data->settings, PREF_EXTRACT_SKIP_NEWER));
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->e_overwrite_checkbutton))) {
gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (data->e_not_newer_checkbutton), TRUE);
gtk_widget_set_sensitive (data->e_not_newer_checkbutton, FALSE);
}
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->e_recreate_dir_checkbutton), eel_gconf_get_boolean (PREF_EXTRACT_RECREATE_FOLDERS, TRUE));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->e_recreate_dir_checkbutton), g_settings_get_boolean (data->settings, PREF_EXTRACT_RECREATE_FOLDERS));
/* Set the signals handlers. */
diff --git a/src/dlg-new.c b/src/dlg-new.c
index 5b9337e..f88ae82 100644
--- a/src/dlg-new.c
+++ b/src/dlg-new.c
@@ -28,7 +28,6 @@
#include "dlg-new.h"
#include "file-utils.h"
#include "fr-stock.h"
-#include "gconf-utils.h"
#include "gtk-utils.h"
#include "main.h"
#include "preferences.h"
@@ -271,6 +270,7 @@ dlg_new_archive (FrWindow *window,
DlgNewData *data;
GtkWidget *n_new_button;
GtkFileFilter *filter;
+ GSettings *settings;
/*char *default_ext;*/
int i;
@@ -306,16 +306,8 @@ dlg_new_archive (FrWindow *window,
gtk_dialog_set_default_response (GTK_DIALOG (data->dialog), GTK_RESPONSE_OK);
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (data->dialog), fr_window_get_open_default_dir (window));
- if (default_name != NULL) {
+ if (default_name != NULL)
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (data->dialog), default_name);
- /*char *ext, *name_ext;
-
- ext = eel_gconf_get_string (PREF_BATCH_ADD_DEFAULT_EXTENSION, ".tgz");
- name_ext = g_strconcat (default_name, ext, NULL);
- gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (data->dialog), name_ext);
- g_free (name_ext);
- g_free (ext);*/
- }
filter = gtk_file_filter_new ();
gtk_file_filter_set_name (filter, _("All archives"));
@@ -334,8 +326,14 @@ dlg_new_archive (FrWindow *window,
gtk_button_set_use_stock (GTK_BUTTON (n_new_button), TRUE);
gtk_button_set_label (GTK_BUTTON (n_new_button), FR_STOCK_CREATE_ARCHIVE);
gtk_expander_set_expanded (GTK_EXPANDER (data->n_other_options_expander), FALSE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->n_encrypt_header_checkbutton), eel_gconf_get_boolean (PREF_ENCRYPT_HEADER, FALSE));
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->n_volume_spinbutton), (double) eel_gconf_get_integer (PREF_BATCH_VOLUME_SIZE, 0) / MEGABYTE);
+
+ settings = g_settings_new (FILE_ROLLER_SCHEMA_GENERAL);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->n_encrypt_header_checkbutton), g_settings_get_boolean (settings, PREF_GENERAL_ENCRYPT_HEADER));
+ g_object_unref (settings);
+
+ settings = g_settings_new (FILE_ROLLER_SCHEMA_BATCH_ADD);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->n_volume_spinbutton), (double) g_settings_get_int (settings, PREF_BATCH_ADD_VOLUME_SIZE) / MEGABYTE);
+ g_object_unref (settings);
/* format chooser */
@@ -422,10 +420,6 @@ dlg_new_archive (FrWindow *window,
/* Run dialog. */
-/* default_ext = eel_gconf_get_string (PREF_BATCH_ADD_DEFAULT_EXTENSION, DEFAULT_EXTENSION);
- update_archive_type_combo_box_from_ext (data, default_ext);
- g_free (default_ext);*/
-
update_sensitivity (data);
gtk_window_set_modal (GTK_WINDOW (data->dialog), TRUE);
diff --git a/src/dlg-open-with.c b/src/dlg-open-with.c
index 6fdea07..b3b0a4c 100644
--- a/src/dlg-open-with.c
+++ b/src/dlg-open-with.c
@@ -22,10 +22,8 @@
#include <config.h>
#include <string.h>
-
#include <gtk/gtk.h>
#include "file-utils.h"
-#include "gconf-utils.h"
#include "glib-utils.h"
#include "gtk-utils.h"
#include "main.h"
@@ -38,7 +36,8 @@ enum { ICON_COLUMN, TEXT_COLUMN, DATA_COLUMN, N_COLUMNS };
typedef struct {
FrWindow *window;
- GtkBuilder *builder;
+ GSettings *settings;
+ GtkBuilder *builder;
GtkWidget *dialog;
GtkWidget *o_app_tree_view;
@@ -62,14 +61,12 @@ static void
open_with__destroy_cb (GtkWidget *widget,
DialogData *data)
{
- g_object_unref (G_OBJECT (data->builder));
-
if (data->app_list != NULL)
g_list_free (data->app_list);
-
if (data->file_list != NULL)
path_list_free (data->file_list);
-
+ g_object_unref (data->builder);
+ g_object_unref (data->settings);
g_free (data);
}
@@ -83,7 +80,8 @@ open_cb (GtkWidget *widget,
gboolean present = FALSE;
char *command = NULL;
GList *scan;
- GSList *sscan, *editors;
+ char **editors;
+ int i;
application = gtk_entry_get_text (GTK_ENTRY (data->o_app_entry));
@@ -98,23 +96,25 @@ open_cb (GtkWidget *widget,
/* add the command to the editors list if not already present. */
- editors = eel_gconf_get_string_list (PREF_EDIT_EDITORS);
- for (sscan = editors; sscan && ! present; sscan = sscan->next) {
- char *recent_command = sscan->data;
- if (strcmp (recent_command, application) == 0) {
- command = g_strdup (recent_command);
+ editors = g_settings_get_strv (data->settings, PREF_GENERAL_EDITORS);
+ for (i = 0; ! present && editors[i] != NULL; i++) {
+ if (strcmp (editors[i], application) == 0) {
+ command = g_strdup (editors[i]);
present = TRUE;
}
}
if (! present) {
- editors = g_slist_prepend (editors, g_strdup (application));
+ char **new_editors;
+
+ new_editors = _g_strv_prepend (editors, g_strdup (application));
command = g_strdup (application);
- eel_gconf_set_string_list (PREF_EDIT_EDITORS, editors);
+ g_settings_set_strv (data->settings, PREF_GENERAL_EDITORS, (const gchar * const *) new_editors);
+
+ g_strfreev (new_editors);
}
- g_slist_foreach (editors, (GFunc) g_free, NULL);
- g_slist_free (editors);
+ g_strfreev (editors);
/* exec the application */
@@ -242,8 +242,8 @@ delete_recent_cb (GtkWidget *widget,
if (data->last_clicked_list == data->o_recent_tree_view) {
- char *editor;
- GSList *editors, *link;
+ char *editor;
+ char **editors;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (data->o_recent_tree_view));
if (! gtk_tree_selection_get_selected (selection, NULL, &iter))
@@ -256,17 +256,11 @@ delete_recent_cb (GtkWidget *widget,
/**/
- editors = eel_gconf_get_string_list (PREF_EDIT_EDITORS);
- link = g_slist_find_custom (editors, editor, (GCompareFunc) strcmp);
- if (link != NULL) {
- editors = g_slist_remove_link (editors, link);
- eel_gconf_set_string_list (PREF_EDIT_EDITORS, editors);
- g_free (link->data);
- g_slist_free (link);
- }
- g_slist_foreach (editors, (GFunc) g_free, NULL);
- g_slist_free (editors);
+ editors = g_settings_get_strv (data->settings, PREF_GENERAL_EDITORS);
+ if (_g_strv_remove (editors, editor))
+ g_settings_set_strv (data->settings, PREF_GENERAL_EDITORS, (const gchar * const *) editors);
+ g_strfreev (editors);
g_free (editor);
}
else if (data->last_clicked_list == data->o_app_tree_view) {
@@ -296,22 +290,23 @@ void
dlg_open_with (FrWindow *window,
GList *file_list)
{
- DialogData *data;
- GAppInfo *app;
- GList *scan, *app_names = NULL;
- GSList *sscan, *editors;
- GtkWidget *cancel_button;
- GtkTreeIter iter;
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *column;
- GtkIconTheme *theme;
- int icon_size;
+ DialogData *data;
+ GAppInfo *app;
+ GList *scan, *app_names = NULL;
+ char **editors;
+ int i;
+ GtkWidget *cancel_button;
+ GtkTreeIter iter;
+ GtkCellRenderer *renderer;
+ GtkTreeViewColumn *column;
+ GtkIconTheme *theme;
+ int icon_size;
if (file_list == NULL)
return;
data = g_new0 (DialogData, 1);
-
+ data->settings = g_settings_new (FILE_ROLLER_SCHEMA_GENERAL);
data->builder = _gtk_builder_new_from_file ("open-with.ui");
if (data->builder == NULL) {
g_free (data);
@@ -472,17 +467,14 @@ dlg_open_with (FrWindow *window,
data->recent_model);
g_object_unref (G_OBJECT (data->recent_model));
- editors = eel_gconf_get_string_list (PREF_EDIT_EDITORS);
- for (sscan = editors; sscan; sscan = sscan->next) {
- char *editor = sscan->data;
-
+ editors = g_settings_get_strv (data->settings, PREF_GENERAL_EDITORS);
+ for (i = 0; editors[i] != NULL; i++) {
gtk_list_store_append (GTK_LIST_STORE (data->recent_model), &iter);
gtk_list_store_set (GTK_LIST_STORE (data->recent_model), &iter,
- 0, editor,
+ 0, editors[i],
-1);
}
- g_slist_foreach (editors, (GFunc) g_free, NULL);
- g_slist_free (editors);
+ g_strfreev (editors);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (NULL,
diff --git a/src/dlg-password.c b/src/dlg-password.c
index e258b42..fc8ef71 100644
--- a/src/dlg-password.c
+++ b/src/dlg-password.c
@@ -24,7 +24,6 @@
#include <string.h>
#include <gtk/gtk.h>
#include "fr-window.h"
-#include "gconf-utils.h"
#include "gtk-utils.h"
#include "preferences.h"
@@ -63,7 +62,13 @@ response_cb (GtkWidget *dialog,
g_free (password);
encrypt_header = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->pw_encrypt_header_checkbutton));
- eel_gconf_set_boolean (PREF_ENCRYPT_HEADER, encrypt_header);
+ {
+ GSettings *settings;
+
+ settings = g_settings_new (FILE_ROLLER_SCHEMA_GENERAL);
+ g_settings_set_boolean (settings, PREF_GENERAL_ENCRYPT_HEADER, encrypt_header);
+ g_object_unref (settings);
+ }
fr_window_set_encrypt_header (data->window, encrypt_header);
break;
default:
diff --git a/src/dlg-update.c b/src/dlg-update.c
index 4f280d3..bfcacee 100644
--- a/src/dlg-update.c
+++ b/src/dlg-update.c
@@ -25,7 +25,6 @@
#include <gtk/gtk.h>
#include "dlg-update.h"
#include "file-utils.h"
-#include "gconf-utils.h"
#include "glib-utils.h"
#include "gtk-utils.h"
#include "main.h"
diff --git a/src/file-utils.c b/src/file-utils.c
index e152ca0..838fc9b 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -33,10 +33,8 @@
#include <sys/time.h>
#include <sys/types.h>
#include <dirent.h>
-
#include <glib.h>
#include <gio/gio.h>
-#include <gconf/gconf-client.h>
#include "file-utils.h"
#include "glib-utils.h"
#include "main.h"
diff --git a/src/fr-archive.c b/src/fr-archive.c
index fdbc06c..77003e0 100644
--- a/src/fr-archive.c
+++ b/src/fr-archive.c
@@ -1370,7 +1370,8 @@ create_tmp_base_dir (const char *base_dir,
dir = g_build_filename (temp_dir, "/", dest_dir, NULL);
debug (DEBUG_INFO, "symlink %s --> %s\n", dir, base_dir);
- symlink (base_dir, dir);
+ if (! symlink (base_dir, dir))
+ /* void */;
g_free (dir);
g_free (dest_dir);
diff --git a/src/fr-window.c b/src/fr-window.c
index bf5f9b0..074e1ae 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -49,13 +49,13 @@
#include "glib-utils.h"
#include "main.h"
#include "gtk-utils.h"
-#include "gconf-utils.h"
#include "open-file.h"
#include "typedefs.h"
#include "ui.h"
-#define LAST_OUTPUT_DIALOG_NAME "last_output"
+#undef NAUTILUS_PORTED_TO_GSETTINGS
+#define LAST_OUTPUT_DIALOG_NAME "last-output"
#define MAX_HISTORY_LEN 5
#define ACTIVITY_DELAY 100
#define ACTIVITY_PULSE_STEP (0.033)
@@ -387,7 +387,11 @@ struct _FrWindowPrivateData {
/* misc */
- guint cnxn_id[GCONF_NOTIFICATIONS];
+ GSettings *settings_listing;
+ GSettings *settings_ui;
+ GSettings *settings_general;
+ GSettings *settings_dialogs;
+ GSettings *settings_nautilus;
gulong theme_changed_handler_id;
gboolean non_interactive;
@@ -406,17 +410,6 @@ struct _FrWindowPrivateData {
static void
-fr_window_remove_notifications (FrWindow *window)
-{
- int i;
-
- for (i = 0; i < GCONF_NOTIFICATIONS; i++)
- if (window->priv->cnxn_id[i] != -1)
- eel_gconf_notification_remove (window->priv->cnxn_id[i]);
-}
-
-
-static void
fr_window_free_batch_data (FrWindow *window)
{
GList *scan;
@@ -545,52 +538,48 @@ fr_window_convert_data_free (FrWindow *window,
static void
fr_window_free_private_data (FrWindow *window)
{
- FrWindowPrivateData *priv = window->priv;
-
- if (priv->update_timeout_handle != 0) {
- g_source_remove (priv->update_timeout_handle);
- priv->update_timeout_handle = 0;
+ if (window->priv->update_timeout_handle != 0) {
+ g_source_remove (window->priv->update_timeout_handle);
+ window->priv->update_timeout_handle = 0;
}
- fr_window_remove_notifications (window);
-
- if (priv->open_action != NULL) {
- g_object_unref (priv->open_action);
- priv->open_action = NULL;
+ if (window->priv->open_action != NULL) {
+ g_object_unref (window->priv->open_action);
+ window->priv->open_action = NULL;
}
- if (priv->recent_toolbar_menu != NULL) {
- gtk_widget_destroy (priv->recent_toolbar_menu);
- priv->recent_toolbar_menu = NULL;
+ if (window->priv->recent_toolbar_menu != NULL) {
+ gtk_widget_destroy (window->priv->recent_toolbar_menu);
+ window->priv->recent_toolbar_menu = NULL;
}
- while (priv->activity_ref > 0)
+ while (window->priv->activity_ref > 0)
fr_window_stop_activity_mode (window);
- if (priv->progress_timeout != 0) {
- g_source_remove (priv->progress_timeout);
- priv->progress_timeout = 0;
+ if (window->priv->progress_timeout != 0) {
+ g_source_remove (window->priv->progress_timeout);
+ window->priv->progress_timeout = 0;
}
- if (priv->hide_progress_timeout != 0) {
- g_source_remove (priv->hide_progress_timeout);
- priv->hide_progress_timeout = 0;
+ if (window->priv->hide_progress_timeout != 0) {
+ g_source_remove (window->priv->hide_progress_timeout);
+ window->priv->hide_progress_timeout = 0;
}
- if (priv->theme_changed_handler_id != 0)
- g_signal_handler_disconnect (icon_theme, priv->theme_changed_handler_id);
+ if (window->priv->theme_changed_handler_id != 0)
+ g_signal_handler_disconnect (icon_theme, window->priv->theme_changed_handler_id);
fr_window_history_clear (window);
- g_free (priv->open_default_dir);
- g_free (priv->add_default_dir);
- g_free (priv->extract_default_dir);
- g_free (priv->archive_uri);
+ g_free (window->priv->open_default_dir);
+ g_free (window->priv->add_default_dir);
+ g_free (window->priv->extract_default_dir);
+ g_free (window->priv->archive_uri);
- g_free (priv->password);
- g_free (priv->password_for_paste);
+ g_free (window->priv->password);
+ g_free (window->priv->password_for_paste);
- g_object_unref (priv->list_store);
+ g_object_unref (window->priv->list_store);
if (window->priv->clipboard_data != NULL) {
fr_clipboard_data_unref (window->priv->clipboard_data);
@@ -600,32 +589,32 @@ fr_window_free_private_data (FrWindow *window)
fr_clipboard_data_unref (window->priv->copy_data);
window->priv->copy_data = NULL;
}
- if (priv->copy_from_archive != NULL) {
- g_object_unref (priv->copy_from_archive);
- priv->copy_from_archive = NULL;
+ if (window->priv->copy_from_archive != NULL) {
+ g_object_unref (window->priv->copy_from_archive);
+ window->priv->copy_from_archive = NULL;
}
fr_window_free_open_files (window);
fr_window_convert_data_free (window, TRUE);
- g_clear_error (&priv->drag_error);
- path_list_free (priv->drag_file_list);
- priv->drag_file_list = NULL;
+ g_clear_error (&window->priv->drag_error);
+ path_list_free (window->priv->drag_file_list);
+ window->priv->drag_file_list = NULL;
- if (priv->file_popup_menu != NULL) {
- gtk_widget_destroy (priv->file_popup_menu);
- priv->file_popup_menu = NULL;
+ if (window->priv->file_popup_menu != NULL) {
+ gtk_widget_destroy (window->priv->file_popup_menu);
+ window->priv->file_popup_menu = NULL;
}
- if (priv->folder_popup_menu != NULL) {
- gtk_widget_destroy (priv->folder_popup_menu);
- priv->folder_popup_menu = NULL;
+ if (window->priv->folder_popup_menu != NULL) {
+ gtk_widget_destroy (window->priv->folder_popup_menu);
+ window->priv->folder_popup_menu = NULL;
}
- if (priv->sidebar_folder_popup_menu != NULL) {
- gtk_widget_destroy (priv->sidebar_folder_popup_menu);
- priv->sidebar_folder_popup_menu = NULL;
+ if (window->priv->sidebar_folder_popup_menu != NULL) {
+ gtk_widget_destroy (window->priv->sidebar_folder_popup_menu);
+ window->priv->sidebar_folder_popup_menu = NULL;
}
g_free (window->priv->last_location);
@@ -633,13 +622,19 @@ fr_window_free_private_data (FrWindow *window)
fr_window_free_batch_data (window);
fr_window_reset_current_batch_action (window);
- g_free (priv->pd_last_archive);
- g_free (priv->extract_here_dir);
- g_free (priv->last_status_message);
+ g_free (window->priv->pd_last_archive);
+ g_free (window->priv->extract_here_dir);
+ g_free (window->priv->last_status_message);
+
+ g_settings_set_enum (window->priv->settings_listing, PREF_LISTING_SORT_METHOD, window->priv->sort_method);
+ g_settings_set_enum (window->priv->settings_listing, PREF_LISTING_SORT_TYPE, window->priv->sort_type);
+ g_settings_set_enum (window->priv->settings_listing, PREF_LISTING_LIST_MODE, window->priv->last_list_mode);
- preferences_set_sort_method (priv->sort_method);
- preferences_set_sort_type (priv->sort_type);
- preferences_set_list_mode (priv->last_list_mode);
+ _g_object_unref (window->priv->settings_listing);
+ _g_object_unref (window->priv->settings_ui);
+ _g_object_unref (window->priv->settings_general);
+ _g_object_unref (window->priv->settings_dialogs);
+ _g_object_unref (window->priv->settings_nautilus);
}
@@ -704,16 +699,16 @@ fr_window_close (FrWindow *window)
int width, height;
gdk_drawable_get_size (gtk_widget_get_window (GTK_WIDGET (window)), &width, &height);
- eel_gconf_set_integer (PREF_UI_WINDOW_WIDTH, width);
- eel_gconf_set_integer (PREF_UI_WINDOW_HEIGHT, height);
+ g_settings_set_int (window->priv->settings_ui, PREF_UI_WINDOW_WIDTH, width);
+ g_settings_set_int (window->priv->settings_ui, PREF_UI_WINDOW_HEIGHT, height);
width = gtk_paned_get_position (GTK_PANED (window->priv->paned));
if (width > 0)
- eel_gconf_set_integer (PREF_UI_SIDEBAR_WIDTH, width);
+ g_settings_set_int (window->priv->settings_ui, PREF_UI_SIDEBAR_WIDTH, width);
width = gtk_tree_view_column_get_width (window->priv->filename_column);
if (width > 0)
- eel_gconf_set_integer (PREF_NAME_COLUMN_WIDTH, width);
+ g_settings_set_int (window->priv->settings_listing, PREF_LISTING_NAME_COLUMN_WIDTH, width);
}
g_idle_add (close__step2, window);
@@ -4577,13 +4572,17 @@ fr_window_delete_event_cb (GtkWidget *caller,
static gboolean
-is_single_click_policy (void)
+is_single_click_policy (FrWindow *window)
{
char *value;
gboolean result = FALSE;
- value = eel_gconf_get_string (PREF_NAUTILUS_CLICK_POLICY, "double");
- result = strncmp (value, "single", 6) == 0;
+#if NAUTILUS_PORTED_TO_GSETTINGS
+ value = g_settings_get_string (window->priv->settings_nautilus, NAUTILUS_CLICK_POLICY);
+#else
+ value = g_strdup ("double");
+#endif
+ result = (value != NULL) && (strncmp (value, "single", 6) == 0);
g_free (value);
return result;
@@ -4709,7 +4708,7 @@ add_file_list_columns (FrWindow *window,
/* name */
- window->priv->single_click = is_single_click_policy ();
+ window->priv->single_click = is_single_click_policy (window);
renderer = gtk_cell_renderer_text_new ();
@@ -4726,7 +4725,7 @@ add_file_list_columns (FrWindow *window,
NULL);
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
- w = eel_gconf_get_integer (PREF_NAME_COLUMN_WIDTH, DEFAULT_NAME_COLUMN_WIDTH);
+ w = g_settings_get_int (window->priv->settings_listing, PREF_LISTING_NAME_COLUMN_WIDTH);
if (w <= 0)
w = DEFAULT_NAME_COLUMN_WIDTH;
gtk_tree_view_column_set_fixed_width (column, w);
@@ -4877,10 +4876,10 @@ fr_window_show_cb (GtkWidget *widget,
{
fr_window_update_current_location (window);
- set_active (window, "ViewToolbar", eel_gconf_get_boolean (PREF_UI_TOOLBAR, TRUE));
- set_active (window, "ViewStatusbar", eel_gconf_get_boolean (PREF_UI_STATUSBAR, TRUE));
+ set_active (window, "ViewToolbar", g_settings_get_boolean (window->priv->settings_ui, PREF_UI_VIEW_TOOLBAR));
+ set_active (window, "ViewStatusbar", g_settings_get_boolean (window->priv->settings_ui, PREF_UI_VIEW_STATUSBAR));
- window->priv->view_folders = eel_gconf_get_boolean (PREF_UI_FOLDERS, FALSE);
+ window->priv->view_folders = g_settings_get_boolean (window->priv->settings_ui, PREF_UI_VIEW_FOLDERS);
set_active (window, "ViewFolders", window->priv->view_folders);
fr_window_update_filter_bar_visibility (window);
@@ -4893,61 +4892,56 @@ fr_window_show_cb (GtkWidget *widget,
static void
-pref_history_len_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
+pref_history_len_changed (GSettings *settings,
+ const char *key,
+ gpointer user_data)
{
FrWindow *window = user_data;
- gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (window->priv->recent_chooser_menu), eel_gconf_get_integer (PREF_UI_HISTORY_LEN, MAX_HISTORY_LEN));
- gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (window->priv->recent_chooser_toolbar), eel_gconf_get_integer (PREF_UI_HISTORY_LEN, MAX_HISTORY_LEN));
+ gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (window->priv->recent_chooser_menu),
+ g_settings_get_int (settings, PREF_UI_HISTORY_LEN));
+ gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (window->priv->recent_chooser_toolbar),
+ g_settings_get_int (settings, PREF_UI_HISTORY_LEN));
}
static void
-pref_view_toolbar_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
+pref_view_toolbar_changed (GSettings *settings,
+ const char *key,
+ gpointer user_data)
{
FrWindow *window = user_data;
- g_return_if_fail (window != NULL);
-
- fr_window_set_toolbar_visibility (window, gconf_value_get_bool (gconf_entry_get_value (entry)));
+ fr_window_set_toolbar_visibility (window, g_settings_get_boolean (settings, key));
}
static void
-pref_view_statusbar_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
+pref_view_statusbar_changed (GSettings *settings,
+ const char *key,
+ gpointer user_data)
{
FrWindow *window = user_data;
- fr_window_set_statusbar_visibility (window, gconf_value_get_bool (gconf_entry_get_value (entry)));
+ fr_window_set_statusbar_visibility (window, g_settings_get_boolean (settings, key));
}
static void
-pref_view_folders_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
+pref_view_folders_changed (GSettings *settings,
+ const char *key,
+ gpointer user_data)
{
FrWindow *window = user_data;
- fr_window_set_folders_visibility (window, gconf_value_get_bool (gconf_entry_get_value (entry)));
+ fr_window_set_folders_visibility (window, g_settings_get_boolean (settings, key));
}
static void
-pref_show_field_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
+pref_show_field_changed (GSettings *settings,
+ const char *key,
+ gpointer user_data)
{
FrWindow *window = user_data;
@@ -4955,23 +4949,24 @@ pref_show_field_changed (GConfClient *client,
}
+#if NAUTILUS_PORTED_TO_GSETTINGS
static void
-pref_click_policy_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
+pref_click_policy_changed (GSettings *settings,
+ const char *key,
+ gpointer user_data)
{
FrWindow *window = user_data;
GdkWindow *win = gtk_tree_view_get_bin_window (GTK_TREE_VIEW (window->priv->list_view));
GdkDisplay *display;
- window->priv->single_click = is_single_click_policy ();
+ window->priv->single_click = is_single_click_policy (window);
gdk_window_set_cursor (win, NULL);
display = gtk_widget_get_display (GTK_WIDGET (window->priv->list_view));
if (display != NULL)
gdk_display_flush (display);
}
+#endif
static void gh_unref_pixbuf (gpointer key,
@@ -4980,10 +4975,9 @@ static void gh_unref_pixbuf (gpointer key,
static void
-pref_use_mime_icons_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
+pref_use_mime_icons_changed (GSettings *settings,
+ const char *key,
+ gpointer user_data)
{
FrWindow *window = user_data;
@@ -5228,7 +5222,7 @@ fr_window_init_recent_chooser (FrWindow *window,
gtk_recent_chooser_add_filter (chooser, filter);
gtk_recent_chooser_set_local_only (chooser, FALSE);
- gtk_recent_chooser_set_limit (chooser, eel_gconf_get_integer (PREF_UI_HISTORY_LEN, MAX_HISTORY_LEN));
+ gtk_recent_chooser_set_limit (chooser, g_settings_get_int (window->priv->settings_ui, PREF_UI_HISTORY_LEN));
gtk_recent_chooser_set_show_not_found (chooser, TRUE);
gtk_recent_chooser_set_sort_type (chooser, GTK_RECENT_SORT_MRU);
@@ -5380,10 +5374,21 @@ fr_window_construct (FrWindow *window)
pixbuf_hash = g_hash_table_new (g_str_hash, g_str_equal);
if (tree_pixbuf_hash == NULL)
tree_pixbuf_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
if (icon_theme == NULL)
icon_theme = gtk_icon_theme_get_default ();
+ /* Create the settings objects */
+
+ window->priv->settings_listing = g_settings_new (FILE_ROLLER_SCHEMA_LISTING);
+ window->priv->settings_ui = g_settings_new (FILE_ROLLER_SCHEMA_UI);
+ window->priv->settings_general = g_settings_new (FILE_ROLLER_SCHEMA_GENERAL);
+ window->priv->settings_dialogs = g_settings_new (FILE_ROLLER_SCHEMA_DIALOGS);
+#if NAUTILUS_PORTED_TO_GSETTINGS
+ window->priv->settings_nautilus = g_settings_new (NAUTILUS_SCHEMA);
+#else
+ window->priv->settings_nautilus = NULL;
+#endif
+
/* Create the application. */
window->priv->layout = gtk_table_new (4, 1, FALSE);
@@ -5419,8 +5424,8 @@ fr_window_construct (FrWindow *window)
dir_tree_icon_size = MAX (icon_width, icon_height);
gtk_window_set_default_size (GTK_WINDOW (window),
- eel_gconf_get_integer (PREF_UI_WINDOW_WIDTH, DEF_WIN_WIDTH),
- eel_gconf_get_integer (PREF_UI_WINDOW_HEIGHT, DEF_WIN_HEIGHT));
+ g_settings_get_int (window->priv->settings_ui, PREF_UI_WINDOW_WIDTH),
+ g_settings_get_int (window->priv->settings_ui, PREF_UI_WINDOW_HEIGHT));
gtk_drag_dest_set (GTK_WIDGET (window),
GTK_DEST_DEFAULT_ALL,
@@ -5476,17 +5481,17 @@ fr_window_construct (FrWindow *window)
fr_window_add_is_stoppable,
window);
- window->priv->sort_method = preferences_get_sort_method ();
- window->priv->sort_type = preferences_get_sort_type ();
+ window->priv->sort_method = g_settings_get_enum (window->priv->settings_listing, PREF_LISTING_SORT_METHOD);
+ window->priv->sort_type = g_settings_get_enum (window->priv->settings_listing, PREF_LISTING_SORT_TYPE);
+
+ window->priv->list_mode = window->priv->last_list_mode = g_settings_get_enum (window->priv->settings_listing, PREF_LISTING_LIST_MODE);
+ g_settings_set_boolean (window->priv->settings_listing, PREF_LISTING_SHOW_PATH, (window->priv->list_mode == FR_WINDOW_LIST_MODE_FLAT));
- window->priv->list_mode = window->priv->last_list_mode = preferences_get_list_mode ();
window->priv->history = NULL;
window->priv->history_current = NULL;
window->priv->action = FR_ACTION_NONE;
- eel_gconf_set_boolean (PREF_LIST_SHOW_PATH, (window->priv->list_mode == FR_WINDOW_LIST_MODE_FLAT));
-
window->priv->open_default_dir = g_strdup (get_home_uri ());
window->priv->add_default_dir = g_strdup (get_home_uri ());
window->priv->extract_default_dir = g_strdup (get_home_uri ());
@@ -5514,8 +5519,8 @@ fr_window_construct (FrWindow *window)
window->priv->non_interactive = FALSE;
window->priv->password = NULL;
- window->priv->compression = preferences_get_compression_level ();
- window->priv->encrypt_header = eel_gconf_get_boolean (PREF_ENCRYPT_HEADER, FALSE);
+ window->priv->compression = g_settings_get_enum (window->priv->settings_general, PREF_GENERAL_COMPRESSION_LEVEL);
+ window->priv->encrypt_header = g_settings_get_boolean (window->priv->settings_general, PREF_GENERAL_ENCRYPT_HEADER);
window->priv->volume_size = 0;
window->priv->convert_data.converting = FALSE;
@@ -5741,7 +5746,7 @@ fr_window_construct (FrWindow *window)
window->priv->paned = gtk_hpaned_new ();
gtk_paned_pack1 (GTK_PANED (window->priv->paned), window->priv->sidepane, FALSE, TRUE);
gtk_paned_pack2 (GTK_PANED (window->priv->paned), list_scrolled_window, TRUE, TRUE);
- gtk_paned_set_position (GTK_PANED (window->priv->paned), eel_gconf_get_integer (PREF_UI_SIDEBAR_WIDTH, DEF_SIDEBAR_WIDTH));
+ gtk_paned_set_position (GTK_PANED (window->priv->paned), g_settings_get_int (window->priv->settings_ui, PREF_UI_SIDEBAR_WIDTH));
fr_window_attach (FR_WINDOW (window), window->priv->paned, FR_WINDOW_AREA_CONTENTS);
gtk_widget_show_all (window->priv->paned);
@@ -5883,7 +5888,7 @@ fr_window_construct (FrWindow *window)
/**/
fr_window_attach (FR_WINDOW (window), window->priv->toolbar, FR_WINDOW_AREA_TOOLBAR);
- if (eel_gconf_get_boolean (PREF_UI_TOOLBAR, TRUE))
+ if (g_settings_get_boolean (window->priv->settings_ui, PREF_UI_VIEW_TOOLBAR))
gtk_widget_show (toolbar);
else
gtk_widget_hide (toolbar);
@@ -5929,7 +5934,7 @@ fr_window_construct (FrWindow *window)
gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (window->priv->statusbar), TRUE);
fr_window_attach (FR_WINDOW (window), window->priv->statusbar, FR_WINDOW_AREA_STATUSBAR);
- if (eel_gconf_get_boolean (PREF_UI_STATUSBAR, TRUE))
+ if (g_settings_get_boolean (window->priv->settings_ui, PREF_UI_VIEW_STATUSBAR))
gtk_widget_show (window->priv->statusbar);
else
gtk_widget_hide (window->priv->statusbar);
@@ -5945,49 +5950,48 @@ fr_window_construct (FrWindow *window)
/* Add notification callbacks. */
- i = 0;
-
- window->priv->cnxn_id[i++] = eel_gconf_notification_add (
- PREF_UI_HISTORY_LEN,
- pref_history_len_changed,
- window);
- window->priv->cnxn_id[i++] = eel_gconf_notification_add (
- PREF_UI_TOOLBAR,
- pref_view_toolbar_changed,
- window);
- window->priv->cnxn_id[i++] = eel_gconf_notification_add (
- PREF_UI_STATUSBAR,
- pref_view_statusbar_changed,
- window);
- window->priv->cnxn_id[i++] = eel_gconf_notification_add (
- PREF_UI_FOLDERS,
- pref_view_folders_changed,
- window);
- window->priv->cnxn_id[i++] = eel_gconf_notification_add (
- PREF_LIST_SHOW_TYPE,
- pref_show_field_changed,
- window);
- window->priv->cnxn_id[i++] = eel_gconf_notification_add (
- PREF_LIST_SHOW_SIZE,
- pref_show_field_changed,
- window);
- window->priv->cnxn_id[i++] = eel_gconf_notification_add (
- PREF_LIST_SHOW_TIME,
- pref_show_field_changed,
- window);
- window->priv->cnxn_id[i++] = eel_gconf_notification_add (
- PREF_LIST_SHOW_PATH,
- pref_show_field_changed,
- window);
- window->priv->cnxn_id[i++] = eel_gconf_notification_add (
- PREF_LIST_USE_MIME_ICONS,
- pref_use_mime_icons_changed,
- window);
-
- window->priv->cnxn_id[i++] = eel_gconf_notification_add (
- PREF_NAUTILUS_CLICK_POLICY,
- pref_click_policy_changed,
- window);
+ g_signal_connect (window->priv->settings_ui,
+ "changed::" PREF_UI_HISTORY_LEN,
+ G_CALLBACK (pref_history_len_changed),
+ window);
+ g_signal_connect (window->priv->settings_ui,
+ "changed::" PREF_UI_VIEW_TOOLBAR,
+ G_CALLBACK (pref_view_toolbar_changed),
+ window);
+ g_signal_connect (window->priv->settings_ui,
+ "changed::" PREF_UI_VIEW_STATUSBAR,
+ G_CALLBACK (pref_view_statusbar_changed),
+ window);
+ g_signal_connect (window->priv->settings_ui,
+ "changed::" PREF_UI_VIEW_FOLDERS,
+ G_CALLBACK (pref_view_folders_changed),
+ window);
+ g_signal_connect (window->priv->settings_listing,
+ "changed::" PREF_LISTING_SHOW_TYPE,
+ G_CALLBACK (pref_show_field_changed),
+ window);
+ g_signal_connect (window->priv->settings_listing,
+ "changed::" PREF_LISTING_SHOW_SIZE,
+ G_CALLBACK (pref_show_field_changed),
+ window);
+ g_signal_connect (window->priv->settings_listing,
+ "changed::" PREF_LISTING_SHOW_TIME,
+ G_CALLBACK (pref_show_field_changed),
+ window);
+ g_signal_connect (window->priv->settings_listing,
+ "changed::" PREF_LISTING_SHOW_PATH,
+ G_CALLBACK (pref_show_field_changed),
+ window);
+ g_signal_connect (window->priv->settings_listing,
+ "changed::" PREF_LISTING_USE_MIME_ICONS,
+ G_CALLBACK (pref_use_mime_icons_changed),
+ window);
+#if NAUTILUS_PORTED_TO_GSETTINGS
+ g_signal_connect (window->priv->settings_nautilus,
+ "changed::" NAUTILUS_CLICK_POLICY,
+ G_CALLBACK (pref_click_policy_changed),
+ window);
+#endif
/* Give focus to the list. */
@@ -6903,8 +6907,8 @@ fr_window_set_list_mode (FrWindow *window,
fr_window_history_add (window, "/");
}
- preferences_set_list_mode (window->priv->last_list_mode);
- eel_gconf_set_boolean (PREF_LIST_SHOW_PATH, (window->priv->list_mode == FR_WINDOW_LIST_MODE_FLAT));
+ g_settings_set_enum (window->priv->settings_listing, PREF_LISTING_LIST_MODE, window->priv->last_list_mode);
+ g_settings_set_boolean (window->priv->settings_listing, PREF_LISTING_SHOW_PATH, (window->priv->list_mode == FR_WINDOW_LIST_MODE_FLAT));
fr_window_update_file_list (window, TRUE);
fr_window_update_dir_tree (window);
@@ -8419,16 +8423,16 @@ fr_window_update_columns_visibility (FrWindow *window)
GtkTreeViewColumn *column;
column = gtk_tree_view_get_column (tree_view, 1);
- gtk_tree_view_column_set_visible (column, eel_gconf_get_boolean (PREF_LIST_SHOW_SIZE, TRUE));
+ gtk_tree_view_column_set_visible (column, g_settings_get_boolean (window->priv->settings_listing, PREF_LISTING_SHOW_SIZE));
column = gtk_tree_view_get_column (tree_view, 2);
- gtk_tree_view_column_set_visible (column, eel_gconf_get_boolean (PREF_LIST_SHOW_TYPE, TRUE));
+ gtk_tree_view_column_set_visible (column, g_settings_get_boolean (window->priv->settings_listing, PREF_LISTING_SHOW_TYPE));
column = gtk_tree_view_get_column (tree_view, 3);
- gtk_tree_view_column_set_visible (column, eel_gconf_get_boolean (PREF_LIST_SHOW_TIME, TRUE));
+ gtk_tree_view_column_set_visible (column, g_settings_get_boolean (window->priv->settings_listing, PREF_LISTING_SHOW_TIME));
column = gtk_tree_view_get_column (tree_view, 4);
- gtk_tree_view_column_set_visible (column, eel_gconf_get_boolean (PREF_LIST_SHOW_PATH, TRUE));
+ gtk_tree_view_column_set_visible (column, g_settings_get_boolean (window->priv->settings_listing, PREF_LISTING_SHOW_PATH));
}
diff --git a/src/fr-window.h b/src/fr-window.h
index b136af2..905fd29 100644
--- a/src/fr-window.h
+++ b/src/fr-window.h
@@ -28,7 +28,6 @@
#include "typedefs.h"
#include "fr-archive.h"
-#define GCONF_NOTIFICATIONS 10
enum {
COLUMN_FILE_DATA,
diff --git a/src/glib-utils.c b/src/glib-utils.c
index 7935f13..4773f36 100644
--- a/src/glib-utils.c
+++ b/src/glib-utils.c
@@ -25,12 +25,37 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <glib/gprintf.h>
+#include <glib-object.h>
#include "glib-utils.h"
#define MAX_PATTERNS 128
+/* gobject utils*/
+
+
+gpointer
+_g_object_ref (gpointer object)
+{
+ if (object != NULL)
+ return g_object_ref (object);
+ else
+ return NULL;
+}
+
+
+void
+_g_object_unref (gpointer object)
+{
+ if (object != NULL)
+ g_object_unref (object);
+}
+
+
+/* string utils */
+
+
gboolean
strchrs (const char *str,
const char *chars)
@@ -643,3 +668,46 @@ g_uri_display_basename (const char *uri)
return name;
}
+
+
+char **
+_g_strv_prepend (char **str_array,
+ const char *str)
+{
+ char **result;
+ int i;
+ int j;
+
+ result = g_new (char *, g_strv_length (str_array) + 1);
+ i = 0;
+ result[i++] = g_strdup (str);
+ for (j = 0; str_array[j] != NULL; j++)
+ result[i++] = g_strdup (str_array[j]);
+ result[i] = NULL;
+
+ return result;
+}
+
+
+gboolean
+_g_strv_remove (char **str_array,
+ const char *str)
+{
+ int i;
+ int j;
+
+ if (str == NULL)
+ return FALSE;
+
+ for (i = 0; str_array[i] != NULL; i++)
+ if (strcmp (str_array[i], str) == 0)
+ break;
+
+ if (str_array[i] == NULL)
+ return FALSE;
+
+ for (j = i; str_array[j] != NULL; j++)
+ str_array[j] = str_array[j + 1];
+
+ return TRUE;
+}
diff --git a/src/glib-utils.h b/src/glib-utils.h
index 3ef92d2..233cb95 100644
--- a/src/glib-utils.h
+++ b/src/glib-utils.h
@@ -29,6 +29,13 @@
g_signal_handlers_disconnect_matched ((instance), G_SIGNAL_MATCH_DATA, \
0, 0, NULL, NULL, (data))
+/* gobject utils */
+
+gpointer _g_object_ref (gpointer object);
+void _g_object_unref (gpointer object);
+
+/* string utils */
+
gboolean strchrs (const char *str,
const char *chars);
char * str_substitute (const char *str,
@@ -69,6 +76,10 @@ int g_ptr_array_binary_search (GPtrArray *array,
GCompareFunc func);
const char * get_static_string (const char *s);
char* g_uri_display_basename (const char *uri);
+char ** _g_strv_prepend (char **str_array,
+ const char *str);
+gboolean _g_strv_remove (char **str_array,
+ const char *str);
/**/
diff --git a/src/main.c b/src/main.c
index 1056241..4b54a5b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -49,7 +49,6 @@
#include "fr-command-lrzip.h"
#include "fr-process.h"
#include "fr-stock.h"
-#include "gconf-utils.h"
#include "fr-window.h"
#include "typedefs.h"
#include "preferences.h"
@@ -335,9 +334,6 @@ main (int argc, char **argv)
static void
initialize_data (void)
{
- eel_gconf_monitor_add ("/apps/file-roller");
- eel_gconf_monitor_add (PREF_NAUTILUS_CLICK_POLICY);
-
ProgramsCache = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
@@ -385,87 +381,12 @@ release_data ()
{
g_hash_table_destroy (ProgramsCache);
- eel_global_client_free ();
-
while (CommandList != NULL) {
CommandData *cdata = CommandList->data;
command_done (cdata);
}
}
-/* Create the windows. */
-
-
-static void
-migrate_dir_from_to (const char *from_dir,
- const char *to_dir)
-{
- char *from_path;
- char *to_path;
-
- from_path = get_home_relative_path (from_dir);
- to_path = get_home_relative_path (to_dir);
-
- if (uri_is_dir (from_path) && ! uri_exists (to_path)) {
- char *line;
- char *e1;
- char *e2;
-
- e1 = g_shell_quote (from_path);
- e2 = g_shell_quote (to_path);
- line = g_strdup_printf ("mv -f %s %s", e1, e2);
- g_free (e1);
- g_free (e2);
-
- g_spawn_command_line_sync (line, NULL, NULL, NULL, NULL);
- g_free (line);
- }
-
- g_free (from_path);
- g_free (to_path);
-}
-
-
-static void
-migrate_file_from_to (const char *from_file,
- const char *to_file)
-{
- char *from_path;
- char *to_path;
-
- from_path = get_home_relative_path (from_file);
- to_path = get_home_relative_path (to_file);
-
- if (uri_is_file (from_path) && ! uri_exists (to_path)) {
- char *line;
- char *e1;
- char *e2;
-
- e1 = g_shell_quote (from_path);
- e2 = g_shell_quote (to_path);
- line = g_strdup_printf ("mv -f %s %s", e1, e2);
- g_free (e1);
- g_free (e2);
-
- g_spawn_command_line_sync (line, NULL, NULL, NULL, NULL);
- g_free (line);
- }
-
- g_free (from_path);
- g_free (to_path);
-}
-
-
-static void
-migrate_to_new_directories (void)
-{
- migrate_dir_from_to (OLD_RC_OPTIONS_DIR, RC_OPTIONS_DIR);
- migrate_file_from_to (OLD_RC_BOOKMARKS_FILE, RC_BOOKMARKS_FILE);
- migrate_file_from_to (OLD_RC_RECENT_FILE, RC_RECENT_FILE);
-
- eel_gconf_set_boolean (PREF_MIGRATE_DIRECTORIES, FALSE);
-}
-
/* -- FrRegisteredCommand -- */
@@ -915,7 +836,7 @@ prepare_app (void)
uri = get_home_relative_uri (RC_DIR);
- if (uri_is_file (uri)) { /* before the gconf port this was a file, now it's folder. */
+ if (uri_is_file (uri)) { /* before the GConf port this was a file, now it's folder. */
GFile *file;
file = g_file_new_for_uri (uri);
@@ -926,9 +847,6 @@ prepare_app (void)
ensure_dir_exists (uri, 0700, NULL);
g_free (uri);
- if (eel_gconf_get_boolean (PREF_MIGRATE_DIRECTORIES, TRUE))
- migrate_to_new_directories ();
-
register_commands ();
compute_supported_archive_types ();
diff --git a/src/preferences.c b/src/preferences.c
index 22683d2..176e059 100644
--- a/src/preferences.c
+++ b/src/preferences.c
@@ -21,248 +21,52 @@
*/
#include <string.h>
-#include <gconf/gconf-client.h>
#include "typedefs.h"
#include "preferences.h"
#include "main.h"
#include "file-utils.h"
-#include "gconf-utils.h"
#include "fr-window.h"
-#define DIALOG_PREFIX "/apps/file-roller/dialogs/"
-
-
-typedef struct {
- int i_value;
- char *s_value;
-} EnumStringTable;
-
-
-static int
-get_enum_from_string (EnumStringTable *table,
- const char *s_value)
-{
- int i;
-
- /* return the first value if s_value is invalid */
-
- if (s_value == NULL)
- return table[0].i_value;
-
- for (i = 0; table[i].s_value != NULL; i++)
- if (strcmp (s_value, table[i].s_value) == 0)
- return table[i].i_value;
-
- return table[0].i_value;
-}
-
-
-static char *
-get_string_from_enum (EnumStringTable *table,
- int i_value)
-{
- int i;
-
- for (i = 0; table[i].s_value != NULL; i++)
- if (i_value == table[i].i_value)
- return table[i].s_value;
-
- /* return the first value if i_value is invalid */
-
- return table[0].s_value;
-}
-
-
-/* --------------- */
-
-
-static EnumStringTable sort_method_table [] = {
- { FR_WINDOW_SORT_BY_NAME, "name" },
- { FR_WINDOW_SORT_BY_SIZE, "size" },
- { FR_WINDOW_SORT_BY_TYPE, "type" },
- { FR_WINDOW_SORT_BY_TIME, "time" },
- { FR_WINDOW_SORT_BY_PATH, "path" },
- { 0, NULL }
-};
-
-static EnumStringTable sort_type_table [] = {
- { GTK_SORT_ASCENDING, "ascending" },
- { GTK_SORT_DESCENDING, "descending" },
- { 0, NULL }
-};
-
-static EnumStringTable list_mode_table [] = {
- { FR_WINDOW_LIST_MODE_FLAT, "all_files" },
- { FR_WINDOW_LIST_MODE_AS_DIR, "as_folder" },
- { 0, NULL }
-};
-
-static EnumStringTable compression_level_table [] = {
- { FR_COMPRESSION_VERY_FAST, "very_fast" },
- { FR_COMPRESSION_FAST, "fast" },
- { FR_COMPRESSION_NORMAL, "normal" },
- { FR_COMPRESSION_MAXIMUM, "maximum" },
- { 0, NULL }
-};
-
-
-/* --------------- */
-
-
-FrWindowSortMethod
-preferences_get_sort_method (void)
-{
- char *s_value;
- int i_value;
-
- s_value = eel_gconf_get_string (PREF_LIST_SORT_METHOD, "name");
- i_value = get_enum_from_string (sort_method_table, s_value);
- g_free (s_value);
-
- return (FrWindowSortMethod) i_value;
-}
-
-
-void
-preferences_set_sort_method (FrWindowSortMethod i_value)
-{
- char *s_value;
-
- s_value = get_string_from_enum (sort_method_table, i_value);
- eel_gconf_set_string (PREF_LIST_SORT_METHOD, s_value);
-}
-
-
-GtkSortType
-preferences_get_sort_type (void)
-{
- char *s_value;
- int i_value;
-
- s_value = eel_gconf_get_string (PREF_LIST_SORT_TYPE, "ascending");
- i_value = get_enum_from_string (sort_type_table, s_value);
- g_free (s_value);
-
- return (GtkSortType) i_value;
-}
-
-
-void
-preferences_set_sort_type (GtkSortType i_value)
-{
- char *s_value;
-
- s_value = get_string_from_enum (sort_type_table, i_value);
- eel_gconf_set_string (PREF_LIST_SORT_TYPE, s_value);
-}
-
-
-FrWindowListMode
-preferences_get_list_mode (void)
-{
- char *s_value;
- int i_value;
-
- s_value = eel_gconf_get_string (PREF_LIST_MODE, "as_folder");
- i_value = get_enum_from_string (list_mode_table, s_value);
- g_free (s_value);
-
- return (FrWindowListMode) i_value;
-}
-
-
-void
-preferences_set_list_mode (FrWindowListMode i_value)
-{
- char *s_value;
-
- s_value = get_string_from_enum (list_mode_table, i_value);
- eel_gconf_set_string (PREF_LIST_MODE, s_value);
-}
-
-
-FrCompression
-preferences_get_compression_level (void)
-{
- char *s_value;
- int i_value;
-
- s_value = eel_gconf_get_string (PREF_ADD_COMPRESSION_LEVEL, "normal");
- i_value = get_enum_from_string (compression_level_table, s_value);
- g_free (s_value);
-
- return (FrCompression) i_value;
-}
-
-
-void
-preferences_set_compression_level (FrCompression i_value)
-{
- char *s_value;
-
- s_value = get_string_from_enum (compression_level_table, i_value);
- eel_gconf_set_string (PREF_ADD_COMPRESSION_LEVEL, s_value);
-}
-
-
-static void
-set_dialog_property_int (const char *dialog,
- const char *property,
- int value)
-{
- char *key;
-
- key = g_strconcat (DIALOG_PREFIX, dialog, "/", property, NULL);
- eel_gconf_set_integer (key, value);
- g_free (key);
-}
-
-
void
pref_util_save_window_geometry (GtkWindow *window,
- const char *dialog)
+ const char *dialog_id)
{
- int x, y, width, height;
+ char *schema;
+ GSettings *settings;
+ int width;
+ int height;
- gtk_window_get_position (window, &x, &y);
- set_dialog_property_int (dialog, "x", x);
- set_dialog_property_int (dialog, "y", y);
+ schema = g_strconcat (FILE_ROLLER_SCHEMA_DIALOGS, ".", dialog_id, NULL);
+ settings = g_settings_new (schema);
gtk_window_get_size (window, &width, &height);
- set_dialog_property_int (dialog, "width", width);
- set_dialog_property_int (dialog, "height", height);
-}
-
+ g_settings_set_int (settings, "width", width);
+ g_settings_set_int (settings, "height", height);
-static int
-get_dialog_property_int (const char *dialog,
- const char *property)
-{
- char *key;
- int value;
-
- key = g_strconcat (DIALOG_PREFIX, dialog, "/", property, NULL);
- value = eel_gconf_get_integer (key, -1);
- g_free (key);
-
- return value;
+ g_object_unref (settings);
+ g_free (schema);
}
void
pref_util_restore_window_geometry (GtkWindow *window,
- const char *dialog)
+ const char *dialog_id)
{
- int x, y, width, height;
+ char *schema;
+ GSettings *settings;
+ int width;
+ int height;
- x = get_dialog_property_int (dialog, "x");
- y = get_dialog_property_int (dialog, "y");
- width = get_dialog_property_int (dialog, "width");
- height = get_dialog_property_int (dialog, "height");
+ schema = g_strconcat (FILE_ROLLER_SCHEMA_DIALOGS, ".", dialog_id, NULL);
+ settings = g_settings_new (schema);
- if (width != -1 && height != 1)
+ width = g_settings_get_int (settings, "width");
+ height = g_settings_get_int (settings, "height");
+ if ((width != -1) && (height != 1))
gtk_window_set_default_size (window, width, height);
-
gtk_window_present (window);
+
+ g_object_unref (settings);
+ g_free (schema);
}
diff --git a/src/preferences.h b/src/preferences.h
index 1cb9385..5f03074 100644
--- a/src/preferences.h
+++ b/src/preferences.h
@@ -3,7 +3,7 @@
/*
* File-Roller
*
- * Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2003, 2010 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,63 +27,61 @@
#include "typedefs.h"
#include "fr-window.h"
-#define PREF_LIST_SORT_METHOD "/apps/file-roller/listing/sort_method"
-#define PREF_LIST_SORT_TYPE "/apps/file-roller/listing/sort_type"
-#define PREF_LIST_MODE "/apps/file-roller/listing/list_mode"
-#define PREF_LIST_SHOW_TYPE "/apps/file-roller/listing/show_type"
-#define PREF_LIST_SHOW_SIZE "/apps/file-roller/listing/show_size"
-#define PREF_LIST_SHOW_TIME "/apps/file-roller/listing/show_time"
-#define PREF_LIST_SHOW_PATH "/apps/file-roller/listing/show_path"
-#define PREF_LIST_USE_MIME_ICONS "/apps/file-roller/listing/use_mime_icons"
-#define PREF_NAME_COLUMN_WIDTH "/apps/file-roller/listing/name_column_width"
+#define FILE_ROLLER_SCHEMA "org.gnome.file-roller"
+#define FILE_ROLLER_SCHEMA_LISTING FILE_ROLLER_SCHEMA ".listing"
+#define FILE_ROLLER_SCHEMA_UI FILE_ROLLER_SCHEMA ".ui"
+#define FILE_ROLLER_SCHEMA_GENERAL FILE_ROLLER_SCHEMA ".general"
+#define FILE_ROLLER_SCHEMA_DIALOGS FILE_ROLLER_SCHEMA ".dialogs"
+#define FILE_ROLLER_SCHEMA_ADD FILE_ROLLER_SCHEMA_DIALOGS ".add"
+#define FILE_ROLLER_SCHEMA_BATCH_ADD FILE_ROLLER_SCHEMA_DIALOGS ".batch-add"
+#define FILE_ROLLER_SCHEMA_EXTRACT FILE_ROLLER_SCHEMA_DIALOGS ".extract"
+#define FILE_ROLLER_SCHEMA_LAST_OUTPUT FILE_ROLLER_SCHEMA_DIALOGS ".last-output"
-#define PREF_UI_WINDOW_WIDTH "/apps/file-roller/ui/window_width"
-#define PREF_UI_WINDOW_HEIGHT "/apps/file-roller/ui/window_height"
-#define PREF_UI_SIDEBAR_WIDTH "/apps/file-roller/ui/sidebar_width"
-#define PREF_UI_HISTORY_LEN "/apps/file-roller/ui/history_len"
-#define PREF_UI_TOOLBAR "/apps/file-roller/ui/view_toolbar"
-#define PREF_UI_STATUSBAR "/apps/file-roller/ui/view_statusbar"
-#define PREF_UI_FOLDERS "/apps/file-roller/ui/view_folders"
+#define PREF_LISTING_SORT_METHOD "sort-method"
+#define PREF_LISTING_SORT_TYPE "sort-type"
+#define PREF_LISTING_LIST_MODE "list-mode"
+#define PREF_LISTING_SHOW_TYPE "show-type"
+#define PREF_LISTING_SHOW_SIZE "show-size"
+#define PREF_LISTING_SHOW_TIME "show-time"
+#define PREF_LISTING_SHOW_PATH "show-path"
+#define PREF_LISTING_USE_MIME_ICONS "use-mime-icons"
+#define PREF_LISTING_NAME_COLUMN_WIDTH "name-column-width"
-#define PREF_EDIT_EDITORS "/apps/file-roller/general/editors"
-#define PREF_ADD_COMPRESSION_LEVEL "/apps/file-roller/general/compression_level"
-#define PREF_ENCRYPT_HEADER "/apps/file-roller/general/encrypt_header"
-#define PREF_MIGRATE_DIRECTORIES "/apps/file-roller/general/migrate_directories"
+#define PREF_UI_WINDOW_WIDTH "window-width"
+#define PREF_UI_WINDOW_HEIGHT "window-height"
+#define PREF_UI_SIDEBAR_WIDTH "sidebar-width"
+#define PREF_UI_HISTORY_LEN "history-len"
+#define PREF_UI_VIEW_TOOLBAR "view-toolbar"
+#define PREF_UI_VIEW_STATUSBAR "view-statusbar"
+#define PREF_UI_VIEW_FOLDERS "view-folders"
-#define PREF_EXTRACT_OVERWRITE "/apps/file-roller/dialogs/extract/overwrite"
-#define PREF_EXTRACT_SKIP_NEWER "/apps/file-roller/dialogs/extract/skip_newer"
-#define PREF_EXTRACT_RECREATE_FOLDERS "/apps/file-roller/dialogs/extract/recreate_folders"
+#define PREF_GENERAL_EDITORS "editors"
+#define PREF_GENERAL_COMPRESSION_LEVEL "compression-level"
+#define PREF_GENERAL_ENCRYPT_HEADER "encrypt-header"
-#define PREF_ADD_CURRENT_FOLDER "/apps/file-roller/dialogs/add/current_folder"
-#define PREF_ADD_FILENAME "/apps/file-roller/dialogs/add/filename"
-#define PREF_ADD_INCLUDE_FILES "/apps/file-roller/dialogs/add/include_files"
-#define PREF_ADD_EXCLUDE_FILES "/apps/file-roller/dialogs/add/exclude_files"
-#define PREF_ADD_EXCLUDE_FOLDERS "/apps/file-roller/dialogs/add/exclude_folders"
-#define PREF_ADD_UPDATE "/apps/file-roller/dialogs/add/update"
-#define PREF_ADD_RECURSIVE "/apps/file-roller/dialogs/add/recursive"
-#define PREF_ADD_NO_SYMLINKS "/apps/file-roller/dialogs/add/no_symlinks"
+#define PREF_EXTRACT_OVERWRITE "overwrite"
+#define PREF_EXTRACT_SKIP_NEWER "skip-newer"
+#define PREF_EXTRACT_RECREATE_FOLDERS "recreate-folders"
-#define PREF_BATCH_ADD_DEFAULT_EXTENSION "/apps/file-roller/dialogs/batch-add/default_extension"
-#define PREF_BATCH_OTHER_OPTIONS "/apps/file-roller/dialogs/batch-add/other_options"
-#define PREF_BATCH_VOLUME_SIZE "/apps/file-roller/dialogs/batch-add/volume_size"
+#define PREF_ADD_CURRENT_FOLDER "current-folder"
+#define PREF_ADD_FILENAME "filename"
+#define PREF_ADD_INCLUDE_FILES "include-files"
+#define PREF_ADD_EXCLUDE_FILES "exclude-files"
+#define PREF_ADD_EXCLUDE_FOLDERS "exclude-folders"
+#define PREF_ADD_UPDATE "update"
+#define PREF_ADD_RECURSIVE "recursive"
+#define PREF_ADD_NO_SYMLINKS "no-symlinks"
-#define PREF_DESKTOP_ICON_THEME "/desktop/gnome/file_views/icon_theme"
-#define PREF_DESKTOP_MENUS_HAVE_TEAROFF "/desktop/gnome/interface/menus_have_tearoff"
-#define PREF_DESKTOP_MENUBAR_DETACHABLE "/desktop/gnome/interface/menubar_detachable"
-#define PREF_DESKTOP_TOOLBAR_DETACHABLE "/desktop/gnome/interface/toolbar_detachable"
-#define PREF_NAUTILUS_CLICK_POLICY "/apps/nautilus/preferences/click_policy"
+#define PREF_BATCH_ADD_DEFAULT_EXTENSION "default-extension"
+#define PREF_BATCH_ADD_OTHER_OPTIONS "other-options"
+#define PREF_BATCH_ADD_VOLUME_SIZE "volume-size"
-FrWindowSortMethod preferences_get_sort_method (void);
-void preferences_set_sort_method (FrWindowSortMethod i_value);
-GtkSortType preferences_get_sort_type (void);
-void preferences_set_sort_type (GtkSortType i_value);
-FrWindowListMode preferences_get_list_mode (void);
-void preferences_set_list_mode (FrWindowListMode i_value);
-FrCompression preferences_get_compression_level (void);
-void preferences_set_compression_level (FrCompression i_value);
-void pref_util_save_window_geometry (GtkWindow *window,
- const char *dialog);
-void pref_util_restore_window_geometry (GtkWindow *window,
- const char *dialog);
+#define NAUTILUS_SCHEMA "org.gnome.nautilus.general"
+#define NAUTILUS_CLICK_POLICY "click-policy"
+
+void pref_util_save_window_geometry (GtkWindow *window,
+ const char *dialog_id);
+void pref_util_restore_window_geometry (GtkWindow *window,
+ const char *dialog_id);
#endif /* PREFERENCES_H */
diff --git a/src/typedefs.h b/src/typedefs.h
index 2fe31d7..0f7bb51 100644
--- a/src/typedefs.h
+++ b/src/typedefs.h
@@ -23,6 +23,9 @@
#ifndef TYPEDEFS_H
#define TYPEDEFS_H
+#include <glib.h>
+#include <glib-object.h>
+
#define MEGABYTE (1024 * 1024)
#define RC_DIR ".gnome2/file-roller"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]