- make some things const for ecore_desktop_icon_find

SVN revision: 24844
This commit is contained in:
Dan Sinclair 2006-08-17 19:11:00 +00:00 committed by Dan Sinclair
parent ad94058e44
commit f4d36eeddd
2 changed files with 15 additions and 11 deletions

View File

@ -116,8 +116,9 @@ extern "C"
Ecore_Desktop *ecore_desktop_get(const char *file, const char *lang); Ecore_Desktop *ecore_desktop_get(const char *file, const char *lang);
void ecore_desktop_destroy(Ecore_Desktop * desktop); void ecore_desktop_destroy(Ecore_Desktop * desktop);
char *ecore_desktop_icon_find(char *icon, char *icon_size, const char *ecore_desktop_icon_find(const char *icon,
char *icon_theme); const char *icon_size,
const char *icon_theme);
Ecore_Desktop_Tree *ecore_desktop_menu_get(char *file); Ecore_Desktop_Tree *ecore_desktop_menu_get(char *file);

View File

@ -5,8 +5,9 @@
//#define DEBUG 1 //#define DEBUG 1
static char *_ecore_desktop_icon_find0(char *icon, char *icon_size, static const char *_ecore_desktop_icon_find0(const char *icon,
char *icon_theme); const char *icon_size,
const char *icon_theme);
static const char *ext[] = { ".png", ".svgz", ".svg", ".xpm", "", NULL }; static const char *ext[] = { ".png", ".svgz", ".svg", ".xpm", "", NULL };
@ -32,11 +33,12 @@ static const char *ext[] = { ".png", ".svgz", ".svg", ".xpm", "", NULL };
* @ingroup Ecore_Desktop_Icon_Group * @ingroup Ecore_Desktop_Icon_Group
*/ */
char * const char *
ecore_desktop_icon_find(char *icon, char *icon_size, char *icon_theme) ecore_desktop_icon_find(const char *icon, const char *icon_size, const char *icon_theme)
{ {
char icn[PATH_MAX], path[PATH_MAX]; char icn[PATH_MAX], path[PATH_MAX];
char *dir, *home; const char *dir;
char *home;
if (icon == NULL) if (icon == NULL)
return NULL; return NULL;
@ -89,8 +91,8 @@ ecore_desktop_icon_find(char *icon, char *icon_size, char *icon_theme)
* @param icon_theme The icon theme to search in. * @param icon_theme The icon theme to search in.
* @return The full path to the found icon. * @return The full path to the found icon.
*/ */
static char * static const char *
_ecore_desktop_icon_find0(char *icon, char *icon_size, char *icon_theme) _ecore_desktop_icon_find0(const char *icon, const char *icon_size, const char *icon_theme)
{ {
/* NOTES ON OPTIMIZATIONS /* NOTES ON OPTIMIZATIONS
* *
@ -118,7 +120,8 @@ _ecore_desktop_icon_find0(char *icon, char *icon_size, char *icon_theme)
*/ */
char icn[PATH_MAX], path[PATH_MAX]; char icn[PATH_MAX], path[PATH_MAX];
char *theme_path, *found; char *theme_path;
const char *found;
if ((icon == NULL) || (icon[0] == '\0')) if ((icon == NULL) || (icon[0] == '\0'))
return NULL; return NULL;
@ -174,7 +177,7 @@ _ecore_desktop_icon_find0(char *icon, char *icon_size, char *icon_theme)
int wanted_size; int wanted_size;
int minimal_size = INT_MAX; int minimal_size = INT_MAX;
int i; int i;
char *closest = NULL; const char *closest = NULL;
char *directory; char *directory;
wanted_size = atoi(icon_size); wanted_size = atoi(icon_size);