Commit e11eb47f authored by Andy Hertzfeld's avatar Andy Hertzfeld

taught the icon factory to look in the user's home directory for


	taught the icon factory to look in the user's home directory for
	user-defined emblem images.
parent b36a01ab
2000-05-09 Andy Hertzfeld <andy@eazel.com>
* src/libnautilus-extensions/nautilus-icon-factory.c:
taught the icon factory to look in the user's home directory
for user-defined emblem images
2000-05-09 Andy Hertzfeld <andy@eazel.com>
* src/nautilus-property-browser.c:
......
......@@ -45,6 +45,7 @@
#include <librsvg/rsvg.h>
#include "nautilus-default-file-icon.h"
#include "nautilus-file-utilities.h"
#include "nautilus-gdk-extensions.h"
#include "nautilus-glib-extensions.h"
#include "nautilus-global-preferences.h"
......@@ -584,6 +585,24 @@ get_themed_icon_file_path (const char *theme_name,
xmlFreeDoc (doc);
}
/* if we still haven't found anything, and we're looking for an emblem,
check out the user's home directory, since it might be an emblem
that they've added there */
if (path == NULL && nautilus_str_has_prefix(icon_name, "emblem-")) {
for (i = 0; i < NAUTILUS_N_ELEMENTS (icon_file_name_suffixes); i++) {
path = g_strdup_printf("%s/emblems/%s%s",
nautilus_user_directory(), icon_name + 7,
icon_file_name_suffixes[i]);
if (g_file_exists(path))
break;
g_free(path);
path = NULL;
}
}
return path;
}
......
......@@ -45,6 +45,7 @@
#include <librsvg/rsvg.h>
#include "nautilus-default-file-icon.h"
#include "nautilus-file-utilities.h"
#include "nautilus-gdk-extensions.h"
#include "nautilus-glib-extensions.h"
#include "nautilus-global-preferences.h"
......@@ -584,6 +585,24 @@ get_themed_icon_file_path (const char *theme_name,
xmlFreeDoc (doc);
}
/* if we still haven't found anything, and we're looking for an emblem,
check out the user's home directory, since it might be an emblem
that they've added there */
if (path == NULL && nautilus_str_has_prefix(icon_name, "emblem-")) {
for (i = 0; i < NAUTILUS_N_ELEMENTS (icon_file_name_suffixes); i++) {
path = g_strdup_printf("%s/emblems/%s%s",
nautilus_user_directory(), icon_name + 7,
icon_file_name_suffixes[i]);
if (g_file_exists(path))
break;
g_free(path);
path = NULL;
}
}
return path;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment