summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3315993)
raw | patch | inline | side by side (parent: 3315993)
author | pjrm <pjrm@users.sourceforge.net> | |
Thu, 5 Jun 2008 06:35:29 +0000 (06:35 +0000) | ||
committer | pjrm <pjrm@users.sourceforge.net> | |
Thu, 5 Jun 2008 06:35:29 +0000 (06:35 +0000) |
src/prefs-utils.cpp | patch | blob | history | |
src/prefs-utils.h | patch | blob | history |
diff --git a/src/prefs-utils.cpp b/src/prefs-utils.cpp
index a8f358fafec42904b28303b02fec191bffd10bff..7a950c3c3c60a54bff5dfbe76e1aa95301c5281e 100644 (file)
--- a/src/prefs-utils.cpp
+++ b/src/prefs-utils.cpp
father->appendChild(repr);
return g_strdup_printf("%s.%s", father_path,child);
}
-/**
-\brief gets the list of children from a pref. Please free all that stuff after use.
-*/
-bool get_pref_children(gchar const *father_path, GSList ** children){
- Inkscape::XML::Node *father = inkscape_get_repr(INKSCAPE, father_path);
- if (! father ) return false;
- Inkscape::XML::Node *child_repr = sp_repr_children(father);
- while (child_repr) {
- *children = g_slist_prepend(*children, g_strdup_printf("%s.%s",father_path,child_repr->attribute("id")));
- child_repr = sp_repr_next(child_repr);
- }
-}
/**
\brief gets the nth children of a pref, starting from one (first child <=> n=1). returns NULL if out of bounds or father does not exist. Please free all that stuff after use.
*/
{
Inkscape::XML::Node *repr = inkscape_get_repr(INKSCAPE, path);
if (repr) {
- return (char *) repr->attribute(attr);
+ return repr->attribute(attr);
}
return NULL;
}
diff --git a/src/prefs-utils.h b/src/prefs-utils.h
index b60a674df8cbfd200d67a8571b4d33b14430d434..328fb53cc3003c81ae9cac59390dca702ddc2e7d 100644 (file)
--- a/src/prefs-utils.h
+++ b/src/prefs-utils.h
bool pref_path_exists(gchar const *path);
unsigned int pref_path_number_of_children(gchar const *path);
gchar * create_pref(gchar const *father_path, gchar const *child);
-bool get_pref_children(gchar const *father_path, GSList ** children);
gchar * get_pref_nth_child(gchar const *father_path, unsigned int n);
void prefs_set_int_attribute(gchar const *path, gchar const *attr, long long int value);