nautilus r15138 - in trunk: . src/file-manager
- From: alexl svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus r15138 - in trunk: . src/file-manager
- Date: Thu, 19 Mar 2009 12:15:02 +0000 (UTC)
Author: alexl
Date: Thu Mar 19 12:15:02 2009
New Revision: 15138
URL: http://svn.gnome.org/viewvc/nautilus?rev=15138&view=rev
Log:
2009-03-19 Alexander Larsson <alexl redhat com>
* src/file-manager/fm-ditem-page.c:
(item_entry_free):
(save_entry):
(build_table):
Don't save desktop files if nothing actually changed.
Modified:
trunk/ChangeLog
trunk/src/file-manager/fm-ditem-page.c
Modified: trunk/src/file-manager/fm-ditem-page.c
==============================================================================
--- trunk/src/file-manager/fm-ditem-page.c (original)
+++ trunk/src/file-manager/fm-ditem-page.c Thu Mar 19 12:15:02 2009
@@ -39,6 +39,7 @@
typedef struct ItemEntry {
const char *field;
const char *description;
+ char *current_value;
gboolean localized;
gboolean filename;
} ItemEntry;
@@ -149,6 +150,7 @@
static void
item_entry_free (ItemEntry *entry)
{
+ g_free (entry->current_value);
g_free (entry);
}
@@ -245,6 +247,13 @@
item_entry = g_object_get_data (G_OBJECT (entry), "item_entry");
val = gtk_entry_get_text (entry);
+ if (strcmp (val, item_entry->current_value) == 0) {
+ return; /* No actual change, don't update file */
+ }
+
+ g_free (item_entry->current_value);
+ item_entry->current_value = g_strdup (val);
+
if (item_entry->localized) {
languages = (gchar **) g_get_language_names ();
g_key_file_set_locale_string (key_file, MAIN_GROUP, item_entry->field, languages[0], val);
@@ -329,7 +338,8 @@
NULL);
}
- gtk_entry_set_text (GTK_ENTRY (entry), val?val:"");
+ item_entry->current_value = g_strdup (val?val:"");
+ gtk_entry_set_text (GTK_ENTRY (entry), item_entry->current_value);
g_free (val);
gtk_table_attach (GTK_TABLE (table), label,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]