summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-06-02 17:25:00 +0000
committerDarin Adler <darin@src.gnome.org>2000-06-02 17:25:00 +0000
commita51a8ee58c3ff4e960b61e4d12aec523eb8f6a24 (patch)
tree70a9d4f90e1631b786d44f0d021b5db66848ed0d
parent8e29ec7fafaa139702cc12cbe223c22cf791b24a (diff)
downloadnautilus-a51a8ee58c3ff4e960b61e4d12aec523eb8f6a24.tar.gz
Ignore some Makefile and Makefile.in files.
* components/services/install/idl/.cvsignore: * components/services/time/idl/.cvsignore: Ignore some Makefile and Makefile.in files. * data/linksets/Makefile.am: * data/linksets/desktop.xml: Added a link set for the trash on the desktop. * icons/Makefile.am: Added a trash icon (actually a copy of the Nautilus icon right now :-). * libnautilus-extensions/nautilus-link-set.h: * libnautilus-extensions/nautilus-link-set.c: (create_new_link), (nautilus_link_set_install), (nautilus_link_set_remove): Fixed some URI-related issues and added a special case for the ~ character so we can have link sets that are for the home directory. * libnautilus-extensions/nautilus-string.c: (nautilus_str_capitalize): Got rid of the unneeded call to strlen. strlen == 0 is the slowest way I know to check for an empty string. Also check islower before calling toupper for paranoia like the calls in glib do (internally). * src/nautilus-desktop-window.c: (nautilus_desktop_window_new): Install the desktop link set when we are created. For now this installs the trash (in a fairly lame way). * src/nautilus-property-browser.c: (remove_color), (add_color_to_file), (make_properties_from_xml_node), (nautilus_property_browser_update_contents): Changed code to not reference "childs" directly so it's easy to switch to a new version of gnome-xml. * test/.cvsignore: Ignore test-nautilus-mime-actions-set.
-rw-r--r--ChangeLog39
-rw-r--r--components/services/install/idl/.cvsignore2
-rw-r--r--components/services/time/idl/.cvsignore2
-rw-r--r--data/linksets/Makefile.am1
-rw-r--r--data/linksets/desktop.xml4
-rw-r--r--icons/Makefile.am1
-rw-r--r--icons/trash.pngbin0 -> 2125 bytes
-rw-r--r--libnautilus-extensions/nautilus-link-set.c92
-rw-r--r--libnautilus-extensions/nautilus-link-set.h9
-rw-r--r--libnautilus-extensions/nautilus-string.c4
-rw-r--r--libnautilus-private/nautilus-link-set.c92
-rw-r--r--libnautilus-private/nautilus-link-set.h9
-rw-r--r--libnautilus-private/nautilus-string.c4
-rw-r--r--src/nautilus-desktop-window.c29
-rw-r--r--src/nautilus-property-browser.c31
-rw-r--r--test/.cvsignore1
16 files changed, 207 insertions, 113 deletions
diff --git a/ChangeLog b/ChangeLog
index a60115fec..71cb9f32e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+2000-06-02 Darin Adler <darin@eazel.com>
+
+ * components/services/install/idl/.cvsignore:
+ * components/services/time/idl/.cvsignore:
+ Ignore some Makefile and Makefile.in files.
+
+ * data/linksets/Makefile.am:
+ * data/linksets/desktop.xml:
+ Added a link set for the trash on the desktop.
+
+ * icons/Makefile.am:
+ Added a trash icon (actually a copy of the Nautilus icon right
+ now :-).
+
+ * libnautilus-extensions/nautilus-link-set.h:
+ * libnautilus-extensions/nautilus-link-set.c: (create_new_link),
+ (nautilus_link_set_install), (nautilus_link_set_remove):
+ Fixed some URI-related issues and added a special case for the ~
+ character so we can have link sets that are for the home directory.
+
+ * libnautilus-extensions/nautilus-string.c:
+ (nautilus_str_capitalize): Got rid of the unneeded call to strlen.
+ strlen == 0 is the slowest way I know to check for an empty string.
+ Also check islower before calling toupper for paranoia like the
+ calls in glib do (internally).
+
+ * src/nautilus-desktop-window.c: (nautilus_desktop_window_new):
+ Install the desktop link set when we are created. For now this
+ installs the trash (in a fairly lame way).
+
+ * src/nautilus-property-browser.c: (remove_color),
+ (add_color_to_file), (make_properties_from_xml_node),
+ (nautilus_property_browser_update_contents):
+ Changed code to not reference "childs" directly so it's easy to
+ switch to a new version of gnome-xml.
+
+ * test/.cvsignore: Ignore test-nautilus-mime-actions-set.
+
2000-06-02 Ramiro Estrugo <ramiro@eazel.com>
Task 518. Support for changing preferecens individually
@@ -122,7 +160,6 @@
It would be a lot nicer it the contents updated on the fly instead
of rebuilding the whole thing. I can do that later.
-
2000-06-02 Pavel Cisler <pavel@eazel.com>
diff --git a/components/services/install/idl/.cvsignore b/components/services/install/idl/.cvsignore
new file mode 100644
index 000000000..282522db0
--- /dev/null
+++ b/components/services/install/idl/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/components/services/time/idl/.cvsignore b/components/services/time/idl/.cvsignore
new file mode 100644
index 000000000..282522db0
--- /dev/null
+++ b/components/services/time/idl/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/data/linksets/Makefile.am b/data/linksets/Makefile.am
index d4322e816..8dd5b864d 100644
--- a/data/linksets/Makefile.am
+++ b/data/linksets/Makefile.am
@@ -4,6 +4,7 @@ linkdir = $(datadir)/nautilus/linksets
link_DATA = \
apps.xml \
+ desktop.xml \
$(NULL)
EXTRA_DIST = $(link_DATA)
diff --git a/data/linksets/desktop.xml b/data/linksets/desktop.xml
new file mode 100644
index 000000000..3c732c0fe
--- /dev/null
+++ b/data/linksets/desktop.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<linkset name="Desktop">
+ <link name="Trash" image="trash.png" uri="~/Trash"/>
+</linkset>
diff --git a/icons/Makefile.am b/icons/Makefile.am
index a6d1d8205..d747bdb5f 100644
--- a/icons/Makefile.am
+++ b/icons/Makefile.am
@@ -141,6 +141,7 @@ icon_DATA =\
rightarrow.png \
tableft.png \
tabright.png \
+ trash.png \
uparrow.png \
zoom.png \
$(NULL)
diff --git a/icons/trash.png b/icons/trash.png
new file mode 100644
index 000000000..9508b5488
--- /dev/null
+++ b/icons/trash.png
Binary files differ
diff --git a/libnautilus-extensions/nautilus-link-set.c b/libnautilus-extensions/nautilus-link-set.c
index de29f9463..f187a2f53 100644
--- a/libnautilus-extensions/nautilus-link-set.c
+++ b/libnautilus-extensions/nautilus-link-set.c
@@ -23,32 +23,34 @@
*/
#include <config.h>
+#include "nautilus-link-set.h"
+
#include <stdlib.h>
#include <parser.h>
#include <xmlmemory.h>
+#include <libgnomevfs/gnome-vfs-utils.h>
+
#include "nautilus-file.h"
#include "nautilus-link.h"
#include "nautilus-metadata.h"
#include "nautilus-string.h"
#include "nautilus-xml-extensions.h"
#include "nautilus-global-preferences.h"
-#include "nautilus-widgets/nautilus-preferences.h"
-
-#include "nautilus-link-set.h"
+#include <nautilus-widgets/nautilus-preferences.h>
/* routine to create a new .link file in the specified directory */
-static void
-create_new_link(const char *directory_path, const char *name, const char *image, const char *uri)
+static gboolean
+create_new_link (const char *directory_path, const char *name, const char *image, const char *uri)
{
xmlDocPtr output_document;
xmlNodePtr root_node;
char *file_name;
int result;
-
+
/* create a new xml document */
- output_document = xmlNewDoc ("1.0");
+ output_document = xmlNewDoc ("1.0");
/* add the root node to the output document */
root_node = xmlNewDocNode (output_document, NULL, "NAUTILUS_OBJECT", NULL);
@@ -57,12 +59,14 @@ create_new_link(const char *directory_path, const char *name, const char *image,
xmlSetProp (root_node, "CUSTOM_ICON", image);
xmlSetProp (root_node, "LINK", uri);
- /* all done , so save the xml document as a link file */
- file_name = g_strdup_printf("%s/%s.link", directory_path, name);
- result = xmlSaveFile(file_name, output_document);
- g_free(file_name);
+ /* all done, so save the xml document as a link file */
+ file_name = g_strdup_printf ("%s/%s.link", directory_path, name);
+ result = xmlSaveFile (file_name, output_document);
+ g_free (file_name);
- xmlFreeDoc(output_document);
+ xmlFreeDoc (output_document);
+
+ return result > 0;
}
/* install a link set into the specified directory */
@@ -70,54 +74,62 @@ create_new_link(const char *directory_path, const char *name, const char *image,
gboolean
nautilus_link_set_install (const char *directory_path, const char *link_set_name)
{
- NautilusFile *file;
xmlDocPtr document;
- xmlNodePtr cur_node;
+ xmlNodePtr node;
char *temp_str, *link_set_path;
- char *link_name, *image_name, *uri_name;
-
- file = nautilus_file_get(directory_path);
- if (file == NULL)
- return FALSE;
-
- /* make sure the target is a writable directory */
+ char *link_name, *image_name, *uri, *full_uri, *home_in_uri_format;
- if (!nautilus_file_is_directory(file) || !nautilus_file_can_write(file)) {
- nautilus_file_unref(file);
- return FALSE;
- }
-
/* compose the path of the link set file */
temp_str = g_strdup_printf ("nautilus/linksets/%s.xml", link_set_name);
link_set_path = gnome_datadir_file (temp_str);
+ g_free (temp_str);
/* load and parse the linkset xml file */
document = xmlParseFile (link_set_path);
- g_free(temp_str);
- g_free(link_set_path);
-
- if (document == NULL)
+ g_free (link_set_path);
+ if (document == NULL) {
return FALSE;
+ }
/* loop through the entries, generating .link files */
- for (cur_node = document->root->childs; cur_node != NULL; cur_node = cur_node->next) {
- if (strcmp(cur_node->name, "link") == 0) {
- link_name = xmlGetProp (cur_node, "name");
- image_name = xmlGetProp (cur_node, "image");
- uri_name = xmlGetProp (cur_node, "uri");
- create_new_link(directory_path, link_name, image_name, uri_name);
+ for (node = nautilus_xml_get_children (xmlDocGetRootElement (document));
+ node != NULL; node = node->next) {
+ if (strcmp (node->name, "link") == 0) {
+ link_name = xmlGetProp (node, "name");
+ image_name = xmlGetProp (node, "image");
+ uri = xmlGetProp (node, "uri");
+
+ /* Expand special URIs */
+ full_uri = NULL;
+ if (uri[0] == '~') {
+ home_in_uri_format = gnome_vfs_escape_string
+ (g_get_home_dir (), GNOME_VFS_URI_UNSAFE_PATH);
+ full_uri = g_strconcat ("file://", home_in_uri_format, uri + 1, NULL);
+ g_free (home_in_uri_format);
+ uri = full_uri;
+ }
+
+ if (!create_new_link (directory_path, link_name, image_name, uri)) {
+ g_free (full_uri);
+ xmlFreeDoc (document);
+ return FALSE;
+ }
+
+ g_free (full_uri);
}
}
+ xmlFreeDoc (document);
+
/* all done so return TRUE */
- xmlFreeDoc(document);
return TRUE;
-
}
/* remove a link set from the specified directory */
+/* FIXME: Not implemented. */
+#if 0
void
-nautilus_link_set_remove (const char *directory_uri, const char *link_set_name)
+nautilus_link_set_remove (const char *directory_uri, const char *link_set_name)
{
}
-
+#endif
diff --git a/libnautilus-extensions/nautilus-link-set.h b/libnautilus-extensions/nautilus-link-set.h
index 9324ce8d9..50aaa2867 100644
--- a/libnautilus-extensions/nautilus-link-set.h
+++ b/libnautilus-extensions/nautilus-link-set.h
@@ -27,8 +27,9 @@
#include <glib.h>
-gboolean nautilus_link_set_install (const char *file_uri, const char *link_set_name);
-void nautilus_link_set_remove (const char *file_uri, const char *link_set_name);
+gboolean nautilus_link_set_install (const char *directory_path,
+ const char *link_set_name);
+void nautilus_link_set_remove (const char *directory_path,
+ const char *link_set_name);
-
-#endif /* NAUTILUS_LINK_H */
+#endif /* NAUTILUS_LINK_SET_H */
diff --git a/libnautilus-extensions/nautilus-string.c b/libnautilus-extensions/nautilus-string.c
index 2db4be79e..6acbccc03 100644
--- a/libnautilus-extensions/nautilus-string.c
+++ b/libnautilus-extensions/nautilus-string.c
@@ -353,8 +353,8 @@ nautilus_str_capitalize (const char *string)
capitalized = g_strdup (string);
- if (strlen (string) > 0) {
- capitalized[0] = toupper (string[0]);
+ if (islower (capitalized[0])) {
+ capitalized[0] = toupper (capitalized[0]);
}
return capitalized;
diff --git a/libnautilus-private/nautilus-link-set.c b/libnautilus-private/nautilus-link-set.c
index de29f9463..f187a2f53 100644
--- a/libnautilus-private/nautilus-link-set.c
+++ b/libnautilus-private/nautilus-link-set.c
@@ -23,32 +23,34 @@
*/
#include <config.h>
+#include "nautilus-link-set.h"
+
#include <stdlib.h>
#include <parser.h>
#include <xmlmemory.h>
+#include <libgnomevfs/gnome-vfs-utils.h>
+
#include "nautilus-file.h"
#include "nautilus-link.h"
#include "nautilus-metadata.h"
#include "nautilus-string.h"
#include "nautilus-xml-extensions.h"
#include "nautilus-global-preferences.h"
-#include "nautilus-widgets/nautilus-preferences.h"
-
-#include "nautilus-link-set.h"
+#include <nautilus-widgets/nautilus-preferences.h>
/* routine to create a new .link file in the specified directory */
-static void
-create_new_link(const char *directory_path, const char *name, const char *image, const char *uri)
+static gboolean
+create_new_link (const char *directory_path, const char *name, const char *image, const char *uri)
{
xmlDocPtr output_document;
xmlNodePtr root_node;
char *file_name;
int result;
-
+
/* create a new xml document */
- output_document = xmlNewDoc ("1.0");
+ output_document = xmlNewDoc ("1.0");
/* add the root node to the output document */
root_node = xmlNewDocNode (output_document, NULL, "NAUTILUS_OBJECT", NULL);
@@ -57,12 +59,14 @@ create_new_link(const char *directory_path, const char *name, const char *image,
xmlSetProp (root_node, "CUSTOM_ICON", image);
xmlSetProp (root_node, "LINK", uri);
- /* all done , so save the xml document as a link file */
- file_name = g_strdup_printf("%s/%s.link", directory_path, name);
- result = xmlSaveFile(file_name, output_document);
- g_free(file_name);
+ /* all done, so save the xml document as a link file */
+ file_name = g_strdup_printf ("%s/%s.link", directory_path, name);
+ result = xmlSaveFile (file_name, output_document);
+ g_free (file_name);
- xmlFreeDoc(output_document);
+ xmlFreeDoc (output_document);
+
+ return result > 0;
}
/* install a link set into the specified directory */
@@ -70,54 +74,62 @@ create_new_link(const char *directory_path, const char *name, const char *image,
gboolean
nautilus_link_set_install (const char *directory_path, const char *link_set_name)
{
- NautilusFile *file;
xmlDocPtr document;
- xmlNodePtr cur_node;
+ xmlNodePtr node;
char *temp_str, *link_set_path;
- char *link_name, *image_name, *uri_name;
-
- file = nautilus_file_get(directory_path);
- if (file == NULL)
- return FALSE;
-
- /* make sure the target is a writable directory */
+ char *link_name, *image_name, *uri, *full_uri, *home_in_uri_format;
- if (!nautilus_file_is_directory(file) || !nautilus_file_can_write(file)) {
- nautilus_file_unref(file);
- return FALSE;
- }
-
/* compose the path of the link set file */
temp_str = g_strdup_printf ("nautilus/linksets/%s.xml", link_set_name);
link_set_path = gnome_datadir_file (temp_str);
+ g_free (temp_str);
/* load and parse the linkset xml file */
document = xmlParseFile (link_set_path);
- g_free(temp_str);
- g_free(link_set_path);
-
- if (document == NULL)
+ g_free (link_set_path);
+ if (document == NULL) {
return FALSE;
+ }
/* loop through the entries, generating .link files */
- for (cur_node = document->root->childs; cur_node != NULL; cur_node = cur_node->next) {
- if (strcmp(cur_node->name, "link") == 0) {
- link_name = xmlGetProp (cur_node, "name");
- image_name = xmlGetProp (cur_node, "image");
- uri_name = xmlGetProp (cur_node, "uri");
- create_new_link(directory_path, link_name, image_name, uri_name);
+ for (node = nautilus_xml_get_children (xmlDocGetRootElement (document));
+ node != NULL; node = node->next) {
+ if (strcmp (node->name, "link") == 0) {
+ link_name = xmlGetProp (node, "name");
+ image_name = xmlGetProp (node, "image");
+ uri = xmlGetProp (node, "uri");
+
+ /* Expand special URIs */
+ full_uri = NULL;
+ if (uri[0] == '~') {
+ home_in_uri_format = gnome_vfs_escape_string
+ (g_get_home_dir (), GNOME_VFS_URI_UNSAFE_PATH);
+ full_uri = g_strconcat ("file://", home_in_uri_format, uri + 1, NULL);
+ g_free (home_in_uri_format);
+ uri = full_uri;
+ }
+
+ if (!create_new_link (directory_path, link_name, image_name, uri)) {
+ g_free (full_uri);
+ xmlFreeDoc (document);
+ return FALSE;
+ }
+
+ g_free (full_uri);
}
}
+ xmlFreeDoc (document);
+
/* all done so return TRUE */
- xmlFreeDoc(document);
return TRUE;
-
}
/* remove a link set from the specified directory */
+/* FIXME: Not implemented. */
+#if 0
void
-nautilus_link_set_remove (const char *directory_uri, const char *link_set_name)
+nautilus_link_set_remove (const char *directory_uri, const char *link_set_name)
{
}
-
+#endif
diff --git a/libnautilus-private/nautilus-link-set.h b/libnautilus-private/nautilus-link-set.h
index 9324ce8d9..50aaa2867 100644
--- a/libnautilus-private/nautilus-link-set.h
+++ b/libnautilus-private/nautilus-link-set.h
@@ -27,8 +27,9 @@
#include <glib.h>
-gboolean nautilus_link_set_install (const char *file_uri, const char *link_set_name);
-void nautilus_link_set_remove (const char *file_uri, const char *link_set_name);
+gboolean nautilus_link_set_install (const char *directory_path,
+ const char *link_set_name);
+void nautilus_link_set_remove (const char *directory_path,
+ const char *link_set_name);
-
-#endif /* NAUTILUS_LINK_H */
+#endif /* NAUTILUS_LINK_SET_H */
diff --git a/libnautilus-private/nautilus-string.c b/libnautilus-private/nautilus-string.c
index 2db4be79e..6acbccc03 100644
--- a/libnautilus-private/nautilus-string.c
+++ b/libnautilus-private/nautilus-string.c
@@ -353,8 +353,8 @@ nautilus_str_capitalize (const char *string)
capitalized = g_strdup (string);
- if (strlen (string) > 0) {
- capitalized[0] = toupper (string[0]);
+ if (islower (capitalized[0])) {
+ capitalized[0] = toupper (capitalized[0]);
}
return capitalized;
diff --git a/src/nautilus-desktop-window.c b/src/nautilus-desktop-window.c
index 4720a436f..964c8fe9d 100644
--- a/src/nautilus-desktop-window.c
+++ b/src/nautilus-desktop-window.c
@@ -28,7 +28,9 @@
#include <libnautilus-extensions/nautilus-gtk-macros.h>
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
+#include <libnautilus-extensions/nautilus-link-set.h>
#include <libgnomeui/gnome-winhints.h>
+#include <libgnomevfs/gnome-vfs-utils.h>
struct NautilusDesktopWindowDetails {
GList *unref_list;
@@ -83,7 +85,9 @@ NautilusDesktopWindow *
nautilus_desktop_window_new (NautilusApp *application)
{
NautilusDesktopWindow *window;
- char *desktop_directory;
+ const char *desktop_directory_path;
+ char *desktop_directory_path_in_uri_format;
+ char *desktop_directory_uri;
window = NAUTILUS_DESKTOP_WINDOW
(gtk_object_new (nautilus_desktop_window_get_type(),
@@ -91,12 +95,29 @@ nautilus_desktop_window_new (NautilusApp *application)
"app_id", "nautilus",
NULL));
+ desktop_directory_path = nautilus_get_desktop_directory ();
+
+ /* Create the trash.
+ * We can do this at some other time if we want, but this
+ * might be a good time.
+ */
+ nautilus_link_set_install (desktop_directory_path, "desktop");
+
+ /* FIXME: This little ditty is just the way you convert a
+ * local path to a file: URI. Should be a utility somewhere
+ * to do the two steps at once.
+ */
+ desktop_directory_path_in_uri_format = gnome_vfs_escape_string
+ (desktop_directory_path, GNOME_VFS_URI_UNSAFE_PATH);
+ desktop_directory_uri = g_strconcat
+ ("file://", desktop_directory_path_in_uri_format, NULL);
+ g_free (desktop_directory_path_in_uri_format);
+
/* Point window at the desktop folder.
* Note that nautilus_desktop_window_initialize is too early to do this.
*/
- desktop_directory = g_strconcat ("file://", nautilus_get_desktop_directory (), NULL);
- nautilus_window_goto_uri (NAUTILUS_WINDOW (window), desktop_directory);
- g_free (desktop_directory);
+ nautilus_window_goto_uri (NAUTILUS_WINDOW (window), desktop_directory_uri);
+ g_free (desktop_directory_uri);
gtk_widget_show (GTK_WIDGET (window));
diff --git a/src/nautilus-property-browser.c b/src/nautilus-property-browser.c
index 04d1a7a40..a609e71e5 100644
--- a/src/nautilus-property-browser.c
+++ b/src/nautilus-property-browser.c
@@ -49,6 +49,7 @@
#include <libnautilus-extensions/nautilus-gnome-extensions.h>
#include <libnautilus-extensions/nautilus-metadata.h>
#include <libnautilus-extensions/nautilus-string.h>
+#include <libnautilus-extensions/nautilus-xml-extensions.h>
struct NautilusPropertyBrowserDetails {
GtkVBox *container;
@@ -513,16 +514,18 @@ remove_color(NautilusPropertyBrowser *property_browser, const char* color_value)
xmlDocPtr document = xmlParseFile (xml_path);
g_free(xml_path);
- if (document == NULL)
+ if (document == NULL) {
return;
+ }
/* find the colors category */
- for (cur_node = document->root->childs; cur_node != NULL; cur_node = cur_node->next) {
+ for (cur_node = nautilus_xml_get_children (xmlDocGetRootElement (document));
+ cur_node != NULL; cur_node = cur_node->next) {
if (strcmp(cur_node->name, "category") == 0) {
char* category_name = xmlGetProp (cur_node, "name");
if (strcmp(category_name, "colors") == 0) {
/* loop through the colors to find one that matches */
- xmlNodePtr color_node = cur_node->childs;
+ xmlNodePtr color_node = nautilus_xml_get_children (cur_node);
while (color_node != NULL) {
char* color_content = xmlNodeGetContent(color_node);
if (color_content && !strcmp(color_content, color_value)) {
@@ -852,8 +855,8 @@ add_color_to_file(NautilusPropertyBrowser *property_browser, const char *color_s
}
/* find the colors category */
- cur_node = document->root->childs;
- for (cur_node = document->root->childs; cur_node != NULL; cur_node = cur_node->next) {
+ for (cur_node = nautilus_xml_get_children (xmlDocGetRootElement (document));
+ cur_node != NULL; cur_node = cur_node->next) {
if (strcmp(cur_node->name, "category") == 0) {
char* category_name = xmlGetProp (cur_node, "name");
if (strcmp(category_name, "colors") == 0) {
@@ -1267,15 +1270,16 @@ make_properties_from_directory(NautilusPropertyBrowser *property_browser, const
/* for now, we just handle color nodes */
static void
-make_properties_from_xml_node(NautilusPropertyBrowser *property_browser, xmlNodePtr node)
+make_properties_from_xml_node (NautilusPropertyBrowser *property_browser, xmlNodePtr node)
{
- xmlNode *current_node = node->childs;
+ xmlNode *current_node;
int index = 0;
gboolean local_only = property_browser->details->remove_mode;
property_browser->details->has_local = FALSE;
- while (current_node != NULL) {
+ for (current_node = nautilus_xml_get_children (node);
+ current_node != NULL; current_node = current_node->next) {
NautilusBackground *background;
GtkWidget *frame;
char* color_str = xmlNodeGetContent(current_node);
@@ -1312,8 +1316,6 @@ make_properties_from_xml_node(NautilusPropertyBrowser *property_browser, xmlNode
add_to_content_table(property_browser, frame, index++, 12);
}
-
- current_node = current_node->next;
}
}
@@ -1424,8 +1426,8 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro
gtk_widget_show (GTK_WIDGET (property_browser->details->content_table));
/* iterate through the xml file to generate the widgets */
- cur_node = document->root->childs;
- while (cur_node != NULL) {
+ for (cur_node = nautilus_xml_get_children (xmlDocGetRootElement (document));
+ cur_node != NULL; cur_node = cur_node->next) {
if (strcmp(cur_node->name, "category") == 0) {
char* category_name = xmlGetProp (cur_node, "name");
char* category_image = xmlGetProp (cur_node, "image");
@@ -1442,13 +1444,10 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro
make_category_link(property_browser, category_name, category_image, index++);
}
}
- cur_node = cur_node->next;
}
/* release the xml document and we're done */
- if (document) {
- xmlFreeDoc(document);
- }
+ xmlFreeDoc (document);
/* update the title and button */
diff --git a/test/.cvsignore b/test/.cvsignore
index 88b8e6a17..3b721dae2 100644
--- a/test/.cvsignore
+++ b/test/.cvsignore
@@ -3,3 +3,4 @@
Makefile
Makefile.in
test-nautilus-mime-actions
+test-nautilus-mime-actions-set