remove trailing spaces

SVN revision: 31638
This commit is contained in:
doursse 2007-09-06 16:15:10 +00:00 committed by doursse
parent 5209a42671
commit 6a7494bba7
30 changed files with 744 additions and 765 deletions

View File

@ -1,4 +1,6 @@
SUBDIRS = data compare SUBDIRS = data compare
MAINTAINERCLEANFILES = Makefile.in MAINTAINERCLEANFILES = Makefile.in
INCLUDES = \ INCLUDES = \

View File

@ -5,268 +5,268 @@
#define THEME "Tango" #define THEME "Tango"
#define SIZE "16x16" #define SIZE "16x16"
#define ADDRESS_BOOK_NEW "address-book-new" #define ADDRESS_BOOK_NEW "address-book-new"
#define APPLICATION_EXIT "application-exit" #define APPLICATION_EXIT "application-exit"
#define APPOINTMENT_NEW "appointment-new" #define APPOINTMENT_NEW "appointment-new"
#define CONTACT_NEW "contact-new" #define CONTACT_NEW "contact-new"
#define DIALOG_APPLY "dialog-apply" #define DIALOG_APPLY "dialog-apply"
#define DIALOG_CANCEL "dialog-cancel" #define DIALOG_CANCEL "dialog-cancel"
#define DIALOG_CLOSE "dialog-close" #define DIALOG_CLOSE "dialog-close"
#define DIALOG_OK "dialog-ok" #define DIALOG_OK "dialog-ok"
#define DOCUMENT_NEW "document-new" #define DOCUMENT_NEW "document-new"
#define DOCUMENT_OPEN "document-open" #define DOCUMENT_OPEN "document-open"
#define DOCUMENT_OPEN_RECENT "document-open-recent" #define DOCUMENT_OPEN_RECENT "document-open-recent"
#define DOCUMENT_PAGE_SETUP "document-page-setup" #define DOCUMENT_PAGE_SETUP "document-page-setup"
#define DOCUMENT_PRINT "document-print" #define DOCUMENT_PRINT "document-print"
#define DOCUMENT_PRINT_PREVIEW "document-print-preview" #define DOCUMENT_PRINT_PREVIEW "document-print-preview"
#define DOCUMENT_PROPERTIES "document-properties" #define DOCUMENT_PROPERTIES "document-properties"
#define DOCUMENT_REVERT "document-revert" #define DOCUMENT_REVERT "document-revert"
#define DOCUMENT_SAVE "document-save" #define DOCUMENT_SAVE "document-save"
#define DOCUMENT_SAVE_AS "document-save-as" #define DOCUMENT_SAVE_AS "document-save-as"
#define EDIT_COPY "edit-copy" #define EDIT_COPY "edit-copy"
#define EDIT_CUT "edit-cut" #define EDIT_CUT "edit-cut"
#define EDIT_DELETE "edit-delete" #define EDIT_DELETE "edit-delete"
#define EDIT_FIND "edit-find" #define EDIT_FIND "edit-find"
#define EDIT_FIND_REPLACE "edit-find-replace" #define EDIT_FIND_REPLACE "edit-find-replace"
#define EDIT_PASTE "edit-paste" #define EDIT_PASTE "edit-paste"
#define EDIT_REDO "edit-redo" #define EDIT_REDO "edit-redo"
#define EDIT_SELECT_ALL "edit-select-all" #define EDIT_SELECT_ALL "edit-select-all"
#define EDIT_UNDO "edit-undo" #define EDIT_UNDO "edit-undo"
#define FORMAT_INDENT_LESS "format-indent-less" #define FORMAT_INDENT_LESS "format-indent-less"
#define FORMAT_INDENT_MORE "format-indent-more" #define FORMAT_INDENT_MORE "format-indent-more"
#define FORMAT_JUSTIFY_CENTER "format-justify-center" #define FORMAT_JUSTIFY_CENTER "format-justify-center"
#define FORMAT_JUSTIFY_FILL "format-justify-fill" #define FORMAT_JUSTIFY_FILL "format-justify-fill"
#define FORMAT_JUSTIFY_LEFT "format-justify-left" #define FORMAT_JUSTIFY_LEFT "format-justify-left"
#define FORMAT_JUSTIFY_RIGHT "format-justify-right" #define FORMAT_JUSTIFY_RIGHT "format-justify-right"
#define FORMAT_TEXT_DIRECTION_LTR "format-text-direction-ltr" #define FORMAT_TEXT_DIRECTION_LTR "format-text-direction-ltr"
#define FORMAT_TEXT_DIRECTION_RTL "format-text-direction-rtl" #define FORMAT_TEXT_DIRECTION_RTL "format-text-direction-rtl"
#define FORMAT_TEXT_BOLD "format-text-bold" #define FORMAT_TEXT_BOLD "format-text-bold"
#define FORMAT_TEXT_ITALIC "format-text-italic" #define FORMAT_TEXT_ITALIC "format-text-italic"
#define FORMAT_TEXT_UNDERLINE "format-text-underline" #define FORMAT_TEXT_UNDERLINE "format-text-underline"
#define FORMAT_TEXT_STRIKETHROUGH "format-text-strikethrough" #define FORMAT_TEXT_STRIKETHROUGH "format-text-strikethrough"
#define GO_BOTTOM "go-bottom" #define GO_BOTTOM "go-bottom"
#define GO_DOWN "go-down" #define GO_DOWN "go-down"
#define GO_FIRST "go-first" #define GO_FIRST "go-first"
#define GO_HOME "go-home" #define GO_HOME "go-home"
#define GO_JUMP "go-jump" #define GO_JUMP "go-jump"
#define GO_LAST "go-last" #define GO_LAST "go-last"
#define GO_NEXT "go-next" #define GO_NEXT "go-next"
#define GO_PREVIOUS "go-previous" #define GO_PREVIOUS "go-previous"
#define GO_TOP "go-top" #define GO_TOP "go-top"
#define GO_UP "go-up" #define GO_UP "go-up"
#define HELP_ABOUT "help-about" #define HELP_ABOUT "help-about"
#define HELP_CONTENTS "help-contents" #define HELP_CONTENTS "help-contents"
#define HELP_FAQ "help-faq" #define HELP_FAQ "help-faq"
#define INSERT_IMAGE "insert-image" #define INSERT_IMAGE "insert-image"
#define INSERT_LINK "insert-link" #define INSERT_LINK "insert-link"
#define INSERT_OBJECT "insert-object" #define INSERT_OBJECT "insert-object"
#define INSERT_TEXT "insert-text" #define INSERT_TEXT "insert-text"
#define LIST_ADD "list-add" #define LIST_ADD "list-add"
#define LIST_REMOVE "list-remove" #define LIST_REMOVE "list-remove"
#define MAIL_FORWARD "mail-forward" #define MAIL_FORWARD "mail-forward"
#define MAIL_MARK_IMPORTANT "mail-mark-important" #define MAIL_MARK_IMPORTANT "mail-mark-important"
#define MAIL_MARK_JUNK "mail-mark-junk" #define MAIL_MARK_JUNK "mail-mark-junk"
#define MAIL_MARK_NOTJUNK "mail-mark-notjunk" #define MAIL_MARK_NOTJUNK "mail-mark-notjunk"
#define MAIL_MARK_READ "mail-mark-read" #define MAIL_MARK_READ "mail-mark-read"
#define MAIL_MARK_UNREAD "mail-mark-unread" #define MAIL_MARK_UNREAD "mail-mark-unread"
#define MAIL_MESSAGE_NEW "mail-message-new" #define MAIL_MESSAGE_NEW "mail-message-new"
#define MAIL_REPLY_ALL "mail-reply-all" #define MAIL_REPLY_ALL "mail-reply-all"
#define MAIL_REPLY_SENDER "mail-reply-sender" #define MAIL_REPLY_SENDER "mail-reply-sender"
#define MAIL_SEND_RECEIVE "mail-send-receive" #define MAIL_SEND_RECEIVE "mail-send-receive"
#define MEDIA_EJECT "media-eject" #define MEDIA_EJECT "media-eject"
#define MEDIA_PLAYBACK_PAUSE "media-playback-pause" #define MEDIA_PLAYBACK_PAUSE "media-playback-pause"
#define MEDIA_PLAYBACK_START "media-playback-start" #define MEDIA_PLAYBACK_START "media-playback-start"
#define MEDIA_PLAYBACK_STOP "media-playback-stop" #define MEDIA_PLAYBACK_STOP "media-playback-stop"
#define MEDIA_RECORD "media-record" #define MEDIA_RECORD "media-record"
#define MEDIA_SEEK_BACKWARD "media-seek-backward" #define MEDIA_SEEK_BACKWARD "media-seek-backward"
#define MEDIA_SEEK_FORWARD "media-seek-forward" #define MEDIA_SEEK_FORWARD "media-seek-forward"
#define MEDIA_SKIP_BACKWARD "media-skip-backward" #define MEDIA_SKIP_BACKWARD "media-skip-backward"
#define MEDIA_SKIP_FORWARD "media-skip-forward" #define MEDIA_SKIP_FORWARD "media-skip-forward"
#define SYSTEM_LOCK_SCREEN "system-lock-screen" #define SYSTEM_LOCK_SCREEN "system-lock-screen"
#define SYSTEM_LOG_OUT "system-log-out" #define SYSTEM_LOG_OUT "system-log-out"
#define SYSTEM_RUN "system-run" #define SYSTEM_RUN "system-run"
#define SYSTEM_SEARCH "system-search" #define SYSTEM_SEARCH "system-search"
#define TOOLS_CHECK_SPELLING "tools-check-spelling" #define TOOLS_CHECK_SPELLING "tools-check-spelling"
#define VIEW_FULLSCREEN "view-fullscreen" #define VIEW_FULLSCREEN "view-fullscreen"
#define VIEW_REFRESH "view-refresh" #define VIEW_REFRESH "view-refresh"
#define VIEW_SORT_ASCENDING "view-sort-ascending" #define VIEW_SORT_ASCENDING "view-sort-ascending"
#define VIEW_SORT_DESCENDING "view-sort-descending" #define VIEW_SORT_DESCENDING "view-sort-descending"
#define WINDOW_CLOSE "window-close" #define WINDOW_CLOSE "window-close"
#define WINDOW_NEW "window-new" #define WINDOW_NEW "window-new"
#define ZOOM_BEST_FIT "zoom-best-fit" #define ZOOM_BEST_FIT "zoom-best-fit"
#define ZOOM_IN "zoom-in" #define ZOOM_IN "zoom-in"
#define ZOOM_ORIGINAL "zoom-original" #define ZOOM_ORIGINAL "zoom-original"
#define ZOOM_OUT "zoom-out" #define ZOOM_OUT "zoom-out"
#define PROCESS_WORKING "process-working" #define PROCESS_WORKING "process-working"
#define ACCESSORIES_CALCULATOR "accessories-calculator" #define ACCESSORIES_CALCULATOR "accessories-calculator"
#define ACCESSORIES_CHARACTER_MAP "accessories-character-map" #define ACCESSORIES_CHARACTER_MAP "accessories-character-map"
#define ACCESSORIES_DICTIONARY "accessories-dictionary" #define ACCESSORIES_DICTIONARY "accessories-dictionary"
#define ACCESSORIES_TEXT_EDITOR "accessories-text-editor" #define ACCESSORIES_TEXT_EDITOR "accessories-text-editor"
#define HELP_BROWSER "help-browser" #define HELP_BROWSER "help-browser"
#define MULTIMEDIA_VOLUME_CONTROL "multimedia-volume-control" #define MULTIMEDIA_VOLUME_CONTROL "multimedia-volume-control"
#define PREFERENCES_DESKTOP_ACCESSIBILITY "preferences-desktop-accessibility" #define PREFERENCES_DESKTOP_ACCESSIBILITY "preferences-desktop-accessibility"
#define PREFERENCES_DESKTOP_FONT "preferences-desktop-font" #define PREFERENCES_DESKTOP_FONT "preferences-desktop-font"
#define PREFERENCES_DESKTOP_KEYBOARD "preferences-desktop-keyboard" #define PREFERENCES_DESKTOP_KEYBOARD "preferences-desktop-keyboard"
#define PREFERENCES_DESKTOP_LOCALE "preferences-desktop-locale" #define PREFERENCES_DESKTOP_LOCALE "preferences-desktop-locale"
#define PREFERENCES_DESKTOP_MULTIMEDIA "preferences-desktop-multimedia" #define PREFERENCES_DESKTOP_MULTIMEDIA "preferences-desktop-multimedia"
#define PREFERENCES_DESKTOP_SCREENSAVER "preferences-desktop-screensaver" #define PREFERENCES_DESKTOP_SCREENSAVER "preferences-desktop-screensaver"
#define PREFERENCES_DESKTOP_THEME "preferences-desktop-theme" #define PREFERENCES_DESKTOP_THEME "preferences-desktop-theme"
#define PREFERENCES_DESKTOP_WALLPAPER "preferences-desktop-wallpaper" #define PREFERENCES_DESKTOP_WALLPAPER "preferences-desktop-wallpaper"
#define SYSTEM_FILE_MANAGER "system-file-manager" #define SYSTEM_FILE_MANAGER "system-file-manager"
#define SYSTEM_SOFTWARE_UPDATE "system-software-update" #define SYSTEM_SOFTWARE_UPDATE "system-software-update"
#define UTILITIES_TERMINAL "utilities-terminal" #define UTILITIES_TERMINAL "utilities-terminal"
#define APPLICATIONS_ACCESSORIES "applications-accessories" #define APPLICATIONS_ACCESSORIES "applications-accessories"
#define APPLICATIONS_DEVELOPMENT "applications-development" #define APPLICATIONS_DEVELOPMENT "applications-development"
#define APPLICATIONS_GAMES "applications-games" #define APPLICATIONS_GAMES "applications-games"
#define APPLICATIONS_GRAPHICS "applications-graphics" #define APPLICATIONS_GRAPHICS "applications-graphics"
#define APPLICATIONS_INTERNET "applications-internet" #define APPLICATIONS_INTERNET "applications-internet"
#define APPLICATIONS_MULTIMEDIA "applications-multimedia" #define APPLICATIONS_MULTIMEDIA "applications-multimedia"
#define APPLICATIONS_OFFICE "applications-office" #define APPLICATIONS_OFFICE "applications-office"
#define APPLICATIONS_OTHER "applications-other" #define APPLICATIONS_OTHER "applications-other"
#define APPLICATIONS_SYSTEM "applications-system" #define APPLICATIONS_SYSTEM "applications-system"
#define APPLICATIONS_UTILITIES "applications-utilities" #define APPLICATIONS_UTILITIES "applications-utilities"
#define PREFERENCES_DESKTOP "preferences-desktop" #define PREFERENCES_DESKTOP "preferences-desktop"
#define PREFERENCES_DESKTOP_ACCESSIBILITY "preferences-desktop-accessibility" #define PREFERENCES_DESKTOP_ACCESSIBILITY "preferences-desktop-accessibility"
#define PREFERENCES_DESKTOP_PERIPHERALS "preferences-desktop-peripherals" #define PREFERENCES_DESKTOP_PERIPHERALS "preferences-desktop-peripherals"
#define PREFERENCES_DESKTOP_PERSONAL "preferences-desktop-personal" #define PREFERENCES_DESKTOP_PERSONAL "preferences-desktop-personal"
#define PREFERENCES_OTHER "preferences-other" #define PREFERENCES_OTHER "preferences-other"
#define PREFERENCES_SYSTEM "preferences-system" #define PREFERENCES_SYSTEM "preferences-system"
#define PREFERENCES_SYSTEM_NETWORK "preferences-system-network" #define PREFERENCES_SYSTEM_NETWORK "preferences-system-network"
#define SYSTEM_HELP "system-help" #define SYSTEM_HELP "system-help"
#define AUDIO_CARD "audio-card" #define AUDIO_CARD "audio-card"
#define AUDIO_INPUT_MICROPHONE "audio-input-microphone" #define AUDIO_INPUT_MICROPHONE "audio-input-microphone"
#define BATTERY "battery" #define BATTERY "battery"
#define CAMERA_PHOTO "camera-photo" #define CAMERA_PHOTO "camera-photo"
#define CAMERA_VIDEO "camera-video" #define CAMERA_VIDEO "camera-video"
#define COMPUTER "computer" #define COMPUTER "computer"
#define DRIVE_CDROM "drive-cdrom" #define DRIVE_CDROM "drive-cdrom"
#define DRIVE_HARDDISK "drive-harddisk" #define DRIVE_HARDDISK "drive-harddisk"
#define DRIVE_REMOVABLE_MEDIA "drive-removable-media" #define DRIVE_REMOVABLE_MEDIA "drive-removable-media"
#define INPUT_GAMING "input-gaming" #define INPUT_GAMING "input-gaming"
#define INPUT_KEYBOARD "input-keyboard" #define INPUT_KEYBOARD "input-keyboard"
#define INPUT_MOUSE "input-mouse" #define INPUT_MOUSE "input-mouse"
#define MEDIA_CDROM "media-cdrom" #define MEDIA_CDROM "media-cdrom"
#define MEDIA_FLOPPY "media-floppy" #define MEDIA_FLOPPY "media-floppy"
#define MULTIMEDIA_PLAYER "multimedia-player" #define MULTIMEDIA_PLAYER "multimedia-player"
#define NETWORK_WIRED "network-wired" #define NETWORK_WIRED "network-wired"
#define NETWORK_WIRELESS "network-wireless" #define NETWORK_WIRELESS "network-wireless"
#define PRINTER "printer" #define PRINTER "printer"
#define EMBLEM_DEFAULT "emblem-default" #define EMBLEM_DEFAULT "emblem-default"
#define EMBLEM_DOCUMENTS "emblem-documents" #define EMBLEM_DOCUMENTS "emblem-documents"
#define EMBLEM_DOWNLOADS "emblem-downloads" #define EMBLEM_DOWNLOADS "emblem-downloads"
#define EMBLEM_FAVORITE "emblem-favorite" #define EMBLEM_FAVORITE "emblem-favorite"
#define EMBLEM_IMPORTANT "emblem-important" #define EMBLEM_IMPORTANT "emblem-important"
#define EMBLEM_MAIL "emblem-mail" #define EMBLEM_MAIL "emblem-mail"
#define EMBLEM_PHOTOS "emblem-photos" #define EMBLEM_PHOTOS "emblem-photos"
#define EMBLEM_READONLY "emblem-readonly" #define EMBLEM_READONLY "emblem-readonly"
#define EMBLEM_SHARED "emblem-shared" #define EMBLEM_SHARED "emblem-shared"
#define EMBLEM_SYMBOLIC_LINK "emblem-symbolic-link" #define EMBLEM_SYMBOLIC_LINK "emblem-symbolic-link"
#define EMBLEM_SYNCHRONIZED "emblem-synchronized" #define EMBLEM_SYNCHRONIZED "emblem-synchronized"
#define EMBLEM_SYSTEM "emblem-system" #define EMBLEM_SYSTEM "emblem-system"
#define EMBLEM_UNREADABLE "emblem-unreadable" #define EMBLEM_UNREADABLE "emblem-unreadable"
#define FACE_ANGEL "face-angel" #define FACE_ANGEL "face-angel"
#define FACE_CRYING "face-crying" #define FACE_CRYING "face-crying"
#define FACE_DEVIL_GRIN "face-devil-grin" #define FACE_DEVIL_GRIN "face-devil-grin"
#define FACE_DEVIL_SAD "face-devil-sad" #define FACE_DEVIL_SAD "face-devil-sad"
#define FACE_GLASSES "face-glasses" #define FACE_GLASSES "face-glasses"
#define FACE_KISS "face-kiss" #define FACE_KISS "face-kiss"
#define FACE_MONKEY "face-monkey" #define FACE_MONKEY "face-monkey"
#define FACE_PLAIN "face-plain" #define FACE_PLAIN "face-plain"
#define FACE_SAD "face-sad" #define FACE_SAD "face-sad"
#define FACE_SMILE "face-smile" #define FACE_SMILE "face-smile"
#define FACE_SMILE_BIG "face-smile-big" #define FACE_SMILE_BIG "face-smile-big"
#define FACE_SMIRK "face-smirk" #define FACE_SMIRK "face-smirk"
#define FACE_SURPRISE "face-surprise" #define FACE_SURPRISE "face-surprise"
#define FACE_WINK "face-wink" #define FACE_WINK "face-wink"
#define APPLICATION_X_EXECUTABLE "application-x-executable" #define APPLICATION_X_EXECUTABLE "application-x-executable"
#define AUDIO_X_GENERIC "audio-x-generic" #define AUDIO_X_GENERIC "audio-x-generic"
#define FONT_X_GENERIC "font-x-generic" #define FONT_X_GENERIC "font-x-generic"
#define IMAGE_X_GENERIC "image-x-generic" #define IMAGE_X_GENERIC "image-x-generic"
#define PACKAGE_X_GENERIC "package-x-generic" #define PACKAGE_X_GENERIC "package-x-generic"
#define TEXT_HTML "text-html" #define TEXT_HTML "text-html"
#define TEXT_X_GENERIC "text-x-generic" #define TEXT_X_GENERIC "text-x-generic"
#define TEXT_X_GENERIC_TEMPLATE "text-x-generic-template" #define TEXT_X_GENERIC_TEMPLATE "text-x-generic-template"
#define TEXT_X_SCRIPT "text-x-script" #define TEXT_X_SCRIPT "text-x-script"
#define VIDEO_X_GENERIC "video-x-generic" #define VIDEO_X_GENERIC "video-x-generic"
#define X_OFFICE_ADDRESS_BOOK "x-office-address-book" #define X_OFFICE_ADDRESS_BOOK "x-office-address-book"
#define X_OFFICE_CALENDAR "x-office-calendar" #define X_OFFICE_CALENDAR "x-office-calendar"
#define X_OFFICE_DOCUMENT "x-office-document" #define X_OFFICE_DOCUMENT "x-office-document"
#define X_OFFICE_PRESENTATION "x-office-presentation" #define X_OFFICE_PRESENTATION "x-office-presentation"
#define X_OFFICE_SPREADSHEET "x-office-spreadsheet" #define X_OFFICE_SPREADSHEET "x-office-spreadsheet"
#define FOLDER "folder" #define FOLDER "folder"
#define FOLDER_REMOTE "folder-remote" #define FOLDER_REMOTE "folder-remote"
#define NETWORK_SERVER "network-server" #define NETWORK_SERVER "network-server"
#define NETWORK_WORKGROUP "network-workgroup" #define NETWORK_WORKGROUP "network-workgroup"
#define START_HERE "start-here" #define START_HERE "start-here"
#define USER_DESKTOP "user-desktop" #define USER_DESKTOP "user-desktop"
#define USER_HOME "user-home" #define USER_HOME "user-home"
#define USER_TRASH "user-trash" #define USER_TRASH "user-trash"
#define APPOINTMENT_MISSED "appointment-missed" #define APPOINTMENT_MISSED "appointment-missed"
#define APPOINTMENT_SOON "appointment-soon" #define APPOINTMENT_SOON "appointment-soon"
#define AUDIO_VOLUME_HIGH "audio-volume-high" #define AUDIO_VOLUME_HIGH "audio-volume-high"
#define AUDIO_VOLUME_LOW "audio-volume-low" #define AUDIO_VOLUME_LOW "audio-volume-low"
#define AUDIO_VOLUME_MEDIUM "audio-volume-medium" #define AUDIO_VOLUME_MEDIUM "audio-volume-medium"
#define AUDIO_VOLUME_MUTED "audio-volume-muted" #define AUDIO_VOLUME_MUTED "audio-volume-muted"
#define BATTERY_CAUTION "battery-caution" #define BATTERY_CAUTION "battery-caution"
#define BATTERY_LOW "battery-low" #define BATTERY_LOW "battery-low"
#define DIALOG_ERROR "dialog-error" #define DIALOG_ERROR "dialog-error"
#define DIALOG_INFORMATION "dialog-information" #define DIALOG_INFORMATION "dialog-information"
#define DIALOG_PASSWORD "dialog-password" #define DIALOG_PASSWORD "dialog-password"
#define DIALOG_QUESTION "dialog-question" #define DIALOG_QUESTION "dialog-question"
#define DIALOG_WARNING "dialog-warning" #define DIALOG_WARNING "dialog-warning"
#define FOLDER_DRAG_ACCEPT "folder-drag-accept" #define FOLDER_DRAG_ACCEPT "folder-drag-accept"
#define FOLDER_OPEN "folder-open" #define FOLDER_OPEN "folder-open"
#define FOLDER_VISITING "folder-visiting" #define FOLDER_VISITING "folder-visiting"
#define IMAGE_LOADING "image-loading" #define IMAGE_LOADING "image-loading"
#define IMAGE_MISSING "image-missing" #define IMAGE_MISSING "image-missing"
#define MAIL_ATTACHMENT "mail-attachment" #define MAIL_ATTACHMENT "mail-attachment"
#define MAIL_UNREAD "mail-unread" #define MAIL_UNREAD "mail-unread"
#define MAIL_READ "mail-read" #define MAIL_READ "mail-read"
#define MAIL_REPLIED "mail-replied" #define MAIL_REPLIED "mail-replied"
#define MAIL_SIGNED "mail-signed" #define MAIL_SIGNED "mail-signed"
#define MAIL_SIGNED_VERIFIED "mail-signed-verified" #define MAIL_SIGNED_VERIFIED "mail-signed-verified"
#define MEDIA_PLAYLIST_REPEAT "media-playlist-repeat" #define MEDIA_PLAYLIST_REPEAT "media-playlist-repeat"
#define MEDIA_PLAYLIST_SHUFFLE "media-playlist-shuffle" #define MEDIA_PLAYLIST_SHUFFLE "media-playlist-shuffle"
#define NETWORK_ERROR "network-error" #define NETWORK_ERROR "network-error"
#define NETWORK_IDLE "network-idle" #define NETWORK_IDLE "network-idle"
#define NETWORK_OFFLINE "network-offline" #define NETWORK_OFFLINE "network-offline"
#define NETWORK_RECEIVE "network-receive" #define NETWORK_RECEIVE "network-receive"
#define NETWORK_TRANSMIT "network-transmit" #define NETWORK_TRANSMIT "network-transmit"
#define NETWORK_TRANSMIT_RECEIVE "network-transmit-receive" #define NETWORK_TRANSMIT_RECEIVE "network-transmit-receive"
#define PRINTER_ERROR "printer-error" #define PRINTER_ERROR "printer-error"
#define PRINTER_PRINTING "printer-printing" #define PRINTER_PRINTING "printer-printing"
#define SOFTWARE_UPDATE_AVAILABLE "software-update-available" #define SOFTWARE_UPDATE_AVAILABLE "software-update-available"
#define SOFTWARE_UPDATE_URGENT "software-update-urgent" #define SOFTWARE_UPDATE_URGENT "software-update-urgent"
#define SYNC_ERROR "sync-error" #define SYNC_ERROR "sync-error"
#define SYNC_SYNCHRONIZING "sync-synchronizing" #define SYNC_SYNCHRONIZING "sync-synchronizing"
#define TASK_DUE "task-due" #define TASK_DUE "task-due"
#define TASK_PASSED_DUE "task-passed-due" #define TASK_PASSED_DUE "task-passed-due"
#define USER_AWAY "user-away" #define USER_AWAY "user-away"
#define USER_IDLE "user-idle" #define USER_IDLE "user-idle"
#define USER_OFFLINE "user-offline" #define USER_OFFLINE "user-offline"
#define USER_ONLINE "user-online" #define USER_ONLINE "user-online"
#define USER_TRASH_FULL "user-trash-full" #define USER_TRASH_FULL "user-trash-full"
#define WEATHER_CLEAR "weather-clear" #define WEATHER_CLEAR "weather-clear"
#define WEATHER_CLEAR_NIGHT "weather-clear-night" #define WEATHER_CLEAR_NIGHT "weather-clear-night"
#define WEATHER_FEW_CLOUDS "weather-few-clouds" #define WEATHER_FEW_CLOUDS "weather-few-clouds"
#define WEATHER_FEW_CLOUDS_NIGHT "weather-few-clouds-night" #define WEATHER_FEW_CLOUDS_NIGHT "weather-few-clouds-night"
#define WEATHER_FOG "weather-fog" #define WEATHER_FOG "weather-fog"
#define WEATHER_OVERCAST "weather-overcast" #define WEATHER_OVERCAST "weather-overcast"
#define WEATHER_SEVERE_ALERT "weather-severe-alert" #define WEATHER_SEVERE_ALERT "weather-severe-alert"
#define WEATHER_SHOWERS "weather-showers" #define WEATHER_SHOWERS "weather-showers"
#define WEATHER_SHOWERS_SCATTERED "weather-showers-scattered" #define WEATHER_SHOWERS_SCATTERED "weather-showers-scattered"
#define WEATHER_SNOW "weather-snow" #define WEATHER_SNOW "weather-snow"
#define WEATHER_STORM "weather-storm" #define WEATHER_STORM "weather-storm"
const char *icons[] = { const char *icons[] = {
ADDRESS_BOOK_NEW, ADDRESS_BOOK_NEW,
@ -414,7 +414,7 @@ const char *icons[] = {
MULTIMEDIA_PLAYER, MULTIMEDIA_PLAYER,
NETWORK_WIRED, NETWORK_WIRED,
NETWORK_WIRELESS, NETWORK_WIRELESS,
PRINTER, PRINTER,
EMBLEM_DEFAULT, EMBLEM_DEFAULT,
EMBLEM_DOCUMENTS, EMBLEM_DOCUMENTS,
EMBLEM_DOWNLOADS, EMBLEM_DOWNLOADS,
@ -525,4 +525,3 @@ const char *icons[] = {
}; };
#endif #endif

View File

@ -236,7 +236,7 @@ ef_cb_efreet_config_dirs(void)
char dirs[128], *val; char dirs[128], *val;
char *vals[] = {"/var/tmp/a", "/tmp/b", "/usr/local/share", "/etc", NULL}; char *vals[] = {"/var/tmp/a", "/tmp/b", "/usr/local/share", "/etc", NULL};
char *def_vals[] = {"/etc/xdg", NULL}; char *def_vals[] = {"/etc/xdg", NULL};
dirs[0] = '\0'; dirs[0] = '\0';
for (i = 0; vals[i] != NULL; i++) for (i = 0; vals[i] != NULL; i++)
@ -300,4 +300,3 @@ ef_cb_efreet_config_dirs(void)
} }
return ret; return ret;
} }

View File

@ -17,7 +17,7 @@ ef_cb_desktop_parse(void)
int ret = 1; int ret = 1;
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test.desktop"); desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test.desktop");
if (!desktop) if (!desktop)
{ {
printf("No desktop found.\n"); printf("No desktop found.\n");
return 0; return 0;
@ -29,7 +29,7 @@ ef_cb_desktop_parse(void)
ret = 0; ret = 0;
} }
if (!desktop->generic_name || if (!desktop->generic_name ||
strcmp(desktop->generic_name, "Test Application")) strcmp(desktop->generic_name, "Test Application"))
{ {
printf("Incorrent GenericName\n"); printf("Incorrent GenericName\n");
@ -51,7 +51,7 @@ ef_cb_desktop_parse(void)
ecore_list_first_goto(desktop->categories); ecore_list_first_goto(desktop->categories);
while ((cat = ecore_list_next(desktop->categories))) while ((cat = ecore_list_next(desktop->categories)))
{ {
if (i >= num_categories) if (i >= num_categories)
{ {
printf("Too many categories found.\n"); printf("Too many categories found.\n");
ret = 0; ret = 0;
@ -318,7 +318,7 @@ ef_cb_desktop_command_get(void)
ret = info->error > 0 ? 0 : 1; ret = info->error > 0 ? 0 : 1;
free(info); free(info);
chdir(olddir); chdir(olddir);
return ret; return ret;
@ -367,10 +367,10 @@ ef_cb_desktop_type_parse(void)
/* add my custom desktop type to efreet */ /* add my custom desktop type to efreet */
my_type = efreet_desktop_type_add("My_Type", cb_type_parse, NULL, my_type = efreet_desktop_type_add("My_Type", cb_type_parse, NULL,
(Efreet_Desktop_Type_Free_Cb)free); (Efreet_Desktop_Type_Free_Cb)free);
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test_type.desktop"); desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test_type.desktop");
if (!desktop) if (!desktop)
{ {
printf("No desktop found.\n"); printf("No desktop found.\n");
return 0; return 0;
@ -388,10 +388,7 @@ ef_cb_desktop_type_parse(void)
printf("Invalid value of custom key (%s).\n", val); printf("Invalid value of custom key (%s).\n", val);
ret = 0; ret = 0;
} }
efreet_desktop_free(desktop); efreet_desktop_free(desktop);
return ret; return ret;
} }

View File

@ -12,9 +12,9 @@
#define SIZE "128x128" #define SIZE "128x128"
#define THEME "Tango" #define THEME "Tango"
static void ef_icon_theme_themes_find(const char *search_dir, static void ef_icon_theme_themes_find(const char *search_dir,
Ecore_Hash *themes); Ecore_Hash *themes);
static void ef_icons_find(Efreet_Icon_Theme *theme, Ecore_List *themes, static void ef_icons_find(Efreet_Icon_Theme *theme, Ecore_List *themes,
Ecore_Hash *icons); Ecore_Hash *icons);
static void ef_read_dir(const char *dir, Ecore_Hash *icons); static void ef_read_dir(const char *dir, Ecore_Hash *icons);
@ -70,13 +70,13 @@ ef_cb_efreet_icon_theme_list(void)
ecore_list_first_goto(icon_dirs); ecore_list_first_goto(icon_dirs);
ef_icon_theme_themes_find(efreet_icon_user_dir_get(), dirs); ef_icon_theme_themes_find(efreet_icon_user_dir_get(), dirs);
while ((dir = ecore_list_next(icon_dirs))) while ((dir = ecore_list_next(icon_dirs)))
{ {
snprintf(buf, sizeof(buf), "%s/icons", dir); snprintf(buf, sizeof(buf), "%s/icons", dir);
ef_icon_theme_themes_find(buf, dirs); ef_icon_theme_themes_find(buf, dirs);
} }
ef_icon_theme_themes_find("/usr/share/pixmaps", dirs); ef_icon_theme_themes_find("/usr/share/pixmaps", dirs);
themes = efreet_icon_theme_list_get(); themes = efreet_icon_theme_list_get();
ecore_list_first_goto(themes); ecore_list_first_goto(themes);
while ((theme = ecore_list_next(themes))) while ((theme = ecore_list_next(themes)))
@ -159,7 +159,7 @@ ef_icon_theme_themes_find(const char *search_dir, Ecore_Hash *themes)
ecore_list_destroy(dirs); ecore_list_destroy(dirs);
} }
const char *icons[] = const char *icons[] =
{ {
"address-book-new", "address-book-new",
"application-exit", "application-exit",
@ -169,7 +169,7 @@ const char *icons[] =
"dialog-cancel", "dialog-cancel",
"dialog-close", "dialog-close",
"dialog-ok", "dialog-ok",
"document-new", "document-new",
"document-open", "document-open",
"document-open-recent", "document-open-recent",
"document-page-setup", "document-page-setup",
@ -445,7 +445,7 @@ ef_cb_efreet_icon_match(void)
ecore_hash_free_key_cb_set(icon_hash, free); ecore_hash_free_key_cb_set(icon_hash, free);
ecore_hash_free_value_cb_set(icon_hash, free); ecore_hash_free_value_cb_set(icon_hash, free);
ef_icons_find(theme, themes, icon_hash); ef_icons_find(theme, themes, icon_hash);
ecore_list_destroy(themes); ecore_list_destroy(themes);
for (i = 0; icons[i] != NULL; i++) for (i = 0; icons[i] != NULL; i++)
@ -580,7 +580,7 @@ ef_read_dir(const char *dir, Ecore_Hash *icons)
char *p; char *p;
p = strrchr(file, '.'); p = strrchr(file, '.');
if (!p) if (!p)
{ {
FREE(file); FREE(file);
continue; continue;
@ -599,4 +599,3 @@ ef_read_dir(const char *dir, Ecore_Hash *icons)
} }
ecore_list_destroy(files); ecore_list_destroy(files);
} }

View File

@ -13,7 +13,7 @@ ef_cb_ini_parse(void)
putenv("LC_ALL=en_US"); putenv("LC_ALL=en_US");
ini = efreet_ini_new(PACKAGE_DATA_DIR"/efreet/test/test.ini"); ini = efreet_ini_new(PACKAGE_DATA_DIR"/efreet/test/test.ini");
if (!ini) if (!ini)
{ {
printf("efreet_ini_parse() Failed to initialize Efreet_Ini\n"); printf("efreet_ini_parse() Failed to initialize Efreet_Ini\n");
return 0; return 0;
@ -26,14 +26,14 @@ ef_cb_ini_parse(void)
unsigned int bval; unsigned int bval;
val = efreet_ini_string_get(ini, "Name"); val = efreet_ini_string_get(ini, "Name");
if (!val || strcmp(val, "Foo Bar")) if (!val || strcmp(val, "Foo Bar"))
{ {
printf("efreet_ini_string_get() Name parsed incorrectly\n"); printf("efreet_ini_string_get() Name parsed incorrectly\n");
ret = 0; ret = 0;
} }
val = efreet_ini_localestring_get(ini, "Name"); val = efreet_ini_localestring_get(ini, "Name");
if (!val || strcmp(val, "English Foo Bar")) if (!val || strcmp(val, "English Foo Bar"))
{ {
printf("efreet_ini_localestring_get() Name parsed incorrectly\n"); printf("efreet_ini_localestring_get() Name parsed incorrectly\n");
ret = 0; ret = 0;
@ -88,7 +88,7 @@ ef_cb_ini_parse(void)
ret = 0; ret = 0;
} }
} }
else else
{ {
printf("efreet_ini_section_set() Failed to set 'contact' section\n"); printf("efreet_ini_section_set() Failed to set 'contact' section\n");
ret = 0; ret = 0;
@ -105,7 +105,7 @@ ef_cb_ini_long_line(void)
Efreet_Ini *ini; Efreet_Ini *ini;
int ret = 1; int ret = 1;
struct struct
{ {
char *key; char *key;
int len; int len;
@ -113,7 +113,7 @@ ef_cb_ini_long_line(void)
{"key", 5099}, {"key", 5099},
{"key2", 5099}, {"key2", 5099},
{NULL, 0} {NULL, 0}
}; };
ini = efreet_ini_new(PACKAGE_DATA_DIR"/efreet/test/long.ini"); ini = efreet_ini_new(PACKAGE_DATA_DIR"/efreet/test/long.ini");
if (!ini) if (!ini)
@ -121,7 +121,7 @@ ef_cb_ini_long_line(void)
printf("Ini failed to parse.\n"); printf("Ini failed to parse.\n");
ret = 0; ret = 0;
} }
if (ret) ret = efreet_ini_section_set(ini, "section"); if (ret) ret = efreet_ini_section_set(ini, "section");
if (ret) if (ret)
{ {

View File

@ -12,7 +12,7 @@ ef_cb_locale(void)
char *country; char *country;
char *modifier; char *modifier;
} langs[] = { } langs[] = {
/* these are ordered such that when we move from LANG to LC_MESSAGES /* these are ordered such that when we move from LANG to LC_MESSAGES
* the LANG env will still be effect. Same with moving from * the LANG env will still be effect. Same with moving from
* LC_MESSAGES to LANG */ * LC_MESSAGES to LANG */
{"LANG=", NULL, NULL, NULL}, {"LANG=", NULL, NULL, NULL},
@ -51,7 +51,7 @@ ef_cb_locale(void)
if ((langs[i].lang && (!tmp || strcmp(tmp, langs[i].lang))) if ((langs[i].lang && (!tmp || strcmp(tmp, langs[i].lang)))
|| (!langs[i].lang && tmp)) || (!langs[i].lang && tmp))
{ {
printf("efreet_lang_get() is wrong (%s) with %s\n", printf("efreet_lang_get() is wrong (%s) with %s\n",
tmp, langs[i].lang); tmp, langs[i].lang);
ret = 0; ret = 0;
} }
@ -60,13 +60,13 @@ ef_cb_locale(void)
if ((langs[i].country && (!tmp || strcmp(tmp, langs[i].country))) if ((langs[i].country && (!tmp || strcmp(tmp, langs[i].country)))
|| (!langs[i].country && tmp)) || (!langs[i].country && tmp))
{ {
printf("efreet_lang_country_get() is wrong (%s) with %s\n", printf("efreet_lang_country_get() is wrong (%s) with %s\n",
tmp, langs[i].lang); tmp, langs[i].lang);
ret = 0; ret = 0;
} }
tmp = efreet_lang_modifier_get(); tmp = efreet_lang_modifier_get();
if ((langs[i].modifier && (!tmp || strcmp(tmp, langs[i].modifier))) if ((langs[i].modifier && (!tmp || strcmp(tmp, langs[i].modifier)))
|| (!langs[i].modifier && tmp)) || (!langs[i].modifier && tmp))
{ {
printf("efreet_lang_modifier_get() is wrong with %s with %s\n", printf("efreet_lang_modifier_get() is wrong with %s with %s\n",
@ -77,7 +77,6 @@ ef_cb_locale(void)
efreet_shutdown(); efreet_shutdown();
efreet_init(); efreet_init();
} }
return ret; return ret;
} }

View File

@ -98,7 +98,7 @@ ef_cb_menu_edit(void)
#endif #endif
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test.desktop"); desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test.desktop");
if (!desktop) if (!desktop)
{ {
efreet_menu_free(menu); efreet_menu_free(menu);
printf("No desktop found.\n"); printf("No desktop found.\n");
@ -150,4 +150,3 @@ ef_cb_menu_edit(void)
efreet_menu_free(menu); efreet_menu_free(menu);
return 1; return 1;
} }

View File

@ -11,7 +11,7 @@ ef_mime_cb_get(void)
{ {
const char *mime = NULL; const char *mime = NULL;
int misses = 0, i = 0; int misses = 0, i = 0;
struct struct
{ {
char *file; char *file;
char *mime; char *mime;
@ -22,8 +22,8 @@ ef_mime_cb_get(void)
{PACKAGE_DATA_DIR"/efreet/test/sub", "inode/directory"}, {PACKAGE_DATA_DIR"/efreet/test/sub", "inode/directory"},
{NULL, NULL} {NULL, NULL}
}; };
if (!efreet_mime_init()) if (!efreet_mime_init())
{ {
printf("Could not init efreet\n"); printf("Could not init efreet\n");
@ -31,10 +31,10 @@ ef_mime_cb_get(void)
} }
for (i = 0; files[i].file != NULL; ++i) for (i = 0; files[i].file != NULL; ++i)
{ {
mime = efreet_mime_type_get(files[i].file); mime = efreet_mime_type_get(files[i].file);
if (!mime) if (!mime)
{ {
printf("Got %s as null instead of %s\n", files[i].file, files[i].mime); printf("Got %s as null instead of %s\n", files[i].file, files[i].mime);
misses ++; misses ++;
} }
@ -44,8 +44,8 @@ ef_mime_cb_get(void)
misses ++; misses ++;
} }
} }
efreet_mime_shutdown(); efreet_mime_shutdown();
return !misses; return !misses;
} }

View File

@ -43,7 +43,7 @@ dump(Efreet_Menu *menu, const char *path)
if (entry->type == EFREET_MENU_ENTRY_DESKTOP) if (entry->type == EFREET_MENU_ENTRY_DESKTOP)
{ {
if (!path || !*path) path = "/"; if (!path || !*path) path = "/";
printf("%s\t%s\t%s\n", path, entry->id, printf("%s\t%s\t%s\n", path, entry->id,
entry->desktop->orig_path); entry->desktop->orig_path);
} }
else if (entry->type == EFREET_MENU_ENTRY_MENU) else if (entry->type == EFREET_MENU_ENTRY_MENU)
@ -55,4 +55,3 @@ dump(Efreet_Menu *menu, const char *path)
} }
} }
} }

View File

@ -135,9 +135,9 @@ main(int argc, char ** argv)
double start; double start;
/* we've been given specific tests and it isn't in the list */ /* we've been given specific tests and it isn't in the list */
if (run && !ecore_list_find(run, ECORE_COMPARE_CB(strcasecmp), if (run && !ecore_list_find(run, ECORE_COMPARE_CB(strcasecmp),
tests[i].name)) tests[i].name))
continue; continue;
if (!efreet_init()) if (!efreet_init())
{ {
@ -147,11 +147,11 @@ main(int argc, char ** argv)
num_tests ++; num_tests ++;
printf("%s:\t\t", tests[i].name); printf("%s:\t\t", tests[i].name);
fflush(stdout); fflush(stdout);
start = ecore_time_get(); start = ecore_time_get();
ret = tests[i].cb(); ret = tests[i].cb();
printf("%s in %.3f seconds\n", (ret ? "PASSED" : "FAILED"), printf("%s in %.3f seconds\n", (ret ? "PASSED" : "FAILED"),
ecore_time_get() - start); ecore_time_get() - start);
passed += ret; passed += ret;
@ -168,4 +168,3 @@ main(int argc, char ** argv)
printf("Total run: %.3f seconds\n", ecore_time_get() - total); printf("Total run: %.3f seconds\n", ecore_time_get() - total);
return 0; return 0;
} }

View File

@ -3,7 +3,7 @@
#define EFREET_H #define EFREET_H
/** /**
* @file Efreet.h * @file Efreet.h
* @brief The file that must be included by any project wishing to use * @brief The file that must be included by any project wishing to use
* Efreet. Efreet.h provides all of the necessary headers and includes to * Efreet. Efreet.h provides all of the necessary headers and includes to
* work with Efreet. * work with Efreet.
@ -17,7 +17,7 @@
* Efreet is a library designed to help apps work several of the * Efreet is a library designed to help apps work several of the
* Freedesktop.org standards regarding Icons, Desktop files and Menus. To * Freedesktop.org standards regarding Icons, Desktop files and Menus. To
* that end it implements the following specifications: * that end it implements the following specifications:
* *
* @li XDG Base Directory Specification * @li XDG Base Directory Specification
* @li Icon Theme Specification * @li Icon Theme Specification
* @li Desktop Entry Specification * @li Desktop Entry Specification
@ -42,4 +42,3 @@ int efreet_shutdown(void);
#endif #endif
#endif #endif

View File

@ -3,9 +3,9 @@
#define EFREET_MIME_H #define EFREET_MIME_H
/** /**
* @file Efreet_Mime.h * @file Efreet_Mime.h
* @brief The file that must be included by any project wishing to use * @brief The file that must be included by any project wishing to use
* Efreet_Mime. Efreet_Mime.h provides all of the necessary headers and * Efreet_Mime. Efreet_Mime.h provides all of the necessary headers and
* includes to work with Efreet_Mime. * includes to work with Efreet_Mime.
*/ */
@ -14,7 +14,7 @@
* *
* @section intro Introduction * @section intro Introduction
* *
* Efreet Mime is a library designed to help apps work with the * Efreet Mime is a library designed to help apps work with the
* Freedesktop.org Shared Mime Info standard. * Freedesktop.org Shared Mime Info standard.
*/ */
@ -34,8 +34,8 @@ const char *efreet_mime_magic_type_get(const char *file);
const char *efreet_mime_globs_type_get(const char *file); const char *efreet_mime_globs_type_get(const char *file);
const char *efreet_mime_special_type_get(const char *file); const char *efreet_mime_special_type_get(const char *file);
const char *efreet_mime_fallback_type_get(const char *file); const char *efreet_mime_fallback_type_get(const char *file);
char *efreet_mime_type_icon_get(const char *mime, const char *theme, char *efreet_mime_type_icon_get(const char *mime, const char *theme,
const char *size); const char *size);
/** /**

View File

@ -16,7 +16,7 @@ efreet_desktop.h \
efreet_icon.h \ efreet_icon.h \
efreet_ini.h \ efreet_ini.h \
efreet_menu.h \ efreet_menu.h \
efreet_utils.h efreet_utils.h
EFREETSOURCES = \ EFREETSOURCES = \
efreet.c \ efreet.c \

View File

@ -32,7 +32,7 @@ efreet_init(void)
* @return Returns the number of times the init function as been called * @return Returns the number of times the init function as been called
* minus the corresponding init call. * minus the corresponding init call.
* @brief Shuts down Efreet if a balanced number of init/shutdown calls have * @brief Shuts down Efreet if a balanced number of init/shutdown calls have
* been made * been made
*/ */
int int
efreet_shutdown(void) efreet_shutdown(void)
@ -106,7 +106,7 @@ static void
efreet_parse_locale(void) efreet_parse_locale(void)
{ {
efreet_parsed_locale = 1; efreet_parsed_locale = 1;
if (efreet_parse_locale_setting("LC_ALL")) if (efreet_parse_locale_setting("LC_ALL"))
return; return;
@ -187,5 +187,3 @@ efreet_array_cat(char *buffer, size_t size, const char *strs[])
} }
return n; return n;
} }

View File

@ -10,7 +10,7 @@ static Ecore_List *xdg_data_dirs = NULL;
static Ecore_List *xdg_config_dirs = NULL; static Ecore_List *xdg_config_dirs = NULL;
static const char *efreet_dir_get(const char *key, const char *fallback); static const char *efreet_dir_get(const char *key, const char *fallback);
static Ecore_List *efreet_dirs_get(const char *key, static Ecore_List *efreet_dirs_get(const char *key,
const char *fallback); const char *fallback);
/** /**
@ -89,7 +89,7 @@ Ecore_List *
efreet_data_dirs_get(void) efreet_data_dirs_get(void)
{ {
if (xdg_data_dirs) return xdg_data_dirs; if (xdg_data_dirs) return xdg_data_dirs;
xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS", xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS",
"/usr/local/share:/usr/share"); "/usr/local/share:/usr/share");
return xdg_data_dirs; return xdg_data_dirs;
} }
@ -154,7 +154,7 @@ efreet_dir_get(const char *key, const char *fallback)
{ {
int len; int len;
const char *user; const char *user;
user = efreet_home_dir_get(); user = efreet_home_dir_get();
len = strlen(user) + strlen(fallback) + 1; len = strlen(user) + strlen(fallback) + 1;
dir = malloc(sizeof(char) * len); dir = malloc(sizeof(char) * len);
@ -209,4 +209,3 @@ efreet_dirs_get(const char *key, const char *fallback)
return dirs; return dirs;
} }

View File

@ -4,9 +4,9 @@
/** /**
* @file efreet_base.h * @file efreet_base.h
* @brief Contains the methods used to support the FDO base directory * @brief Contains the methods used to support the FDO base directory
* specification. * specification.
* @addtogroup Efreet_Base Efreet_Base: The XDG Base Directory Specification * @addtogroup Efreet_Base Efreet_Base: The XDG Base Directory Specification
* functions * functions
* *
* @{ * @{
@ -28,4 +28,3 @@ const char *efreet_cache_home_get(void);
*/ */
#endif #endif

View File

@ -10,7 +10,7 @@
static const char *desktop_environment = NULL; static const char *desktop_environment = NULL;
/** /**
* A cache of all loaded desktops, hashed by file name. * A cache of all loaded desktops, hashed by file name.
* Values are Efreet_Desktop structures * Values are Efreet_Desktop structures
*/ */
static Ecore_Hash *efreet_desktop_cache = NULL; static Ecore_Hash *efreet_desktop_cache = NULL;
@ -49,53 +49,53 @@ struct Efreet_Desktop_Type_Info
static int efreet_desktop_read(Efreet_Desktop *desktop); static int efreet_desktop_read(Efreet_Desktop *desktop);
static void efreet_desktop_clear(Efreet_Desktop *desktop); static void efreet_desktop_clear(Efreet_Desktop *desktop);
static Efreet_Desktop_Type_Info *efreet_desktop_type_parse(const char *type_str); static Efreet_Desktop_Type_Info *efreet_desktop_type_parse(const char *type_str);
static void *efreet_desktop_application_fields_parse(Efreet_Desktop *desktop, static void *efreet_desktop_application_fields_parse(Efreet_Desktop *desktop,
Efreet_Ini *ini); Efreet_Ini *ini);
static void efreet_desktop_application_fields_save(Efreet_Desktop *desktop, static void efreet_desktop_application_fields_save(Efreet_Desktop *desktop,
Efreet_Ini *ini); Efreet_Ini *ini);
static void *efreet_desktop_link_fields_parse(Efreet_Desktop *desktop, static void *efreet_desktop_link_fields_parse(Efreet_Desktop *desktop,
Efreet_Ini *ini); Efreet_Ini *ini);
static void efreet_desktop_link_fields_save(Efreet_Desktop *desktop, static void efreet_desktop_link_fields_save(Efreet_Desktop *desktop,
Efreet_Ini *ini); Efreet_Ini *ini);
static int efreet_desktop_generic_fields_parse(Efreet_Desktop *desktop, static int efreet_desktop_generic_fields_parse(Efreet_Desktop *desktop,
Efreet_Ini *ini); Efreet_Ini *ini);
static void efreet_desktop_generic_fields_save(Efreet_Desktop *desktop, static void efreet_desktop_generic_fields_save(Efreet_Desktop *desktop,
Efreet_Ini *ini); Efreet_Ini *ini);
static void efreet_desktop_x_fields_parse(Ecore_Hash_Node *node, static void efreet_desktop_x_fields_parse(Ecore_Hash_Node *node,
Efreet_Desktop *desktop); Efreet_Desktop *desktop);
static int efreet_desktop_environment_check(Efreet_Ini *ini); static int efreet_desktop_environment_check(Efreet_Ini *ini);
static char *efreet_string_append(char *dest, int *size, static char *efreet_string_append(char *dest, int *size,
int *len, const char *src); int *len, const char *src);
static char *efreet_string_append_char(char *dest, int *size, static char *efreet_string_append_char(char *dest, int *size,
int *len, char c); int *len, char c);
static Ecore_List *efreet_desktop_command_build(Efreet_Desktop_Command *command); static Ecore_List *efreet_desktop_command_build(Efreet_Desktop_Command *command);
static void efreet_desktop_command_free(Efreet_Desktop_Command *command); static void efreet_desktop_command_free(Efreet_Desktop_Command *command);
static char *efreet_desktop_command_append_quoted(char *dest, int *size, static char *efreet_desktop_command_append_quoted(char *dest, int *size,
int *len, char *src); int *len, char *src);
static char *efreet_desktop_command_append_icon(char *dest, int *size, int *len, static char *efreet_desktop_command_append_icon(char *dest, int *size, int *len,
Efreet_Desktop *desktop); Efreet_Desktop *desktop);
static char *efreet_desktop_command_append_single(char *dest, int *size, int *len, static char *efreet_desktop_command_append_single(char *dest, int *size, int *len,
Efreet_Desktop_Command_File *file, Efreet_Desktop_Command_File *file,
char type); char type);
static char *efreet_desktop_command_append_multiple(char *dest, int *size, int *len, static char *efreet_desktop_command_append_multiple(char *dest, int *size, int *len,
Efreet_Desktop_Command *command, Efreet_Desktop_Command *command,
char type); char type);
static char *efreet_desktop_command_path_absolute(const char *path); static char *efreet_desktop_command_path_absolute(const char *path);
static Efreet_Desktop_Command_File *efreet_desktop_command_file_process( static Efreet_Desktop_Command_File *efreet_desktop_command_file_process(
Efreet_Desktop_Command *command, Efreet_Desktop_Command *command,
const char *file); const char *file);
static const char *efreet_desktop_command_file_uri_process(const char *uri); static const char *efreet_desktop_command_file_uri_process(const char *uri);
static void efreet_desktop_command_file_free(Efreet_Desktop_Command_File *file); static void efreet_desktop_command_file_free(Efreet_Desktop_Command_File *file);
static void efreet_desktop_cb_download_complete(void *data, const char *file, static void efreet_desktop_cb_download_complete(void *data, const char *file,
int status); int status);
static int efreet_desktop_cb_download_progress(void *data, const char *file, static int efreet_desktop_cb_download_progress(void *data, const char *file,
long int dltotal, long int dlnow, long int dltotal, long int dlnow,
long int ultotal, long int ulnow); long int ultotal, long int ulnow);
static void efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop, static void efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop,
char *exec, int remaining); char *exec, int remaining);
static void efreet_desktop_type_info_free(Efreet_Desktop_Type_Info *info); static void efreet_desktop_type_info_free(Efreet_Desktop_Type_Info *info);
@ -117,22 +117,22 @@ efreet_desktop_init(void)
efreet_desktop_cache = ecore_hash_new(ecore_str_hash, ecore_str_compare); efreet_desktop_cache = ecore_hash_new(ecore_str_hash, ecore_str_compare);
ecore_hash_free_key_cb_set(efreet_desktop_cache, ECORE_FREE_CB(free)); ecore_hash_free_key_cb_set(efreet_desktop_cache, ECORE_FREE_CB(free));
#if 0 #if 0
ecore_hash_free_value_cb_set(efreet_desktop_cache, ecore_hash_free_value_cb_set(efreet_desktop_cache,
ECORE_FREE_CB(efreet_desktop_free)); ECORE_FREE_CB(efreet_desktop_free));
#endif #endif
efreet_desktop_types = ecore_list_new(); efreet_desktop_types = ecore_list_new();
ecore_list_free_cb_set(efreet_desktop_types, ecore_list_free_cb_set(efreet_desktop_types,
ECORE_FREE_CB(efreet_desktop_type_info_free)); ECORE_FREE_CB(efreet_desktop_type_info_free));
EFREET_DESKTOP_TYPE_APPLICATION = efreet_desktop_type_add("Application", EFREET_DESKTOP_TYPE_APPLICATION = efreet_desktop_type_add("Application",
efreet_desktop_application_fields_parse, efreet_desktop_application_fields_parse,
efreet_desktop_application_fields_save, efreet_desktop_application_fields_save,
NULL); NULL);
EFREET_DESKTOP_TYPE_LINK = efreet_desktop_type_add("Link", EFREET_DESKTOP_TYPE_LINK = efreet_desktop_type_add("Link",
efreet_desktop_link_fields_parse, efreet_desktop_link_fields_parse,
efreet_desktop_link_fields_save, NULL); efreet_desktop_link_fields_save, NULL);
EFREET_DESKTOP_TYPE_DIRECTORY = efreet_desktop_type_add("Directory", NULL, EFREET_DESKTOP_TYPE_DIRECTORY = efreet_desktop_type_add("Directory", NULL,
NULL, NULL); NULL, NULL);
return init; return init;
@ -161,7 +161,7 @@ efreet_desktop_shutdown(void)
* @internal * @internal
* @param desktop: The desktop to check * @param desktop: The desktop to check
* @return Returns 1 if the cache is still valid, 0 otherwise * @return Returns 1 if the cache is still valid, 0 otherwise
* @brief This will check if the desktop cache is still valid. * @brief This will check if the desktop cache is still valid.
*/ */
static int static int
efreet_desktop_cache_check(Efreet_Desktop *desktop) efreet_desktop_cache_check(Efreet_Desktop *desktop)
@ -169,7 +169,7 @@ efreet_desktop_cache_check(Efreet_Desktop *desktop)
if (!desktop) return 0; if (!desktop) return 0;
/* have we modified this file since we last read it in? */ /* have we modified this file since we last read it in? */
if ((desktop->cache_flush != cache_flush) || if ((desktop->cache_flush != cache_flush) ||
(ecore_file_mod_time(desktop->orig_path) != desktop->load_time)) (ecore_file_mod_time(desktop->orig_path) != desktop->load_time))
return 0; return 0;
@ -178,7 +178,7 @@ efreet_desktop_cache_check(Efreet_Desktop *desktop)
/** /**
* @param file: The file to get the Efreet_Desktop from * @param file: The file to get the Efreet_Desktop from
* @return Returns a reference to a cached Efreet_Desktop on success, NULL * @return Returns a reference to a cached Efreet_Desktop on success, NULL
* on failure. This reference should not be freed. * on failure. This reference should not be freed.
* @brief Gets a reference to an Efreet_Desktop structure representing the * @brief Gets a reference to an Efreet_Desktop structure representing the
* contents of @a file or NULL if @a file is not a valid .desktop file. * contents of @a file or NULL if @a file is not a valid .desktop file.
@ -188,7 +188,7 @@ efreet_desktop_get(const char *file)
{ {
Efreet_Desktop *desktop; Efreet_Desktop *desktop;
if (efreet_desktop_cache) if (efreet_desktop_cache)
{ {
desktop = ecore_hash_get(efreet_desktop_cache, file); desktop = ecore_hash_get(efreet_desktop_cache, file);
if (desktop) if (desktop)
@ -299,7 +299,7 @@ efreet_desktop_read(Efreet_Desktop *desktop)
int ok; int ok;
ini = efreet_ini_new(desktop->orig_path); ini = efreet_ini_new(desktop->orig_path);
if (!ini->data) if (!ini->data)
{ {
efreet_ini_free(ini); efreet_ini_free(ini);
return 0; return 0;
@ -307,7 +307,7 @@ efreet_desktop_read(Efreet_Desktop *desktop)
ok = efreet_ini_section_set(ini, "Desktop Entry"); ok = efreet_ini_section_set(ini, "Desktop Entry");
if (!ok) ok = efreet_ini_section_set(ini, "KDE Desktop Entry"); if (!ok) ok = efreet_ini_section_set(ini, "KDE Desktop Entry");
if (!ok) if (!ok)
{ {
printf("efreet_desktop_new error: no Desktop Entry section\n"); printf("efreet_desktop_new error: no Desktop Entry section\n");
error = 1; error = 1;
@ -324,7 +324,7 @@ efreet_desktop_read(Efreet_Desktop *desktop)
desktop->version = efreet_ini_double_get(ini, "Version"); desktop->version = efreet_ini_double_get(ini, "Version");
if (info->parse_func) if (info->parse_func)
desktop->type_data = info->parse_func(desktop, ini); desktop->type_data = info->parse_func(desktop, ini);
} }
else else
error = 1; error = 1;
@ -377,7 +377,7 @@ efreet_desktop_clear(Efreet_Desktop *desktop)
Efreet_Desktop_Type_Info *info; Efreet_Desktop_Type_Info *info;
info = ecore_list_index_goto(efreet_desktop_types, desktop->type); info = ecore_list_index_goto(efreet_desktop_types, desktop->type);
if (info->free_func) if (info->free_func)
info->free_func(desktop->type_data); info->free_func(desktop->type_data);
} }
} }
@ -399,7 +399,7 @@ efreet_desktop_save(Efreet_Desktop *desktop)
efreet_ini_section_set(ini, "Desktop Entry"); efreet_ini_section_set(ini, "Desktop Entry");
info = ecore_list_index_goto(efreet_desktop_types, desktop->type); info = ecore_list_index_goto(efreet_desktop_types, desktop->type);
if (info) if (info)
{ {
efreet_ini_string_set(ini, "Type", info->type); efreet_ini_string_set(ini, "Type", info->type);
if (info->save_func) info->save_func(desktop, ini); if (info->save_func) info->save_func(desktop, ini);
@ -434,7 +434,7 @@ efreet_desktop_save(Efreet_Desktop *desktop)
if (desktop != ecore_hash_get(efreet_desktop_cache, desktop->orig_path)) if (desktop != ecore_hash_get(efreet_desktop_cache, desktop->orig_path))
{ {
desktop->cached = 1; desktop->cached = 1;
ecore_hash_set(efreet_desktop_cache, ecore_hash_set(efreet_desktop_cache,
strdup(desktop->orig_path), desktop); strdup(desktop->orig_path), desktop);
} }
} }
@ -504,7 +504,7 @@ efreet_desktop_free(Efreet_Desktop *desktop)
Efreet_Desktop_Type_Info *info; Efreet_Desktop_Type_Info *info;
info = ecore_list_index_goto(efreet_desktop_types, desktop->type); info = ecore_list_index_goto(efreet_desktop_types, desktop->type);
if (info->free_func) if (info->free_func)
info->free_func(desktop->type_data); info->free_func(desktop->type_data);
} }
FREE(desktop); FREE(desktop);
@ -524,7 +524,7 @@ efreet_desktop_exec(Efreet_Desktop *desktop, Ecore_List *files, void *data)
} }
static void static void
efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop __UNUSED__, efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop __UNUSED__,
char *exec, int remaining __UNUSED__) char *exec, int remaining __UNUSED__)
{ {
ecore_exe_run(exec, data); ecore_exe_run(exec, data);
@ -581,14 +581,14 @@ efreet_desktop_category_add(Efreet_Desktop *desktop, const char *category)
if (!desktop->categories) if (!desktop->categories)
{ {
desktop->categories = ecore_list_new(); desktop->categories = ecore_list_new();
ecore_list_free_cb_set(desktop->categories, ecore_list_free_cb_set(desktop->categories,
ECORE_FREE_CB(ecore_string_release)); ECORE_FREE_CB(ecore_string_release));
} }
else else
if (ecore_list_find(desktop->categories, if (ecore_list_find(desktop->categories,
ECORE_COMPARE_CB(strcmp), category)) return; ECORE_COMPARE_CB(strcmp), category)) return;
ecore_list_append(desktop->categories, ecore_list_append(desktop->categories,
(void *)ecore_string_instance(category)); (void *)ecore_string_instance(category));
} }
@ -604,8 +604,8 @@ efreet_desktop_category_del(Efreet_Desktop *desktop, const char *category)
int found = 0; int found = 0;
if (!desktop || !desktop->categories) return 0; if (!desktop || !desktop->categories) return 0;
if (ecore_list_find(desktop->categories, if (ecore_list_find(desktop->categories,
ECORE_COMPARE_CB(strcmp), category)) ECORE_COMPARE_CB(strcmp), category))
{ {
found = 1; found = 1;
ecore_list_remove(desktop->categories); ecore_list_remove(desktop->categories);
@ -619,7 +619,7 @@ efreet_desktop_category_del(Efreet_Desktop *desktop, const char *category)
* @param parse_func: a function to parse out custom fields * @param parse_func: a function to parse out custom fields
* @param save_func: a function to save data returned from @a parse_func * @param save_func: a function to save data returned from @a parse_func
* @param free_func: a function to free data returned from @a parse_func * @param free_func: a function to free data returned from @a parse_func
* @return Returns the id of the new type * @return Returns the id of the new type
* @brief Adds the given type to the list of types in the system * @brief Adds the given type to the list of types in the system
*/ */
int int
@ -652,7 +652,7 @@ efreet_desktop_type_add(const char *type, Efreet_Desktop_Type_Parse_Cb parse_fun
* @param alias the alias * @param alias the alias
* @return the new type id, or -1 if @p from_type was not valid * @return the new type id, or -1 if @p from_type was not valid
* *
* This allows applications to add non-standard types that behave exactly as standard types. * This allows applications to add non-standard types that behave exactly as standard types.
*/ */
int int
efreet_desktop_type_alias (int from_type, const char *alias) efreet_desktop_type_alias (int from_type, const char *alias)
@ -792,7 +792,7 @@ efreet_desktop_string_list_join(Ecore_List *list)
/** /**
* @brief Tell Efreet to flush any cached desktop entries so it reloads on get. * @brief Tell Efreet to flush any cached desktop entries so it reloads on get.
* *
* This flags the cache to be invalid, so next time a desktop file is fetched * This flags the cache to be invalid, so next time a desktop file is fetched
* it will force it to be re-read off disk next time efreet_desktop_get() is * it will force it to be re-read off disk next time efreet_desktop_get() is
* called. * called.
@ -850,13 +850,13 @@ efreet_desktop_application_fields_save(Efreet_Desktop *desktop, Efreet_Ini *ini)
{ {
char *val; char *val;
if (desktop->try_exec) if (desktop->try_exec)
efreet_ini_string_set(ini, "TryExec", desktop->try_exec); efreet_ini_string_set(ini, "TryExec", desktop->try_exec);
if (desktop->exec) if (desktop->exec)
efreet_ini_string_set(ini, "Exec", desktop->exec); efreet_ini_string_set(ini, "Exec", desktop->exec);
if (desktop->path) if (desktop->path)
efreet_ini_string_set(ini, "Path", desktop->path); efreet_ini_string_set(ini, "Path", desktop->path);
if (desktop->startup_wm_class) if (desktop->startup_wm_class)
@ -924,7 +924,7 @@ efreet_desktop_generic_fields_parse(Efreet_Desktop *desktop, Efreet_Ini *ini)
val = efreet_ini_localestring_get(ini, "Name"); val = efreet_ini_localestring_get(ini, "Name");
if (val) desktop->name = strdup(val); if (val) desktop->name = strdup(val);
else else
{ {
printf("efreet_desktop_generic_fields_parse error: no Name\n"); printf("efreet_desktop_generic_fields_parse error: no Name\n");
return 0; return 0;
@ -1005,9 +1005,9 @@ efreet_desktop_x_fields_parse(Ecore_Hash_Node *node, Efreet_Desktop *desktop)
if (!desktop->x) if (!desktop->x)
{ {
desktop->x = ecore_hash_new(ecore_str_hash, ecore_str_compare); desktop->x = ecore_hash_new(ecore_str_hash, ecore_str_compare);
ecore_hash_free_key_cb_set(desktop->x, ecore_hash_free_key_cb_set(desktop->x,
ECORE_FREE_CB(ecore_string_release)); ECORE_FREE_CB(ecore_string_release));
ecore_hash_free_value_cb_set(desktop->x, ecore_hash_free_value_cb_set(desktop->x,
ECORE_FREE_CB(ecore_string_release)); ECORE_FREE_CB(ecore_string_release));
} }
ecore_hash_set(desktop->x, (void *)ecore_string_instance(node->key), ecore_hash_set(desktop->x, (void *)ecore_string_instance(node->key),
@ -1019,7 +1019,7 @@ efreet_desktop_x_fields_parse(Ecore_Hash_Node *node, Efreet_Desktop *desktop)
* @internal * @internal
* @param ini: The Efreet_Ini to parse values from * @param ini: The Efreet_Ini to parse values from
* @return 1 if desktop should be included in current environement, 0 otherwise * @return 1 if desktop should be included in current environement, 0 otherwise
* @brief Determines if a desktop should be included in the current environment, * @brief Determines if a desktop should be included in the current environment,
* based on the values of the OnlyShowIn and NotShowIn fields * based on the values of the OnlyShowIn and NotShowIn fields
*/ */
static int static int
@ -1033,12 +1033,12 @@ efreet_desktop_environment_check(Efreet_Ini *ini)
{ {
int found = 0; int found = 0;
if (desktop_environment) if (desktop_environment)
{ {
ecore_list_first_goto(list); ecore_list_first_goto(list);
while ((val = ecore_list_next(list))) while ((val = ecore_list_next(list)))
{ {
if (!strcmp(val, desktop_environment)) if (!strcmp(val, desktop_environment))
{ {
found = 1; found = 1;
break; break;
@ -1050,7 +1050,7 @@ efreet_desktop_environment_check(Efreet_Ini *ini)
return found; return found;
} }
if (desktop_environment) if (desktop_environment)
{ {
int found = 0; int found = 0;
@ -1060,7 +1060,7 @@ efreet_desktop_environment_check(Efreet_Ini *ini)
ecore_list_first_goto(list); ecore_list_first_goto(list);
while ((val = ecore_list_next(list))) while ((val = ecore_list_next(list)))
{ {
if (!strcmp(val, desktop_environment)) if (!strcmp(val, desktop_environment))
{ {
found = 1; found = 1;
break; break;
@ -1086,7 +1086,7 @@ efreet_desktop_environment_check(Efreet_Ini *ini)
* @brief Get a command to use to execute a desktop entry. * @brief Get a command to use to execute a desktop entry.
*/ */
int int
efreet_desktop_command_get(Efreet_Desktop *desktop, Ecore_List *files, efreet_desktop_command_get(Efreet_Desktop *desktop, Ecore_List *files,
Efreet_Desktop_Command_Cb func, void *data) Efreet_Desktop_Command_Cb func, void *data)
{ {
return efreet_desktop_command_progress_get(desktop, files, func, NULL, data); return efreet_desktop_command_progress_get(desktop, files, func, NULL, data);
@ -1115,7 +1115,7 @@ efreet_desktop_command_local_get(Efreet_Desktop *desktop, Ecore_List *files)
command->files = ecore_list_new(); command->files = ecore_list_new();
command->desktop = desktop; command->desktop = desktop;
ecore_list_free_cb_set(command->files, ecore_list_free_cb_set(command->files,
ECORE_FREE_CB(efreet_desktop_command_file_free)); ECORE_FREE_CB(efreet_desktop_command_file_free));
command->flags = efreet_desktop_command_flags_get(desktop); command->flags = efreet_desktop_command_flags_get(desktop);
@ -1147,19 +1147,19 @@ efreet_desktop_command_local_get(Efreet_Desktop *desktop, Ecore_List *files)
/** /**
* @param desktop: the desktop entry * @param desktop: the desktop entry
* @param files: an ecore list of file names to execute, as either absolute paths, * @param files: an ecore list of file names to execute, as either absolute paths,
* relative paths, or uris * relative paths, or uris
* @param cb_command: a callback to call for each prepared command line * @param cb_command: a callback to call for each prepared command line
* @param cb_progress: a callback to get progress for the downloads * @param cb_progress: a callback to get progress for the downloads
* @param data: user data passed to the callback * @param data: user data passed to the callback
* @return Returns 1 on success or 0 on failure * @return Returns 1 on success or 0 on failure
* @brief Get a command to use to execute a desktop entry, and receive progress * @brief Get a command to use to execute a desktop entry, and receive progress
* updates for downloading of remote URI's passed in. * updates for downloading of remote URI's passed in.
*/ */
int int
efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Ecore_List *files, efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Ecore_List *files,
Efreet_Desktop_Command_Cb cb_command, Efreet_Desktop_Command_Cb cb_command,
Efreet_Desktop_Progress_Cb cb_progress, Efreet_Desktop_Progress_Cb cb_progress,
void *data) void *data)
{ {
Efreet_Desktop_Command *command; Efreet_Desktop_Command *command;
@ -1176,7 +1176,7 @@ efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Ecore_List *files,
command->files = ecore_list_new(); command->files = ecore_list_new();
command->desktop = desktop; command->desktop = desktop;
ecore_list_free_cb_set(command->files, ecore_list_free_cb_set(command->files,
ECORE_FREE_CB(efreet_desktop_command_file_free)); ECORE_FREE_CB(efreet_desktop_command_file_free));
command->flags = efreet_desktop_command_flags_get(desktop); command->flags = efreet_desktop_command_flags_get(desktop);
@ -1259,7 +1259,7 @@ efreet_desktop_command_flags_get(Efreet_Desktop *desktop)
* @internal * @internal
* *
* @brief Call the command callback for each exec in the list * @brief Call the command callback for each exec in the list
* @param command * @param command
* @param execs * @param execs
*/ */
static void static void
@ -1277,8 +1277,8 @@ efreet_desktop_command_execs_process(Efreet_Desktop_Command *command, Ecore_List
/** /**
* @brief Builds the actual exec string from the raw string and a list of * @brief Builds the actual exec string from the raw string and a list of
* processed filename information. The callback passed in to * processed filename information. The callback passed in to
* efreet_desktop_command_get is called for each exec string created. * efreet_desktop_command_get is called for each exec string created.
* *
* @param command: the command to build * @param command: the command to build
@ -1296,9 +1296,9 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
ecore_list_first_goto(command->files); ecore_list_first_goto(command->files);
/* if the Exec field appends multiple, that will run the list to the end, /* if the Exec field appends multiple, that will run the list to the end,
* causing this loop to only run once. otherwise, this loop will generate a * causing this loop to only run once. otherwise, this loop will generate a
* command for each file in the list. if the list is empty, this * command for each file in the list. if the list is empty, this
* will run once, removing any file field codes */ * will run once, removing any file field codes */
while ((file = ecore_list_next(command->files)) || first) while ((file = ecore_list_next(command->files)) || first)
{ {
@ -1315,7 +1315,7 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
while (*p) while (*p)
{ {
if (len >= size - 1) if (len >= size - 1)
{ {
size = len + 1024; size = len + 1024;
exec = realloc(exec, size); exec = realloc(exec, size);
@ -1328,42 +1328,42 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
switch (*p) switch (*p)
{ {
case 'f': case 'f':
case 'u': case 'u':
case 'd': case 'd':
case 'n': case 'n':
if (file) if (file)
{ {
exec = efreet_desktop_command_append_single(exec, &size, exec = efreet_desktop_command_append_single(exec, &size,
&len, file, *p); &len, file, *p);
file_added = 1; file_added = 1;
} }
break; break;
case 'F': case 'F':
case 'U': case 'U':
case 'D': case 'D':
case 'N': case 'N':
if (file) if (file)
{ {
exec = efreet_desktop_command_append_multiple(exec, &size, exec = efreet_desktop_command_append_multiple(exec, &size,
&len, command, *p); &len, command, *p);
file_added = 1; file_added = 1;
} }
break; break;
case 'i': case 'i':
exec = efreet_desktop_command_append_icon(exec, &size, &len, exec = efreet_desktop_command_append_icon(exec, &size, &len,
command->desktop); command->desktop);
break; break;
case 'c': case 'c':
exec = efreet_desktop_command_append_quoted(exec, &size, &len, exec = efreet_desktop_command_append_quoted(exec, &size, &len,
command->desktop->name); command->desktop->name);
break; break;
case 'k': case 'k':
exec = efreet_desktop_command_append_quoted(exec, &size, &len, exec = efreet_desktop_command_append_quoted(exec, &size, &len,
command->desktop->orig_path); command->desktop->orig_path);
break; break;
case 'v': case 'v':
case 'm': case 'm':
printf("[Efreet]: Deprecated conversion char: '%c' in file '%s'\n", printf("[Efreet]: Deprecated conversion char: '%c' in file '%s'\n",
*p, command->desktop->orig_path); *p, command->desktop->orig_path);
break; break;
case '%': case '%':
@ -1384,7 +1384,7 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
ecore_list_append(execs, exec); ecore_list_append(execs, exec);
/* If no file was added, then the Exec field doesn't contain any file /* If no file was added, then the Exec field doesn't contain any file
* fields (fFuUdDnN). We only want to run the app once in this case. */ * fields (fFuUdDnN). We only want to run the app once in this case. */
if (!file_added) break; if (!file_added) break;
} }
@ -1397,7 +1397,7 @@ efreet_desktop_command_free(Efreet_Desktop_Command *command)
{ {
if (!command) return; if (!command) return;
IF_FREE_LIST(command->files); IF_FREE_LIST(command->files);
FREE(command); FREE(command);
} }
@ -1430,8 +1430,8 @@ efreet_desktop_command_append_quoted(char *dest, int *size, int *len, char *src)
} }
static char * static char *
efreet_desktop_command_append_multiple(char *dest, int *size, int *len, efreet_desktop_command_append_multiple(char *dest, int *size, int *len,
Efreet_Desktop_Command *command, Efreet_Desktop_Command *command,
char type) char type)
{ {
Efreet_Desktop_Command_File *file; Efreet_Desktop_Command_File *file;
@ -1447,7 +1447,7 @@ efreet_desktop_command_append_multiple(char *dest, int *size, int *len,
else else
dest = efreet_string_append_char(dest, size, len, ' '); dest = efreet_string_append_char(dest, size, len, ' ');
dest = efreet_desktop_command_append_single(dest, size, len, dest = efreet_desktop_command_append_single(dest, size, len,
file, tolower(type)); file, tolower(type));
} }
@ -1455,8 +1455,8 @@ efreet_desktop_command_append_multiple(char *dest, int *size, int *len,
} }
static char * static char *
efreet_desktop_command_append_single(char *dest, int *size, int *len, efreet_desktop_command_append_single(char *dest, int *size, int *len,
Efreet_Desktop_Command_File *file, Efreet_Desktop_Command_File *file,
char type) char type)
{ {
char *str; char *str;
@ -1488,7 +1488,7 @@ efreet_desktop_command_append_single(char *dest, int *size, int *len,
} }
static char * static char *
efreet_desktop_command_append_icon(char *dest, int *size, int *len, efreet_desktop_command_append_icon(char *dest, int *size, int *len,
Efreet_Desktop *desktop) Efreet_Desktop *desktop)
{ {
if (!desktop->icon || !desktop->icon[0]) return dest; if (!desktop->icon || !desktop->icon[0]) return dest;
@ -1511,7 +1511,7 @@ efreet_string_append(char *dest, int *size, int *len, const char *src)
l = ecore_strlcpy(dest + *len, src, *size - *len); l = ecore_strlcpy(dest + *len, src, *size - *len);
while (l > *size - *len) while (l > *size - *len)
{ {
/* we successfully appended this much */ /* we successfully appended this much */
off += *size - *len - 1; off += *size - *len - 1;
@ -1553,7 +1553,7 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
const char *uri, *base; const char *uri, *base;
int nonlocal = 0; int nonlocal = 0;
/* /*
printf("FLAGS: %d, %d, %d, %d\n", printf("FLAGS: %d, %d, %d, %d\n",
command->flags & EFREET_DESKTOP_EXEC_FLAG_FULLPATH ? 1 : 0, command->flags & EFREET_DESKTOP_EXEC_FLAG_FULLPATH ? 1 : 0,
command->flags & EFREET_DESKTOP_EXEC_FLAG_URI ? 1 : 0, command->flags & EFREET_DESKTOP_EXEC_FLAG_URI ? 1 : 0,
command->flags & EFREET_DESKTOP_EXEC_FLAG_DIR ? 1 : 0, command->flags & EFREET_DESKTOP_EXEC_FLAG_DIR ? 1 : 0,
@ -1589,20 +1589,20 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
{ {
char buf[PATH_MAX]; char buf[PATH_MAX];
snprintf(buf, PATH_MAX, "/tmp/%d-%d-%s", getpid(), snprintf(buf, PATH_MAX, "/tmp/%d-%d-%s", getpid(),
efreet_desktop_command_file_id++, base); efreet_desktop_command_file_id++, base);
f->fullpath = strdup(buf); f->fullpath = strdup(buf);
f->pending = 1; f->pending = 1;
ecore_file_download(uri, f->fullpath, efreet_desktop_cb_download_complete, ecore_file_download(uri, f->fullpath, efreet_desktop_cb_download_complete,
efreet_desktop_cb_download_progress, f); efreet_desktop_cb_download_progress, f);
} }
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_URI) if (command->flags & EFREET_DESKTOP_EXEC_FLAG_URI)
f->uri = strdup(uri); f->uri = strdup(uri);
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_DIR) if (command->flags & EFREET_DESKTOP_EXEC_FLAG_DIR)
f->dir = strdup("/tmp"); f->dir = strdup("/tmp");
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FILE) if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FILE)
f->file = strdup(base); f->file = strdup(base);
} }
else else
@ -1618,9 +1618,9 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
snprintf(buf, sizeof(buf), "file://%s", abs); snprintf(buf, sizeof(buf), "file://%s", abs);
f->uri = strdup(buf); f->uri = strdup(buf);
} }
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_DIR) if (command->flags & EFREET_DESKTOP_EXEC_FLAG_DIR)
f->dir = ecore_file_dir_get(abs); f->dir = ecore_file_dir_get(abs);
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FILE) if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FILE)
f->file = strdup(ecore_file_file_get(file)); f->file = strdup(ecore_file_file_get(file));
free(abs); free(abs);
@ -1637,7 +1637,7 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
/** /**
* @brief Find the local path portion of a file uri. * @brief Find the local path portion of a file uri.
* @param uri: a uri beginning with "file:" * @param uri: a uri beginning with "file:"
* @return the location of the path portion of the uri, * @return the location of the path portion of the uri,
* or NULL if the file is not on this machine * or NULL if the file is not on this machine
*/ */
static const char * static const char *
@ -1647,7 +1647,7 @@ efreet_desktop_command_file_uri_process(const char *uri)
int len = strlen(uri); int len = strlen(uri);
/* uri:foo/bar => relative path foo/bar*/ /* uri:foo/bar => relative path foo/bar*/
if (len >= 4 && uri[5] != '/') if (len >= 4 && uri[5] != '/')
path = uri + strlen("file:"); path = uri + strlen("file:");
/* uri:/foo/bar => absolute path /foo/bar */ /* uri:/foo/bar => absolute path /foo/bar */
@ -1664,14 +1664,14 @@ efreet_desktop_command_file_uri_process(const char *uri)
if (p) if (p)
{ {
*p = '\0'; *p = '\0';
if (!strcmp(tmp, "localhost")) if (!strcmp(tmp, "localhost"))
path = uri + strlen("file://localhost"); path = uri + strlen("file://localhost");
else else
{ {
int ret; int ret;
ret = gethostname(hostname, PATH_MAX); ret = gethostname(hostname, PATH_MAX);
if ((ret == 0) && !strcmp(tmp, hostname)) if ((ret == 0) && !strcmp(tmp, hostname))
path = uri + strlen("file://") + strlen(hostname); path = uri + strlen("file://") + strlen(hostname);
} }
} }
@ -1700,7 +1700,7 @@ efreet_desktop_command_file_free(Efreet_Desktop_Command_File *file)
static void static void
efreet_desktop_cb_download_complete(void *data, const char *file __UNUSED__, efreet_desktop_cb_download_complete(void *data, const char *file __UNUSED__,
int status __UNUSED__) int status __UNUSED__)
{ {
Efreet_Desktop_Command_File *f; Efreet_Desktop_Command_File *f;
@ -1731,8 +1731,8 @@ efreet_desktop_cb_download_progress(void *data,
dcf = data; dcf = data;
if (dcf->command->cb_progress) if (dcf->command->cb_progress)
return dcf->command->cb_progress(dcf->command->data, return dcf->command->cb_progress(dcf->command->data,
dcf->command->desktop, dcf->command->desktop,
dcf->uri, dltotal, dlnow); dcf->uri, dltotal, dlnow);
return 0; return 0;

View File

@ -6,10 +6,10 @@
/** /**
* @file efreet_desktop.h * @file efreet_desktop.h
* @brief Contains the structures and methods used to support the * @brief Contains the structures and methods used to support the
* FDO desktop entry specificiation. * FDO desktop entry specificiation.
* @addtogroup Efreet_Desktop Efreet_Desktop: The FDO Desktop Entry * @addtogroup Efreet_Desktop Efreet_Desktop: The FDO Desktop Entry
* Specification functions and structures * Specification functions and structures
* *
* @{ * @{
*/ */
@ -31,13 +31,13 @@ typedef struct Efreet_Desktop Efreet_Desktop;
/** /**
* A callback used with efreet_desktop_command_get() * A callback used with efreet_desktop_command_get()
*/ */
typedef void (*Efreet_Desktop_Command_Cb) (void *data, Efreet_Desktop *desktop, typedef void (*Efreet_Desktop_Command_Cb) (void *data, Efreet_Desktop *desktop,
char *command, int remaining); char *command, int remaining);
/** /**
* A callback used to get download progress of remote uris * A callback used to get download progress of remote uris
*/ */
typedef int (*Efreet_Desktop_Progress_Cb) (void *data, Efreet_Desktop *desktop, typedef int (*Efreet_Desktop_Progress_Cb) (void *data, Efreet_Desktop *desktop,
char *uri, long int total, long int current); char *uri, long int total, long int current);
/** /**
@ -62,14 +62,14 @@ typedef void *(*Efreet_Desktop_Type_Free_Cb) (void *data);
struct Efreet_Desktop struct Efreet_Desktop
{ {
int type; /**< type of desktop file */ int type; /**< type of desktop file */
int ref; /**< reference count - internal */ int ref; /**< reference count - internal */
int cache_flush; /**< cache flush value - internal */ int cache_flush; /**< cache flush value - internal */
double version; /**< version of spec file conforms to */ double version; /**< version of spec file conforms to */
char *orig_path; /**< original path to .desktop file */ char *orig_path; /**< original path to .desktop file */
long long load_time; /**< modified time of .desktop on disk */ long long load_time; /**< modified time of .desktop on disk */
char *name; /**< Specific name of the application */ char *name; /**< Specific name of the application */
char *generic_name; /**< Generic name of the application */ char *generic_name; /**< Generic name of the application */
@ -82,9 +82,9 @@ struct Efreet_Desktop
the given string as it's WM class or WM name */ the given string as it's WM class or WM name */
char *url; /**< URL to access if type is EFREET_TYPE_LINK */ char *url; /**< URL to access if type is EFREET_TYPE_LINK */
Ecore_List *only_show_in; /**< list of environments that should Ecore_List *only_show_in; /**< list of environments that should
display the icon */ display the icon */
Ecore_List *not_show_in; /**< list of environments that shoudn't Ecore_List *not_show_in; /**< list of environments that shoudn't
display the icon */ display the icon */
Ecore_List *categories; /**< Categories in which item should be shown */ Ecore_List *categories; /**< Categories in which item should be shown */
Ecore_List *mime_types; /**< The mime types supppored by this app */ Ecore_List *mime_types; /**< The mime types supppored by this app */
@ -106,10 +106,10 @@ Efreet_Desktop *efreet_desktop_new(const char *file);
void efreet_desktop_free(Efreet_Desktop *desktop); void efreet_desktop_free(Efreet_Desktop *desktop);
int efreet_desktop_save(Efreet_Desktop *desktop); int efreet_desktop_save(Efreet_Desktop *desktop);
int efreet_desktop_save_as(Efreet_Desktop *desktop, int efreet_desktop_save_as(Efreet_Desktop *desktop,
const char *file); const char *file);
void efreet_desktop_exec(Efreet_Desktop *desktop, void efreet_desktop_exec(Efreet_Desktop *desktop,
Ecore_List *files, void *data); Ecore_List *files, void *data);
void efreet_desktop_environment_set(const char *environment); void efreet_desktop_environment_set(const char *environment);
@ -131,9 +131,9 @@ void efreet_desktop_category_add(Efreet_Desktop *desktop,
int efreet_desktop_category_del(Efreet_Desktop *desktop, int efreet_desktop_category_del(Efreet_Desktop *desktop,
const char *category); const char *category);
int efreet_desktop_type_add(const char *type, int efreet_desktop_type_add(const char *type,
Efreet_Desktop_Type_Parse_Cb parse_func, Efreet_Desktop_Type_Parse_Cb parse_func,
Efreet_Desktop_Type_Save_Cb save_func, Efreet_Desktop_Type_Save_Cb save_func,
Efreet_Desktop_Type_Free_Cb free_func); Efreet_Desktop_Type_Free_Cb free_func);
int efreet_desktop_type_alias (int from_type, int efreet_desktop_type_alias (int from_type,
const char *alias); const char *alias);
@ -142,10 +142,9 @@ void *efreet_desktop_type_data_get(Efreet_Desktop *desktop);
Ecore_List *efreet_desktop_string_list_parse(const char *string); Ecore_List *efreet_desktop_string_list_parse(const char *string);
char *efreet_desktop_string_list_join(Ecore_List *list); char *efreet_desktop_string_list_join(Ecore_List *list);
void efreet_desktop_cache_flush(void); void efreet_desktop_cache_flush(void);
/** /**
* @} * @}
*/ */
#endif #endif

View File

@ -338,7 +338,7 @@ efreet_icon_path_find(const char *theme_name, const char *icon, const char *size
char key[4096]; char key[4096];
Efreet_Icon_Cache *cache; Efreet_Icon_Cache *cache;
Efreet_Icon_Theme *theme; Efreet_Icon_Theme *theme;
snprintf(key, sizeof(key), "%s %s %s", theme_name, icon, size); snprintf(key, sizeof(key), "%s %s %s", theme_name, icon, size);
cache = ecore_list_find(efreet_icon_cache, ECORE_COMPARE_CB(efreet_icon_cache_find), key); cache = ecore_list_find(efreet_icon_cache, ECORE_COMPARE_CB(efreet_icon_cache_find), key);
if (cache) if (cache)

View File

@ -6,8 +6,8 @@
* @file efreet_icon.h * @file efreet_icon.h
* @brief Contains the structures and methods used to support the FDO icon * @brief Contains the structures and methods used to support the FDO icon
* theme specificiation. * theme specificiation.
* @addtogroup Efreet_Icon Efreet_Icon: The FDO Icon Theme * @addtogroup Efreet_Icon Efreet_Icon: The FDO Icon Theme
* Specification functions and structures * Specification functions and structures
* *
* @{ * @{
*/ */
@ -30,9 +30,9 @@ enum Efreet_Icon_Theme_Context
typedef enum Efreet_Icon_Theme_Context Efreet_Icon_Theme_Context; typedef enum Efreet_Icon_Theme_Context Efreet_Icon_Theme_Context;
/** /**
* The possible size types for an icon directory * The possible size types for an icon directory
*/ */
enum Efreet_Icon_Size_Type enum Efreet_Icon_Size_Type
{ {
EFREET_ICON_SIZE_TYPE_NONE, EFREET_ICON_SIZE_TYPE_NONE,
EFREET_ICON_SIZE_TYPE_FIXED, EFREET_ICON_SIZE_TYPE_FIXED,
@ -51,8 +51,8 @@ typedef enum Efreet_Icon_Size_Type Efreet_Icon_Size_Type;
typedef struct Efreet_Icon_Theme Efreet_Icon_Theme; typedef struct Efreet_Icon_Theme Efreet_Icon_Theme;
/** /**
* Efreet_Icon_Theme * Efreet_Icon_Theme
* @brief contains all of the known information about a given theme * @brief contains all of the known information about a given theme
*/ */
struct Efreet_Icon_Theme struct Efreet_Icon_Theme
{ {
@ -82,8 +82,8 @@ struct Efreet_Icon_Theme
unsigned char hidden:1; /**< Should this theme be hidden from users */ unsigned char hidden:1; /**< Should this theme be hidden from users */
unsigned char valid:1; /**< Have we seen an index for this theme */ unsigned char valid:1; /**< Have we seen an index for this theme */
unsigned char fake:1; /**< This isnt' a real theme but the user has unsigned char fake:1; /**< This isnt' a real theme but the user has
tried to query from it. We create the tried to query from it. We create the
fake one to give us the theme cache. */ fake one to give us the theme cache. */
}; };
@ -93,7 +93,7 @@ struct Efreet_Icon_Theme
typedef struct Efreet_Icon_Theme_Directory Efreet_Icon_Theme_Directory; typedef struct Efreet_Icon_Theme_Directory Efreet_Icon_Theme_Directory;
/** /**
* Efreet_Icon_Theme_Directory * Efreet_Icon_Theme_Directory
* @brief Contains all the information about a sub-directory of a theme * @brief Contains all the information about a sub-directory of a theme
*/ */
struct Efreet_Icon_Theme_Directory struct Efreet_Icon_Theme_Directory
@ -112,18 +112,18 @@ struct Efreet_Icon_Theme_Directory
}; };
/** /**
* Efreet_Icon * Efreet_Icon
*/ */
typedef struct Efreet_Icon Efreet_Icon; typedef struct Efreet_Icon Efreet_Icon;
/** /**
* Efreet_Icon * Efreet_Icon
* @brief Contains all the information about a given icon * @brief Contains all the information about a given icon
*/ */
struct Efreet_Icon struct Efreet_Icon
{ {
char *path; /**< Full path to the icon */ char *path; /**< Full path to the icon */
char *name; /**< Translated UTF8 string that can char *name; /**< Translated UTF8 string that can
be used for the icon name */ be used for the icon name */
struct struct
@ -132,10 +132,10 @@ struct Efreet_Icon
y0, /**< y0 position */ y0, /**< y0 position */
x1, /**< x1 position */ x1, /**< x1 position */
y1; /**< y1 position */ y1; /**< y1 position */
} embedded_text_rectangle; /**< Rectangle where text can } embedded_text_rectangle; /**< Rectangle where text can
be displayed on the icon */ be displayed on the icon */
Ecore_List *attach_points; /**< List of points to be used as anchor Ecore_List *attach_points; /**< List of points to be used as anchor
points for emblems/overlays */ points for emblems/overlays */
unsigned int ref_count; /**< References to this icon */ unsigned int ref_count; /**< References to this icon */
@ -149,7 +149,7 @@ struct Efreet_Icon
typedef struct Efreet_Icon_Point Efreet_Icon_Point; typedef struct Efreet_Icon_Point Efreet_Icon_Point;
/** /**
* Efreet_Point * Efreet_Point
* @brief Stores an x, y point. * @brief Stores an x, y point.
*/ */
struct Efreet_Icon_Point struct Efreet_Icon_Point
@ -164,18 +164,17 @@ void efreet_icon_extension_add(const char *ext);
Ecore_List *efreet_icon_extra_list_get(void); Ecore_List *efreet_icon_extra_list_get(void);
Ecore_List *efreet_icon_theme_list_get(void); Ecore_List *efreet_icon_theme_list_get(void);
Efreet_Icon_Theme *efreet_icon_theme_find(const char *theme_name); Efreet_Icon_Theme *efreet_icon_theme_find(const char *theme_name);
Efreet_Icon *efreet_icon_find(const char *theme_name, const char *icon, Efreet_Icon *efreet_icon_find(const char *theme_name, const char *icon,
const char *size); const char *size);
char *efreet_icon_list_find(const char *theme_name, char *efreet_icon_list_find(const char *theme_name,
Ecore_List *icons, Ecore_List *icons,
const char *size); const char *size);
char *efreet_icon_path_find(const char *theme, const char *icon, char *efreet_icon_path_find(const char *theme, const char *icon,
const char *size); const char *size);
void efreet_icon_free(Efreet_Icon *icon); void efreet_icon_free(Efreet_Icon *icon);
/** /**
* @} * @}
*/ */
#endif #endif

View File

@ -45,8 +45,8 @@ efreet_ini_shutdown(void)
* @return Returns a new Efreet_Ini structure initialized with the contents * @return Returns a new Efreet_Ini structure initialized with the contents
* of @a file, or NULL on memory allocation failure * of @a file, or NULL on memory allocation failure
* @brief Creates and initializes a new Ini structure with the contents of * @brief Creates and initializes a new Ini structure with the contents of
* @a file, or NULL on failure * @a file, or NULL on failure
*/ */
Efreet_Ini * Efreet_Ini *
efreet_ini_new(const char *file) efreet_ini_new(const char *file)
{ {
@ -91,7 +91,7 @@ efreet_ini_parse(const char *file)
/* the current buffer to parse */ /* the current buffer to parse */
char *buf; char *buf;
Ecore_Hash *data, *section = NULL; Ecore_Hash *data, *section = NULL;
/* start with the static buffer */ /* start with the static buffer */
@ -109,7 +109,7 @@ efreet_ini_parse(const char *file)
/* if a line is longer than the buffer size, this \n will get overwritten. */ /* if a line is longer than the buffer size, this \n will get overwritten. */
read_buf[read_len - 2] = '\n'; read_buf[read_len - 2] = '\n';
while (fgets(read_buf, read_len, f) != NULL) while (fgets(read_buf, read_len, f) != NULL)
{ {
char *key, *value, *p; char *key, *value, *p;
char *sep; char *sep;
@ -120,7 +120,7 @@ efreet_ini_parse(const char *file)
int len; int len;
len = strlen(buf); len = strlen(buf);
if (!big_buf) if (!big_buf)
{ {
/* create new big buffer and copy in contents of static buf */ /* create new big buffer and copy in contents of static buf */
big_buf_len = 2 * big_buf_step; big_buf_len = 2 * big_buf_step;
@ -169,7 +169,7 @@ efreet_ini_parse(const char *file)
old = ecore_hash_remove(data, header); old = ecore_hash_remove(data, header);
//if (old) printf("[efreet] Warning: duplicate section '%s' in file '%s'\n", header, file); //if (old) printf("[efreet] Warning: duplicate section '%s' in file '%s'\n", header, file);
IF_FREE_HASH(old); IF_FREE_HASH(old);
ecore_hash_set(data, (void *)ecore_string_instance(header), ecore_hash_set(data, (void *)ecore_string_instance(header),
section); section);
} }
else else
@ -202,7 +202,7 @@ efreet_ini_parse(const char *file)
while (p > value && (*p == '\n' || *p == '\r')) p--; while (p > value && (*p == '\n' || *p == '\r')) p--;
*(p + 1) = '\0'; *(p + 1) = '\0';
if (key && value && *key && *value) if (key && value && *key && *value)
{ {
char *old; char *old;
@ -210,7 +210,7 @@ efreet_ini_parse(const char *file)
//if (old) printf("[efreet] Warning: duplicate key '%s' in file '%s'\n", key, file); //if (old) printf("[efreet] Warning: duplicate key '%s' in file '%s'\n", key, file);
IF_FREE(old); IF_FREE(old);
ecore_hash_set(section, (void *)ecore_string_instance(key), ecore_hash_set(section, (void *)ecore_string_instance(key),
efreet_ini_unescape(value)); efreet_ini_unescape(value));
} }
} }
@ -484,7 +484,7 @@ efreet_ini_boolean_set(Efreet_Ini *ini, const char *key, unsigned int value)
* @internal * @internal
* @param ini: The ini struct to work with * @param ini: The ini struct to work with
* @param key: The key to search for * @param key: The key to search for
* @return Returns the utf8 encoded string associated with @a key, or NULL * @return Returns the utf8 encoded string associated with @a key, or NULL
* if none found * if none found
* @brief Retrieves the utf8 encoded string associated with @a key in the current locale or NULL if none found * @brief Retrieves the utf8 encoded string associated with @a key in the current locale or NULL if none found
*/ */

View File

@ -6,7 +6,7 @@
* @internal * @internal
* @file efreet_ini.h * @file efreet_ini.h
* @brief A simple and fast INI parser * @brief A simple and fast INI parser
* @addtogroup Efreet_Ini Efreet_Ini: An INI parser * @addtogroup Efreet_Ini Efreet_Ini: An INI parser
* *
* @{ * @{
*/ */
@ -17,7 +17,7 @@
typedef struct Efreet_Ini Efreet_Ini; typedef struct Efreet_Ini Efreet_Ini;
/** /**
* Efreet_Ini * Efreet_Ini
* @brief Contains all the information about an ini file. * @brief Contains all the information about an ini file.
*/ */
struct Efreet_Ini struct Efreet_Ini
@ -34,22 +34,22 @@ int efreet_ini_section_set(Efreet_Ini *ini, const char *section);
void efreet_ini_section_add(Efreet_Ini *ini, const char *section); void efreet_ini_section_add(Efreet_Ini *ini, const char *section);
const char *efreet_ini_string_get(Efreet_Ini *ini, const char *key); const char *efreet_ini_string_get(Efreet_Ini *ini, const char *key);
void efreet_ini_string_set(Efreet_Ini *ini, const char *key, void efreet_ini_string_set(Efreet_Ini *ini, const char *key,
const char *value); const char *value);
const char *efreet_ini_localestring_get(Efreet_Ini *ini, const char *key); const char *efreet_ini_localestring_get(Efreet_Ini *ini, const char *key);
void efreet_ini_localestring_set(Efreet_Ini *ini, const char *key, void efreet_ini_localestring_set(Efreet_Ini *ini, const char *key,
const char *value); const char *value);
unsigned int efreet_ini_boolean_get(Efreet_Ini *ini, const char *key); unsigned int efreet_ini_boolean_get(Efreet_Ini *ini, const char *key);
void efreet_ini_boolean_set(Efreet_Ini *ini, const char *key, void efreet_ini_boolean_set(Efreet_Ini *ini, const char *key,
unsigned int value); unsigned int value);
int efreet_ini_int_get(Efreet_Ini *ini, const char *key); int efreet_ini_int_get(Efreet_Ini *ini, const char *key);
void efreet_ini_int_set(Efreet_Ini *ini, const char *key, int value); void efreet_ini_int_set(Efreet_Ini *ini, const char *key, int value);
double efreet_ini_double_get(Efreet_Ini *ini, const char *key); double efreet_ini_double_get(Efreet_Ini *ini, const char *key);
void efreet_ini_double_set(Efreet_Ini *ini, const char *key, void efreet_ini_double_set(Efreet_Ini *ini, const char *key,
double value); double value);
/** /**
@ -57,4 +57,3 @@ void efreet_ini_double_set(Efreet_Ini *ini, const char *key,
*/ */
#endif #endif

View File

@ -119,7 +119,7 @@ enum Efreet_Menu_Filter_Type
typedef enum Efreet_Menu_Filter_Type Efreet_Menu_Filter_Type; typedef enum Efreet_Menu_Filter_Type Efreet_Menu_Filter_Type;
/** /**
* Efreet_Menu_Filter_Op * Efreet_Menu_Filter_Op
*/ */
typedef struct Efreet_Menu_Filter_Op Efreet_Menu_Filter_Op; typedef struct Efreet_Menu_Filter_Op Efreet_Menu_Filter_Op;
@ -145,7 +145,7 @@ typedef struct Efreet_Menu_Filter Efreet_Menu_Filter;
/** /**
* Efreet_Menu_Filter * Efreet_Menu_Filter
* Stores information on a filter * Stores information on a filter
*/ */
struct Efreet_Menu_Filter struct Efreet_Menu_Filter
{ {
@ -176,7 +176,7 @@ typedef struct Efreet_Menu_Layout Efreet_Menu_Layout;
/** /**
* Efreet_Menu_Layout * Efreet_Menu_Layout
* Stores information on a layout * Stores information on a layout
*/ */
struct Efreet_Menu_Layout struct Efreet_Menu_Layout
{ {
@ -222,7 +222,7 @@ static Ecore_Hash *efreet_menu_layout_cbs = NULL;
static const char *efreet_menu_prefix_get(void); static const char *efreet_menu_prefix_get(void);
static Efreet_Menu_Internal *efreet_menu_by_name_find(Efreet_Menu_Internal *internal, static Efreet_Menu_Internal *efreet_menu_by_name_find(Efreet_Menu_Internal *internal,
const char *name, const char *name,
Efreet_Menu_Internal **parent); Efreet_Menu_Internal **parent);
static int efreet_menu_cb_compare_names(Efreet_Menu_Internal *internal, const char *name); static int efreet_menu_cb_compare_names(Efreet_Menu_Internal *internal, const char *name);
static int efreet_menu_cb_md_compare_ids(Efreet_Menu_Desktop *md, const char *name); static int efreet_menu_cb_md_compare_ids(Efreet_Menu_Desktop *md, const char *name);
@ -235,17 +235,17 @@ static int efreet_menu_cb_move_compare(Efreet_Menu_Move *move, const char *old);
static int efreet_menu_process(Efreet_Menu_Internal *internal, unsigned int only_unallocated); static int efreet_menu_process(Efreet_Menu_Internal *internal, unsigned int only_unallocated);
static int efreet_menu_process_dirs(Efreet_Menu_Internal *internal); static int efreet_menu_process_dirs(Efreet_Menu_Internal *internal);
static int efreet_menu_app_dirs_process(Efreet_Menu_Internal *internal); static int efreet_menu_app_dirs_process(Efreet_Menu_Internal *internal);
static int efreet_menu_app_dir_scan(Efreet_Menu_Internal *internal, static int efreet_menu_app_dir_scan(Efreet_Menu_Internal *internal,
const char *path, const char *path,
const char *id, const char *id,
int legacy); int legacy);
static int efreet_menu_directory_dirs_process(Efreet_Menu_Internal *internal); static int efreet_menu_directory_dirs_process(Efreet_Menu_Internal *internal);
static int efreet_menu_directory_dir_scan(const char *path, static int efreet_menu_directory_dir_scan(const char *path,
const char *relative_path, const char *relative_path,
Ecore_Hash *cache); Ecore_Hash *cache);
static Efreet_Desktop *efreet_menu_directory_get(Efreet_Menu_Internal *internal, static Efreet_Desktop *efreet_menu_directory_get(Efreet_Menu_Internal *internal,
const char *path); const char *path);
static void efreet_menu_process_filters(Efreet_Menu_Internal *internal, static void efreet_menu_process_filters(Efreet_Menu_Internal *internal,
unsigned int only_unallocated); unsigned int only_unallocated);
static void efreet_menu_process_app_pool(Ecore_List *pool, Ecore_List *applications, static void efreet_menu_process_app_pool(Ecore_List *pool, Ecore_List *applications,
Ecore_Hash *matches, Ecore_Hash *matches,
@ -322,9 +322,9 @@ static int efreet_menu_handle_merge_file(Efreet_Menu_Internal *parent, Efreet_Xm
static int efreet_menu_handle_merge_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml); static int efreet_menu_handle_merge_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
static int efreet_menu_handle_default_merge_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml); static int efreet_menu_handle_default_merge_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
static int efreet_menu_handle_legacy_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml); static int efreet_menu_handle_legacy_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
static Efreet_Menu_Internal *efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root, static Efreet_Menu_Internal *efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
Efreet_Menu_Internal *parent, Efreet_Menu_Internal *parent,
const char *legacy_dir, const char *legacy_dir,
const char *prefix); const char *prefix);
static int efreet_menu_handle_kde_legacy_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml); static int efreet_menu_handle_kde_legacy_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
static int efreet_menu_handle_move(Efreet_Menu_Internal *parent, Efreet_Xml *xml); static int efreet_menu_handle_move(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
@ -333,10 +333,10 @@ static int efreet_menu_handle_new(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
static int efreet_menu_handle_layout(Efreet_Menu_Internal *parent, Efreet_Xml *xml); static int efreet_menu_handle_layout(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
static int efreet_menu_handle_default_layout(Efreet_Menu_Internal *parent, Efreet_Xml *xml); static int efreet_menu_handle_default_layout(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
static int efreet_menu_handle_filter(Efreet_Menu_Internal *parent, Efreet_Xml *xml, static int efreet_menu_handle_filter(Efreet_Menu_Internal *parent, Efreet_Xml *xml,
Efreet_Menu_Filter_Type type); Efreet_Menu_Filter_Type type);
static int efreet_menu_handle_filter_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml); static int efreet_menu_handle_filter_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml);
static int efreet_menu_handle_filter_child_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml, static int efreet_menu_handle_filter_child_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml,
Efreet_Menu_Filter_Op_Type type); Efreet_Menu_Filter_Op_Type type);
static int efreet_menu_handle_layout_menuname(Efreet_Menu_Internal *parent, Efreet_Xml *xml, int def); static int efreet_menu_handle_layout_menuname(Efreet_Menu_Internal *parent, Efreet_Xml *xml, int def);
@ -441,17 +441,17 @@ efreet_menu_init(void)
efreet_menu_filter_cbs = ecore_hash_new(NULL, NULL); efreet_menu_filter_cbs = ecore_hash_new(NULL, NULL);
efreet_menu_move_cbs = ecore_hash_new(NULL, NULL); efreet_menu_move_cbs = ecore_hash_new(NULL, NULL);
efreet_menu_layout_cbs = ecore_hash_new(NULL, NULL); efreet_menu_layout_cbs = ecore_hash_new(NULL, NULL);
if (!efreet_menu_handle_cbs || !efreet_menu_filter_cbs if (!efreet_menu_handle_cbs || !efreet_menu_filter_cbs
|| !efreet_menu_move_cbs || !efreet_menu_layout_cbs) || !efreet_menu_move_cbs || !efreet_menu_layout_cbs)
return 0; return 0;
ecore_hash_free_key_cb_set(efreet_menu_handle_cbs, ecore_hash_free_key_cb_set(efreet_menu_handle_cbs,
ECORE_FREE_CB(ecore_string_release)); ECORE_FREE_CB(ecore_string_release));
ecore_hash_free_key_cb_set(efreet_menu_filter_cbs, ecore_hash_free_key_cb_set(efreet_menu_filter_cbs,
ECORE_FREE_CB(ecore_string_release)); ECORE_FREE_CB(ecore_string_release));
ecore_hash_free_key_cb_set(efreet_menu_move_cbs, ecore_hash_free_key_cb_set(efreet_menu_move_cbs,
ECORE_FREE_CB(ecore_string_release)); ECORE_FREE_CB(ecore_string_release));
ecore_hash_free_key_cb_set(efreet_menu_layout_cbs, ecore_hash_free_key_cb_set(efreet_menu_layout_cbs,
ECORE_FREE_CB(ecore_string_release)); ECORE_FREE_CB(ecore_string_release));
/* set Menu into it's own so we can check the XML is valid before trying /* set Menu into it's own so we can check the XML is valid before trying
@ -459,22 +459,22 @@ efreet_menu_init(void)
efreet_tag_menu = ecore_string_instance(menu_cbs[0].key); efreet_tag_menu = ecore_string_instance(menu_cbs[0].key);
for (i = 0; menu_cbs[i].key != NULL; i++) for (i = 0; menu_cbs[i].key != NULL; i++)
ecore_hash_set(efreet_menu_handle_cbs, ecore_hash_set(efreet_menu_handle_cbs,
(void *)ecore_string_instance(menu_cbs[i].key), (void *)ecore_string_instance(menu_cbs[i].key),
menu_cbs[i].cb); menu_cbs[i].cb);
for (i = 0; filter_cbs[i].key != NULL; i++) for (i = 0; filter_cbs[i].key != NULL; i++)
ecore_hash_set(efreet_menu_filter_cbs, ecore_hash_set(efreet_menu_filter_cbs,
(void *)ecore_string_instance(filter_cbs[i].key), (void *)ecore_string_instance(filter_cbs[i].key),
filter_cbs[i].cb); filter_cbs[i].cb);
for (i = 0; move_cbs[i].key != NULL; i++) for (i = 0; move_cbs[i].key != NULL; i++)
ecore_hash_set(efreet_menu_move_cbs, ecore_hash_set(efreet_menu_move_cbs,
(void *)ecore_string_instance(move_cbs[i].key), (void *)ecore_string_instance(move_cbs[i].key),
move_cbs[i].cb); move_cbs[i].cb);
for (i = 0; layout_cbs[i].key != NULL; i++) for (i = 0; layout_cbs[i].key != NULL; i++)
ecore_hash_set(efreet_menu_layout_cbs, ecore_hash_set(efreet_menu_layout_cbs,
(void *)ecore_string_instance(layout_cbs[i].key), (void *)ecore_string_instance(layout_cbs[i].key),
layout_cbs[i].cb); layout_cbs[i].cb);
@ -483,7 +483,7 @@ efreet_menu_init(void)
/** /**
* @return Returns no value * @return Returns no value
* @brief Initialize legacy kde support. This function blocks while * @brief Initialize legacy kde support. This function blocks while
* the kde-config script is run. * the kde-config script is run.
*/ */
int int
@ -492,17 +492,17 @@ efreet_menu_kde_legacy_init(void)
FILE *f; FILE *f;
char buf[PATH_MAX]; char buf[PATH_MAX];
char *p, *s; char *p, *s;
IF_FREE_LIST(efreet_menu_kde_legacy_dirs); IF_FREE_LIST(efreet_menu_kde_legacy_dirs);
f = popen("kde-config --path apps", "r"); f = popen("kde-config --path apps", "r");
if (!f) return 0; if (!f) return 0;
efreet_menu_kde_legacy_dirs = ecore_list_new(); efreet_menu_kde_legacy_dirs = ecore_list_new();
ecore_list_free_cb_set(efreet_menu_kde_legacy_dirs, ecore_list_free_cb_set(efreet_menu_kde_legacy_dirs,
ECORE_FREE_CB(ecore_string_release)); ECORE_FREE_CB(ecore_string_release));
/* XXX if the return from kde-config is a line longer than PATH_MAX, /* XXX if the return from kde-config is a line longer than PATH_MAX,
* this won't be correct (increase buffer and get the rest...) */ * this won't be correct (increase buffer and get the rest...) */
if (!fgets(buf, PATH_MAX, f)) if (!fgets(buf, PATH_MAX, f))
{ {
@ -515,14 +515,14 @@ efreet_menu_kde_legacy_init(void)
while (p) while (p)
{ {
*p = '\0'; *p = '\0';
ecore_list_append(efreet_menu_kde_legacy_dirs, ecore_list_append(efreet_menu_kde_legacy_dirs,
(void *)ecore_string_instance(s)); (void *)ecore_string_instance(s));
s = p + 1; s = p + 1;
p = strchr(s, ':'); p = strchr(s, ':');
} }
if (*s) if (*s)
ecore_list_append(efreet_menu_kde_legacy_dirs, ecore_list_append(efreet_menu_kde_legacy_dirs,
(void *)ecore_string_instance(s)); (void *)ecore_string_instance(s));
pclose(f); pclose(f);
@ -576,7 +576,7 @@ efreet_menu_get(void)
Ecore_List *config_dirs; Ecore_List *config_dirs;
/* check the users config directory first */ /* check the users config directory first */
snprintf(menu, sizeof(menu), "%s/menus/%sapplications.menu", snprintf(menu, sizeof(menu), "%s/menus/%sapplications.menu",
efreet_config_home_get(), efreet_menu_prefix_get()); efreet_config_home_get(), efreet_menu_prefix_get());
if (ecore_file_exists(menu)) if (ecore_file_exists(menu))
return efreet_menu_parse(menu); return efreet_menu_parse(menu);
@ -586,7 +586,7 @@ efreet_menu_get(void)
ecore_list_first_goto(config_dirs); ecore_list_first_goto(config_dirs);
while ((dir = ecore_list_next(config_dirs))) while ((dir = ecore_list_next(config_dirs)))
{ {
snprintf(menu, sizeof(menu), "%s/menus/%sapplications.menu", snprintf(menu, sizeof(menu), "%s/menus/%sapplications.menu",
dir, efreet_menu_prefix_get()); dir, efreet_menu_prefix_get());
if (ecore_file_exists(menu)) if (ecore_file_exists(menu))
return efreet_menu_parse(menu); return efreet_menu_parse(menu);
@ -842,8 +842,8 @@ efreet_menu_desktop_insert(Efreet_Menu *menu, Efreet_Desktop *desktop, int pos)
* @brief Remove a desktop element in a menu structure. Only accepts desktop files * @brief Remove a desktop element in a menu structure. Only accepts desktop files
* in default directories. * in default directories.
*/ */
int int
efreet_menu_desktop_remove(Efreet_Menu *menu, Efreet_Desktop *desktop) efreet_menu_desktop_remove(Efreet_Menu *menu, Efreet_Desktop *desktop)
{ {
Efreet_Menu *entry; Efreet_Menu *entry;
@ -912,7 +912,7 @@ efreet_menu_dump(Efreet_Menu *menu, const char *indent)
* dir, system dirs and given suffix. * dir, system dirs and given suffix.
*/ */
Ecore_List * Ecore_List *
efreet_default_dirs_get(const char *user_dir, Ecore_List *system_dirs, efreet_default_dirs_get(const char *user_dir, Ecore_List *system_dirs,
const char *suffix) const char *suffix)
{ {
const char *xdg_dir; const char *xdg_dir;
@ -938,7 +938,7 @@ efreet_default_dirs_get(const char *user_dir, Ecore_List *system_dirs,
/** /**
* @internal * @internal
* @return Returns a new Efreet_Menu_Internal struct * @return Returns a new Efreet_Menu_Internal struct
* @brief Allocates and initializes a new Efreet_Menu_Internal structure * @brief Allocates and initializes a new Efreet_Menu_Internal structure
*/ */
static Efreet_Menu_Internal * static Efreet_Menu_Internal *
efreet_menu_internal_new(void) efreet_menu_internal_new(void)
@ -958,13 +958,13 @@ efreet_menu_internal_new(void)
/** /**
* @param menu: The menu to free * @param menu: The menu to free
* @return Returns no value * @return Returns no value
* @brief Frees up the given menu structure * @brief Frees up the given menu structure
*/ */
void void
efreet_menu_internal_free(Efreet_Menu_Internal *internal) efreet_menu_internal_free(Efreet_Menu_Internal *internal)
{ {
if (!internal) return; if (!internal) return;
IF_FREE(internal->file.path); IF_FREE(internal->file.path);
IF_FREE(internal->file.name); IF_FREE(internal->file.name);
@ -1015,7 +1015,7 @@ efreet_menu_prefix_get(void)
* @param xml: The xml dom tree to populate from * @param xml: The xml dom tree to populate from
* @return Returns 1 if this XML tree is valid, 0 otherwise * @return Returns 1 if this XML tree is valid, 0 otherwise
* @brief Populates the given menu from the given xml structure * @brief Populates the given menu from the given xml structure
* *
* We walk the Menu children backwards. The reason for this is so that we * We walk the Menu children backwards. The reason for this is so that we
* can deal with all the things that make us select the 'last' element * can deal with all the things that make us select the 'last' element
* (MergeFile, Directory, etc). We'll see the last one first and can deal * (MergeFile, Directory, etc). We'll see the last one first and can deal
@ -1050,8 +1050,8 @@ efreet_menu_handle_menu(Efreet_Menu_Internal *internal, Efreet_Xml *xml)
* @param parent: The parent Menu * @param parent: The parent Menu
* @param xml: The xml that defines the menu * @param xml: The xml that defines the menu
* @return Returns 1 on success or 0 on failure * @return Returns 1 on success or 0 on failure
* @brief Handles the sub-menu nodes of the XML file * @brief Handles the sub-menu nodes of the XML file
*/ */
static int static int
efreet_menu_handle_sub_menu(Efreet_Menu_Internal *parent, Efreet_Xml *xml) efreet_menu_handle_sub_menu(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
{ {
@ -1069,7 +1069,7 @@ efreet_menu_handle_sub_menu(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
/* if this menu already exists we just take this one and stick it on the /* if this menu already exists we just take this one and stick it on the
* start of the existing one */ * start of the existing one */
if ((match = ecore_list_find(parent->sub_menus, if ((match = ecore_list_find(parent->sub_menus,
ECORE_COMPARE_CB(efreet_menu_cb_menu_compare), internal))) ECORE_COMPARE_CB(efreet_menu_cb_menu_compare), internal)))
{ {
@ -1087,7 +1087,7 @@ efreet_menu_handle_sub_menu(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
* @param parent: The parent menu * @param parent: The parent menu
* @param xml: The xml tree * @param xml: The xml tree
* @return Returns 1 on success or 0 on failure * @return Returns 1 on success or 0 on failure
* @brief Handles the AppDir tag * @brief Handles the AppDir tag
*/ */
static int static int
efreet_menu_handle_app_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml) efreet_menu_handle_app_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
@ -1102,7 +1102,7 @@ efreet_menu_handle_app_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
if (!path) return 0; if (!path) return 0;
/* we've already got this guy in our list we can skip it */ /* we've already got this guy in our list we can skip it */
if (ecore_list_find(parent->app_dirs, if (ecore_list_find(parent->app_dirs,
ECORE_COMPARE_CB(efreet_menu_cb_app_dirs_compare), path)) ECORE_COMPARE_CB(efreet_menu_cb_app_dirs_compare), path))
{ {
FREE(path); FREE(path);
@ -1141,7 +1141,7 @@ efreet_menu_handle_default_app_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xm
{ {
Efreet_Menu_App_Dir *app_dir; Efreet_Menu_App_Dir *app_dir;
if (ecore_list_find(parent->app_dirs, if (ecore_list_find(parent->app_dirs,
ECORE_COMPARE_CB(efreet_menu_cb_app_dirs_compare), dir)) ECORE_COMPARE_CB(efreet_menu_cb_app_dirs_compare), dir))
continue; continue;
@ -1203,7 +1203,7 @@ efreet_menu_handle_default_directory_dirs(Efreet_Menu_Internal *parent, Efreet_X
if (!parent) return 0; if (!parent) return 0;
efreet_menu_create_directory_dirs_list(parent); efreet_menu_create_directory_dirs_list(parent);
dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(), dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(),
"desktop-directories"); "desktop-directories");
ecore_list_first_goto(dirs); ecore_list_first_goto(dirs);
while ((dir = ecore_list_next(dirs))) while ((dir = ecore_list_next(dirs)))
@ -1230,7 +1230,7 @@ static int
efreet_menu_handle_name(Efreet_Menu_Internal *parent, Efreet_Xml *xml) efreet_menu_handle_name(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
{ {
/* not allowed to have two Name settings in a menu */ /* not allowed to have two Name settings in a menu */
if (parent->name.internal) if (parent->name.internal)
{ {
printf("efreet_menu_handle_name() setting second name into menu\n"); printf("efreet_menu_handle_name() setting second name into menu\n");
return 0; return 0;
@ -1354,12 +1354,12 @@ efreet_menu_handle_not_deleted(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
* @param parent: The parent menu * @param parent: The parent menu
* @param xml: The XML tree to work with * @param xml: The XML tree to work with
* @return Returns 1 on success or 0 on failure * @return Returns 1 on success or 0 on failure
* @brief Handles parsing the Include tag and all subtags * @brief Handles parsing the Include tag and all subtags
*/ */
static int static int
efreet_menu_handle_include(Efreet_Menu_Internal *parent, Efreet_Xml *xml) efreet_menu_handle_include(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
{ {
return efreet_menu_handle_filter(parent, xml, return efreet_menu_handle_filter(parent, xml,
EFREET_MENU_FILTER_INCLUDE); EFREET_MENU_FILTER_INCLUDE);
} }
@ -1373,7 +1373,7 @@ efreet_menu_handle_include(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
static int static int
efreet_menu_handle_exclude(Efreet_Menu_Internal *parent, Efreet_Xml *xml) efreet_menu_handle_exclude(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
{ {
return efreet_menu_handle_filter(parent, xml, return efreet_menu_handle_filter(parent, xml,
EFREET_MENU_FILTER_EXCLUDE); EFREET_MENU_FILTER_EXCLUDE);
} }
@ -1442,7 +1442,7 @@ efreet_menu_handle_all(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml)
/** /**
* @internal * @internal
* @param op: The filter operation * @param op: The filter operation
* @param xml: The xml tree * @param xml: The xml tree
* @return Returns 1 on success or 0 on failure * @return Returns 1 on success or 0 on failure
* @brief Handles the And tag and all subtags * @brief Handles the And tag and all subtags
@ -1452,7 +1452,7 @@ efreet_menu_handle_and(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml)
{ {
if (!op || !xml) return 0; if (!op || !xml) return 0;
return efreet_menu_handle_filter_child_op(op, xml, return efreet_menu_handle_filter_child_op(op, xml,
EFREET_MENU_FILTER_OP_AND); EFREET_MENU_FILTER_OP_AND);
} }
@ -1468,7 +1468,7 @@ efreet_menu_handle_or(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml)
{ {
if (!op || !xml) return 0; if (!op || !xml) return 0;
return efreet_menu_handle_filter_child_op(op, xml, return efreet_menu_handle_filter_child_op(op, xml,
EFREET_MENU_FILTER_OP_OR); EFREET_MENU_FILTER_OP_OR);
} }
@ -1484,7 +1484,7 @@ efreet_menu_handle_not(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml)
{ {
if (!op || !xml) return 0; if (!op || !xml) return 0;
return efreet_menu_handle_filter_child_op(op, xml, return efreet_menu_handle_filter_child_op(op, xml,
EFREET_MENU_FILTER_OP_NOT); EFREET_MENU_FILTER_OP_NOT);
} }
@ -1522,7 +1522,7 @@ efreet_menu_handle_merge_file(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
const char *dir, *p; const char *dir, *p;
int len = 0; int len = 0;
if (!parent->file.path) if (!parent->file.path)
{ {
printf("efreet_menu_handle_merge_file() missing menu path ...\n"); printf("efreet_menu_handle_merge_file() missing menu path ...\n");
return 0; return 0;
@ -1567,9 +1567,9 @@ efreet_menu_handle_merge_file(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
{ {
char file[PATH_MAX]; char file[PATH_MAX];
snprintf(file, sizeof(file), "%s/%s/%s", dir, (p ? p : ""), snprintf(file, sizeof(file), "%s/%s/%s", dir, (p ? p : ""),
parent->file.name); parent->file.name);
if (ecore_file_exists(file)) if (ecore_file_exists(file))
{ {
path = strdup(file); path = strdup(file);
break; break;
@ -1592,7 +1592,7 @@ efreet_menu_handle_merge_file(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
* @internal * @internal
* @param parent: The parent menu to merge into * @param parent: The parent menu to merge into
* @param xml: The XML to be merged * @param xml: The XML to be merged
* @param path: The path to the .menu file to merge * @param path: The path to the .menu file to merge
*/ */
static int static int
efreet_menu_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *path) efreet_menu_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *path)
@ -1607,7 +1607,7 @@ efreet_menu_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *pat
if (!ecore_file_exists(path)) return 1; if (!ecore_file_exists(path)) return 1;
realpath = ecore_file_realpath(path); realpath = ecore_file_realpath(path);
if (realpath[0] == '\0') if (realpath[0] == '\0')
{ {
printf("efreet_menu_merge() unable to get real path for %s\n", path); printf("efreet_menu_merge() unable to get real path for %s\n", path);
return 0; return 0;
@ -1622,7 +1622,7 @@ efreet_menu_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *pat
merge_xml = efreet_xml_new(realpath); merge_xml = efreet_xml_new(realpath);
FREE(realpath); FREE(realpath);
if (!merge_xml) if (!merge_xml)
{ {
printf("efreet_menu_merge() failed to read in the " printf("efreet_menu_merge() failed to read in the "
"merge file (%s)\n", realpath); "merge file (%s)\n", realpath);
@ -1657,7 +1657,7 @@ efreet_menu_handle_merge_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
path = efreet_menu_path_get(parent, xml->text); path = efreet_menu_path_get(parent, xml->text);
if (!path) return 1; if (!path) return 1;
if (!ecore_file_exists(path)) if (!ecore_file_exists(path))
{ {
FREE(path); FREE(path);
return 1; return 1;
@ -1677,7 +1677,7 @@ efreet_menu_handle_merge_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
* @return Returns 1 on success or 0 on failure * @return Returns 1 on success or 0 on failure
* @brief Find all of the .menu files in the given directory and merge them * @brief Find all of the .menu files in the given directory and merge them
* into the @a parent menu. * into the @a parent menu.
*/ */
static int static int
efreet_menu_merge_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *path) efreet_menu_merge_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *path)
{ {
@ -1727,17 +1727,17 @@ efreet_menu_handle_default_merge_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *
const char *prefix; const char *prefix;
if (!parent || !xml) return 0; if (!parent || !xml) return 0;
prefix = efreet_menu_prefix_get(); prefix = efreet_menu_prefix_get();
if (!strcmp(prefix, "gnome-") && if (!strcmp(prefix, "gnome-") &&
(!strcmp(parent->file.name, "gnome-applications.menu"))) (!strcmp(parent->file.name, "gnome-applications.menu")))
p = strdup("applications"); p = strdup("applications");
else if ((!strcmp(prefix, "kde-") && else if ((!strcmp(prefix, "kde-") &&
(!strcmp(parent->file.name, "kde-applications.menu")))) (!strcmp(parent->file.name, "kde-applications.menu"))))
p = strdup("applications"); p = strdup("applications");
else else
{ {
char *s; char *s;
@ -1748,7 +1748,7 @@ efreet_menu_handle_default_merge_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *
snprintf(path, sizeof(path), "menus/%s-merged", p); snprintf(path, sizeof(path), "menus/%s-merged", p);
FREE(p); FREE(p);
dirs = efreet_default_dirs_get(efreet_config_home_get(), dirs = efreet_default_dirs_get(efreet_config_home_get(),
efreet_config_dirs_get(), path); efreet_config_dirs_get(), path);
ecore_list_first_goto(dirs); ecore_list_first_goto(dirs);
while ((p = ecore_list_first_remove(dirs))) while ((p = ecore_list_first_remove(dirs)))
@ -1811,7 +1811,7 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
path = efreet_menu_path_get(parent, legacy_dir); path = efreet_menu_path_get(parent, legacy_dir);
/* nothing to do if the legacy path doesn't exist */ /* nothing to do if the legacy path doesn't exist */
if (!ecore_file_exists(path)) if (!ecore_file_exists(path))
{ {
FREE(path); FREE(path);
return NULL; return NULL;
@ -1869,7 +1869,7 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
ecore_strlcpy(file_path, path, PATH_MAX); ecore_strlcpy(file_path, path, PATH_MAX);
ecore_strlcpy(file_path + path_len, "/", PATH_MAX - path_len); ecore_strlcpy(file_path + path_len, "/", PATH_MAX - path_len);
ecore_strlcpy(file_path + path_len + 1, file->d_name, PATH_MAX - path_len - 1); ecore_strlcpy(file_path + path_len + 1, file->d_name, PATH_MAX - path_len - 1);
/* recurse into sub directories */ /* recurse into sub directories */
if (ecore_file_is_dir(file_path)) if (ecore_file_is_dir(file_path))
{ {
@ -1929,7 +1929,7 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
efreet_desktop_free(desktop); efreet_desktop_free(desktop);
} }
closedir(files); closedir(files);
FREE(path); FREE(path);
return legacy_internal; return legacy_internal;
} }
@ -1950,7 +1950,7 @@ efreet_menu_handle_kde_legacy_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml
if (!efreet_menu_kde_legacy_dirs) return 1; if (!efreet_menu_kde_legacy_dirs) return 1;
/* XXX if one _helper() call succeeds, we return success. should this be flipped? /* XXX if one _helper() call succeeds, we return success. should this be flipped?
* (return fail if on of them failed) */ * (return fail if on of them failed) */
ecore_list_first_goto(efreet_menu_kde_legacy_dirs); ecore_list_first_goto(efreet_menu_kde_legacy_dirs);
while ((dir = ecore_list_next(efreet_menu_kde_legacy_dirs))) while ((dir = ecore_list_next(efreet_menu_kde_legacy_dirs)))
@ -1958,7 +1958,7 @@ efreet_menu_handle_kde_legacy_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml
Efreet_Menu_Internal *kde; Efreet_Menu_Internal *kde;
kde = efreet_menu_handle_legacy_dir_helper(NULL, parent, dir, "kde"); kde = efreet_menu_handle_legacy_dir_helper(NULL, parent, dir, "kde");
if (kde) if (kde)
{ {
efreet_menu_concatenate(parent, kde); efreet_menu_concatenate(parent, kde);
efreet_menu_internal_free(kde); efreet_menu_internal_free(kde);
@ -2023,7 +2023,7 @@ efreet_menu_handle_old(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
if (!parent || !xml || !xml->text) return 0; if (!parent || !xml || !xml->text) return 0;
if (parent->current_move) if (parent->current_move)
{ {
printf("efreet_menu_handle_old() saw second <Old> " printf("efreet_menu_handle_old() saw second <Old> "
"before seeing <New>\n"); "before seeing <New>\n");
@ -2291,13 +2291,13 @@ efreet_menu_handle_layout_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, i
* @brief Parses the given XML tree and adds the filter to the parent menu * @brief Parses the given XML tree and adds the filter to the parent menu
*/ */
static int static int
efreet_menu_handle_filter(Efreet_Menu_Internal *parent, Efreet_Xml *xml, efreet_menu_handle_filter(Efreet_Menu_Internal *parent, Efreet_Xml *xml,
Efreet_Menu_Filter_Type type) Efreet_Menu_Filter_Type type)
{ {
Efreet_Menu_Filter *filter; Efreet_Menu_Filter *filter;
efreet_menu_create_filter_list(parent); efreet_menu_create_filter_list(parent);
/* filters have a default or relationship */ /* filters have a default or relationship */
filter = efreet_menu_filter_new(); filter = efreet_menu_filter_new();
filter->type = type; filter->type = type;
@ -2423,7 +2423,7 @@ efreet_menu_layout_free(Efreet_Menu_Layout *layout)
/** /**
* @internal * @internal
* @return Returns a new Efreet_Menu_Filter_Op on success or NULL on failure * @return Returns a new Efreet_Menu_Filter_Op on success or NULL on failure
* @brief Creates and initializes an Efreet_Menu_Filter_Op structure * @brief Creates and initializes an Efreet_Menu_Filter_Op structure
*/ */
static Efreet_Menu_Filter_Op * static Efreet_Menu_Filter_Op *
efreet_menu_filter_op_new(void) efreet_menu_filter_op_new(void)
@ -2445,7 +2445,7 @@ static void
efreet_menu_filter_op_free(Efreet_Menu_Filter_Op *op) efreet_menu_filter_op_free(Efreet_Menu_Filter_Op *op)
{ {
if (!op) return; if (!op) return;
IF_FREE_LIST(op->categories); IF_FREE_LIST(op->categories);
IF_FREE_LIST(op->filenames); IF_FREE_LIST(op->filenames);
IF_FREE_LIST(op->filters); IF_FREE_LIST(op->filters);
@ -2523,7 +2523,7 @@ efreet_menu_free(Efreet_Menu *entry)
* @brief Parses the given XML tree and populates a new child operation. * @brief Parses the given XML tree and populates a new child operation.
*/ */
static int static int
efreet_menu_handle_filter_child_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml, efreet_menu_handle_filter_child_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml,
Efreet_Menu_Filter_Op_Type type) Efreet_Menu_Filter_Op_Type type)
{ {
Efreet_Menu_Filter_Op *child_op; Efreet_Menu_Filter_Op *child_op;
@ -2540,7 +2540,7 @@ efreet_menu_handle_filter_child_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml,
if (!op->filters) if (!op->filters)
{ {
op->filters = ecore_list_new(); op->filters = ecore_list_new();
ecore_list_free_cb_set(op->filters, ecore_list_free_cb_set(op->filters,
ECORE_FREE_CB(efreet_menu_filter_op_free)); ECORE_FREE_CB(efreet_menu_filter_op_free));
} }
@ -2617,10 +2617,10 @@ efreet_menu_process_dirs(Efreet_Menu_Internal *internal)
* @param menu: the menu to process * @param menu: the menu to process
* @param only_unallocated: Only handle menus taht deal with unallocated items * @param only_unallocated: Only handle menus taht deal with unallocated items
* @return Returns no value * @return Returns no value
* @brief Handles the processing of the filters attached to the given menu. * @brief Handles the processing of the filters attached to the given menu.
* *
* For each include filter we'll add the items to our applications array. Each * For each include filter we'll add the items to our applications array. Each
* exclude filter will remove items from the applications array * exclude filter will remove items from the applications array
*/ */
static void static void
efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_unallocated) efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_unallocated)
@ -2659,7 +2659,7 @@ efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_un
parent = internal->parent; parent = internal->parent;
do { do {
efreet_menu_process_app_pool(parent->app_pool, efreet_menu_process_app_pool(parent->app_pool,
internal->applications, matches, filter, internal->applications, matches, filter,
internal->only_unallocated); internal->only_unallocated);
} while ((parent = parent->parent)); } while ((parent = parent->parent));
@ -2723,10 +2723,10 @@ efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_un
* @brief This will iterate the items in @a pool and append them to @a * @brief This will iterate the items in @a pool and append them to @a
* applications if they match the @a filter given and aren't previoulsy entered * applications if they match the @a filter given and aren't previoulsy entered
* in @a matches. If @a only_unallocated is set we'll only only at the * in @a matches. If @a only_unallocated is set we'll only only at the
* .desktop files that haven't been previoulsy matched * .desktop files that haven't been previoulsy matched
*/ */
static static
void efreet_menu_process_app_pool(Ecore_List *pool, Ecore_List *applications, void efreet_menu_process_app_pool(Ecore_List *pool, Ecore_List *applications,
Ecore_Hash *matches, Ecore_Hash *matches,
Efreet_Menu_Filter *filter, Efreet_Menu_Filter *filter,
unsigned int only_unallocated) unsigned int only_unallocated)
@ -2761,7 +2761,7 @@ efreet_menu_filter_matches(Efreet_Menu_Filter_Op *op, Efreet_Menu_Desktop *md)
{ {
if (op->type == EFREET_MENU_FILTER_OP_OR) if (op->type == EFREET_MENU_FILTER_OP_OR)
return efreet_menu_filter_or_matches(op, md); return efreet_menu_filter_or_matches(op, md);
if (op->type == EFREET_MENU_FILTER_OP_AND) if (op->type == EFREET_MENU_FILTER_OP_AND)
return efreet_menu_filter_and_matches(op, md); return efreet_menu_filter_and_matches(op, md);
@ -2829,7 +2829,7 @@ efreet_menu_filter_and_matches(Efreet_Menu_Filter_Op *op, Efreet_Menu_Desktop *m
Efreet_Menu_Filter_Op *child; Efreet_Menu_Filter_Op *child;
char *t; char *t;
if (op->categories) if (op->categories)
{ {
if ((ecore_list_count(op->categories) > 0) && !md->desktop->categories) if ((ecore_list_count(op->categories) > 0) && !md->desktop->categories)
return 0; return 0;
@ -2985,7 +2985,7 @@ efreet_menu_concatenate(Efreet_Menu_Internal *dest, Efreet_Menu_Internal *src)
while ((submenu = ecore_list_last_remove(src->sub_menus))) while ((submenu = ecore_list_last_remove(src->sub_menus)))
{ {
Efreet_Menu_Internal *match; Efreet_Menu_Internal *match;
/* if this menu is in the list already we just add to that */ /* if this menu is in the list already we just add to that */
if ((match = ecore_list_find(dest->sub_menus, if ((match = ecore_list_find(dest->sub_menus,
ECORE_COMPARE_CB(efreet_menu_cb_menu_compare), submenu))) ECORE_COMPARE_CB(efreet_menu_cb_menu_compare), submenu)))
@ -3021,7 +3021,7 @@ efreet_menu_resolve_moves(Efreet_Menu_Internal *internal)
/* nothing to do if this menu has no moves */ /* nothing to do if this menu has no moves */
if (!internal->moves) return; if (!internal->moves) return;
ecore_list_first_goto(internal->moves); ecore_list_first_goto(internal->moves);
while ((move = ecore_list_next(internal->moves))) while ((move = ecore_list_next(internal->moves)))
{ {
@ -3044,7 +3044,7 @@ efreet_menu_resolve_moves(Efreet_Menu_Internal *internal)
/* if the dest path has /'s in it then we need to add menus to /* if the dest path has /'s in it then we need to add menus to
* fill out the paths */ * fill out the paths */
t = strdup(move->new_name); t = strdup(move->new_name);
tmp = t; tmp = t;
path = strchr(tmp, '/'); path = strchr(tmp, '/');
while (path) while (path)
{ {
@ -3104,7 +3104,7 @@ efreet_menu_by_name_find(Efreet_Menu_Internal *internal, const char *name, Efree
{ {
*part = '\0'; *part = '\0';
if (!ecore_list_find(internal->sub_menus, if (!ecore_list_find(internal->sub_menus,
ECORE_COMPARE_CB(efreet_menu_cb_compare_names), ptr)) ECORE_COMPARE_CB(efreet_menu_cb_compare_names), ptr))
{ {
FREE(tmp); FREE(tmp);
@ -3119,7 +3119,7 @@ efreet_menu_by_name_find(Efreet_Menu_Internal *internal, const char *name, Efree
if (parent) *parent = internal; if (parent) *parent = internal;
/* find the menu in the parent list */ /* find the menu in the parent list */
if (!ecore_list_find(internal->sub_menus, if (!ecore_list_find(internal->sub_menus,
ECORE_COMPARE_CB(efreet_menu_cb_compare_names), ptr)) ECORE_COMPARE_CB(efreet_menu_cb_compare_names), ptr))
{ {
FREE(tmp); FREE(tmp);
@ -3199,7 +3199,7 @@ efreet_menu_app_dir_new(void)
* @internal * @internal
* @param dir: The app dir to free * @param dir: The app dir to free
* @return Returns no value * @return Returns no value
* @brief Frees @a dir * @brief Frees @a dir
*/ */
static void static void
efreet_menu_app_dir_free(Efreet_Menu_App_Dir *dir) efreet_menu_app_dir_free(Efreet_Menu_App_Dir *dir)
@ -3217,7 +3217,7 @@ efreet_menu_app_dir_free(Efreet_Menu_App_Dir *dir)
* @param a: The app dir to compare too * @param a: The app dir to compare too
* @param b: The path to compare too * @param b: The path to compare too
* @return Returns 1 if the strings are equals, 0 otherwise * @return Returns 1 if the strings are equals, 0 otherwise
* @brief Compares the too strings * @brief Compares the too strings
*/ */
static int static int
efreet_menu_cb_app_dirs_compare(Efreet_Menu_App_Dir *a, const char *b) efreet_menu_cb_app_dirs_compare(Efreet_Menu_App_Dir *a, const char *b)
@ -3231,7 +3231,7 @@ efreet_menu_create_sub_menu_list(Efreet_Menu_Internal *internal)
if (!internal || internal->sub_menus) return; if (!internal || internal->sub_menus) return;
internal->sub_menus = ecore_list_new(); internal->sub_menus = ecore_list_new();
ecore_list_free_cb_set(internal->sub_menus, ecore_list_free_cb_set(internal->sub_menus,
ECORE_FREE_CB(efreet_menu_internal_free)); ECORE_FREE_CB(efreet_menu_internal_free));
} }
@ -3241,7 +3241,7 @@ efreet_menu_create_app_dirs_list(Efreet_Menu_Internal *internal)
if (!internal || internal->app_dirs) return; if (!internal || internal->app_dirs) return;
internal->app_dirs = ecore_list_new(); internal->app_dirs = ecore_list_new();
ecore_list_free_cb_set(internal->app_dirs, ecore_list_free_cb_set(internal->app_dirs,
ECORE_FREE_CB(efreet_menu_app_dir_free)); ECORE_FREE_CB(efreet_menu_app_dir_free));
} }
@ -3269,7 +3269,7 @@ efreet_menu_create_filter_list(Efreet_Menu_Internal *internal)
if (!internal || internal->filters) return; if (!internal || internal->filters) return;
internal->filters = ecore_list_new(); internal->filters = ecore_list_new();
ecore_list_free_cb_set(internal->filters, ecore_list_free_cb_set(internal->filters,
ECORE_FREE_CB(efreet_menu_filter_free)); ECORE_FREE_CB(efreet_menu_filter_free));
} }
@ -3279,7 +3279,7 @@ efreet_menu_create_layout_list(Efreet_Menu_Internal *internal)
if (!internal || internal->layout) return; if (!internal || internal->layout) return;
internal->layout = ecore_list_new(); internal->layout = ecore_list_new();
ecore_list_free_cb_set(internal->layout, ecore_list_free_cb_set(internal->layout,
ECORE_FREE_CB(efreet_menu_layout_free)); ECORE_FREE_CB(efreet_menu_layout_free));
} }
@ -3289,7 +3289,7 @@ efreet_menu_create_default_layout_list(Efreet_Menu_Internal *internal)
if (!internal || internal->default_layout) return; if (!internal || internal->default_layout) return;
internal->default_layout = ecore_list_new(); internal->default_layout = ecore_list_new();
ecore_list_free_cb_set(internal->default_layout, ecore_list_free_cb_set(internal->default_layout,
ECORE_FREE_CB(efreet_menu_layout_free)); ECORE_FREE_CB(efreet_menu_layout_free));
} }
@ -3297,7 +3297,7 @@ static void
efreet_menu_create_directories_list(Efreet_Menu_Internal *internal) efreet_menu_create_directories_list(Efreet_Menu_Internal *internal)
{ {
if (!internal || internal->directories) return; if (!internal || internal->directories) return;
internal->directories = ecore_dlist_new(); internal->directories = ecore_dlist_new();
ecore_list_free_cb_set(internal->directories, free); ecore_list_free_cb_set(internal->directories, free);
} }
@ -3314,7 +3314,7 @@ efreet_menu_path_get(Efreet_Menu_Internal *internal, const char *suffix)
else else
{ {
if (!internal->file.path) if (!internal->file.path)
{ {
printf("efreet_menu_handle_app_dir() missing menu path ...\n"); printf("efreet_menu_handle_app_dir() missing menu path ...\n");
return NULL; return NULL;
@ -3456,11 +3456,11 @@ efreet_menu_directory_dirs_process(Efreet_Menu_Internal *internal)
* @param relative_path: The relative portion of the path * @param relative_path: The relative portion of the path
* @param cache: The cache to populate * @param cache: The cache to populate
* @return Returns 1 on success or 0 on failure * @return Returns 1 on success or 0 on failure
* @brief Scans the given directory dir for .directory files and adds the * @brief Scans the given directory dir for .directory files and adds the
* applications to the cache * applications to the cache
*/ */
static int static int
efreet_menu_directory_dir_scan(const char *path, const char *relative_path, efreet_menu_directory_dir_scan(const char *path, const char *relative_path,
Ecore_Hash *cache) Ecore_Hash *cache)
{ {
Efreet_Desktop *desktop; Efreet_Desktop *desktop;
@ -3874,7 +3874,7 @@ efreet_menu_layout_entries_get(Efreet_Menu *entry, Efreet_Menu_Internal *interna
else if (internal->sub_menus && !strcmp(layout->name, "all")) else if (internal->sub_menus && !strcmp(layout->name, "all"))
{ {
char *orig; char *orig;
orig = layout->name; orig = layout->name;
layout->name = "menus"; layout->name = "menus";
efreet_menu_layout_entries_get(entry, internal, layout); efreet_menu_layout_entries_get(entry, internal, layout);
@ -3910,4 +3910,3 @@ efreet_menu_cb_move_compare(Efreet_Menu_Move *move, const char *old)
{ {
return ecore_str_compare(move->old_name, old); return ecore_str_compare(move->old_name, old);
} }

View File

@ -4,7 +4,7 @@
/** /**
* @file efreet_menu.h * @file efreet_menu.h
* @brief Contains the structures and methods to support the Desktop * @brief Contains the structures and methods to support the Desktop
* Menu Specification. * Menu Specification.
* @addtogroup Efreet_Menu Efreet_Menu: The FDO Desktop Menu Specification * @addtogroup Efreet_Menu Efreet_Menu: The FDO Desktop Menu Specification
* functions and structures * functions and structures
@ -67,4 +67,3 @@ void efreet_menu_dump(Efreet_Menu *menu, const char *indent);
*/ */
#endif #endif

View File

@ -18,14 +18,14 @@ static Ecore_Hash *monitors = NULL; /* contains file monitors */
* @note This is set during efreet_mime_init based on * @note This is set during efreet_mime_init based on
* a runtime check. * a runtime check.
*/ */
static enum static enum
{ {
EFREET_ENDIAN_BIG = 0, EFREET_ENDIAN_BIG = 0,
EFREET_ENDIAN_LITTLE = 1 EFREET_ENDIAN_LITTLE = 1
} efreet_mime_endianess = EFREET_ENDIAN_BIG; } efreet_mime_endianess = EFREET_ENDIAN_BIG;
/* /*
* Buffer sized used for magic checks. The default is good enough for the * Buffer sized used for magic checks. The default is good enough for the
* current set of magic rules. This setting is only here for the future. * current set of magic rules. This setting is only here for the future.
*/ */
#define EFREET_MIME_MAGIC_BUFFER_SIZE 512 #define EFREET_MIME_MAGIC_BUFFER_SIZE 512
@ -74,8 +74,8 @@ static void efreet_mime_mime_types_load(const char *file);
static void efreet_mime_shared_mimeinfo_globs_load(const char *file); static void efreet_mime_shared_mimeinfo_globs_load(const char *file);
static void efreet_mime_shared_mimeinfo_magic_load(const char *file); static void efreet_mime_shared_mimeinfo_magic_load(const char *file);
static void efreet_mime_shared_mimeinfo_magic_parse(char *data, int size); static void efreet_mime_shared_mimeinfo_magic_parse(char *data, int size);
static const char *efreet_mime_magic_check_priority(const char *file, static const char *efreet_mime_magic_check_priority(const char *file,
unsigned int start, unsigned int start,
unsigned int end); unsigned int end);
static int efreet_mime_init_files(void); static int efreet_mime_init_files(void);
static const char *efreet_mime_special_check(const char *file); static const char *efreet_mime_special_check(const char *file);
@ -88,9 +88,9 @@ static int efreet_mime_glob_case_match(char *str, const char *glob);
static int efreet_mime_endian_check(void); static int efreet_mime_endian_check(void);
static void efreet_mime_monitor_add(const char *file); static void efreet_mime_monitor_add(const char *file);
static void efreet_mime_cb_update_file(void *data, static void efreet_mime_cb_update_file(void *data,
Ecore_File_Monitor *monitor, Ecore_File_Monitor *monitor,
Ecore_File_Event event, Ecore_File_Event event,
const char *path); const char *path);
/** /**
@ -99,26 +99,26 @@ static void efreet_mime_cb_update_file(void *data,
*/ */
int int
efreet_mime_init(void) efreet_mime_init(void)
{ {
if (!ecore_init()) if (!ecore_init())
return 0; return 0;
if (!ecore_file_init()) if (!ecore_file_init())
return 0; return 0;
if (!efreet_init()) if (!efreet_init())
return 0; return 0;
efreet_mime_endianess = efreet_mime_endian_check(); efreet_mime_endianess = efreet_mime_endian_check();
monitors = ecore_hash_new(ecore_str_hash, ecore_str_compare); monitors = ecore_hash_new(ecore_str_hash, ecore_str_compare);
ecore_hash_free_key_cb_set(monitors, ECORE_FREE_CB(free)); ecore_hash_free_key_cb_set(monitors, ECORE_FREE_CB(free));
ecore_hash_free_value_cb_set(monitors, ecore_hash_free_value_cb_set(monitors,
ECORE_FREE_CB(ecore_file_monitor_del)); ECORE_FREE_CB(ecore_file_monitor_del));
if (!efreet_mime_init_files()) if (!efreet_mime_init_files())
return 0; return 0;
return 1; return 1;
} }
@ -146,30 +146,30 @@ efreet_mime_shutdown(void)
*/ */
const char * const char *
efreet_mime_type_get(const char *file) efreet_mime_type_get(const char *file)
{ {
const char *type = NULL; const char *type = NULL;
if ((type = efreet_mime_special_check(file))) if ((type = efreet_mime_special_check(file)))
return type; return type;
/* /*
* Check magics with priority > 80 * Check magics with priority > 80
*/ */
if ((type = efreet_mime_magic_check_priority(file, 0, 80))) if ((type = efreet_mime_magic_check_priority(file, 0, 80)))
return type; return type;
/* /*
* Check globs * Check globs
*/ */
if ((type = efreet_mime_globs_type_get(file))) if ((type = efreet_mime_globs_type_get(file)))
return type; return type;
/* /*
* Check rest of magics * Check rest of magics
*/ */
if ((type = efreet_mime_magic_check_priority(file, 80, 0))) if ((type = efreet_mime_magic_check_priority(file, 80, 0)))
return type; return type;
return efreet_mime_fallback_check(file); return efreet_mime_fallback_check(file);
} }
@ -186,11 +186,11 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size)
const char *env = NULL; const char *env = NULL;
char *p = NULL, *pp = NULL, *ppp = NULL; char *p = NULL, *pp = NULL, *ppp = NULL;
char buf[PATH_MAX]; char buf[PATH_MAX];
if (!mime || !theme || !size) if (!mime || !theme || !size)
return NULL; return NULL;
icons = ecore_list_new(); icons = ecore_list_new();
ecore_list_free_cb_set(icons, free); ecore_list_free_cb_set(icons, free);
/* Standard icon name */ /* Standard icon name */
@ -203,17 +203,17 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size)
pp++; pp++;
} }
ecore_list_append(icons, p); ecore_list_append(icons, p);
/* Environment Based icon names */ /* Environment Based icon names */
if ((env = efreet_desktop_environment_get())) if ((env = efreet_desktop_environment_get()))
{ {
snprintf(buf, sizeof(buf), "%s-mime-%s", env, p); snprintf(buf, sizeof(buf), "%s-mime-%s", env, p);
ecore_list_append(icons, strdup(buf)); ecore_list_append(icons, strdup(buf));
snprintf(buf, sizeof(buf), "%s-%s", env, p); snprintf(buf, sizeof(buf), "%s-%s", env, p);
ecore_list_append(icons, strdup(buf)); ecore_list_append(icons, strdup(buf));
} }
/* Mime prefixed icon names */ /* Mime prefixed icon names */
snprintf(buf, sizeof(buf), "mime-%s", p); snprintf(buf, sizeof(buf), "mime-%s", p);
ecore_list_append(icons, strdup(buf)); ecore_list_append(icons, strdup(buf));
@ -223,20 +223,20 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size)
while ((ppp = strrchr(pp, '-'))) while ((ppp = strrchr(pp, '-')))
{ {
*ppp = '\0'; *ppp = '\0';
snprintf(buf, sizeof(buf), "%s-generic", pp); snprintf(buf, sizeof(buf), "%s-generic", pp);
ecore_list_append(icons, strdup(buf)); ecore_list_append(icons, strdup(buf));
snprintf(buf, sizeof(buf), "%s", pp); snprintf(buf, sizeof(buf), "%s", pp);
ecore_list_append(icons, strdup(buf)); ecore_list_append(icons, strdup(buf));
} }
FREE(pp); FREE(pp);
/* Search for icons using list */ /* Search for icons using list */
icon = efreet_icon_list_find(theme, icons, size); icon = efreet_icon_list_find(theme, icons, size);
ecore_list_destroy(icons); ecore_list_destroy(icons);
return icon; return icon;
} }
@ -248,7 +248,7 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size)
const char * const char *
efreet_mime_magic_type_get(const char *file) efreet_mime_magic_type_get(const char *file)
{ {
return efreet_mime_magic_check_priority(file, 0, 0); return efreet_mime_magic_check_priority(file, 0, 0);
} }
/** /**
@ -301,7 +301,7 @@ efreet_mime_globs_type_get(const char *file)
if (efreet_mime_glob_case_match(ext, g->glob)) if (efreet_mime_glob_case_match(ext, g->glob))
return g->mime; return g->mime;
} }
return NULL; return NULL;
} }
/** /**
@ -348,7 +348,7 @@ efreet_mime_endian_check(void)
* given file * given file
*/ */
static void static void
efreet_mime_monitor_add(const char *file) efreet_mime_monitor_add(const char *file)
{ {
Ecore_File_Monitor *fm = NULL; Ecore_File_Monitor *fm = NULL;
@ -374,17 +374,17 @@ efreet_mime_load_globs(Ecore_List *datadirs, const char *datahome)
{ {
char buf[4096]; char buf[4096];
const char *datadir = NULL; const char *datadir = NULL;
IF_FREE_HASH(wild); IF_FREE_HASH(wild);
wild = ecore_hash_new(ecore_str_hash, ecore_str_compare); wild = ecore_hash_new(ecore_str_hash, ecore_str_compare);
ecore_hash_free_key_cb_set(wild, ECORE_FREE_CB(ecore_string_release)); ecore_hash_free_key_cb_set(wild, ECORE_FREE_CB(ecore_string_release));
ecore_hash_free_value_cb_set(wild, ecore_hash_free_value_cb_set(wild,
ECORE_FREE_CB(ecore_string_release)); ECORE_FREE_CB(ecore_string_release));
IF_FREE_LIST(globs); IF_FREE_LIST(globs);
globs = ecore_list_new(); globs = ecore_list_new();
ecore_list_free_cb_set(globs, efreet_mime_glob_free); ecore_list_free_cb_set(globs, efreet_mime_glob_free);
/* /*
* This is here for legacy reasons. It is mentioned briefly * This is here for legacy reasons. It is mentioned briefly
* in the spec and seems to still be quite valid. It is * in the spec and seems to still be quite valid. It is
@ -392,7 +392,7 @@ efreet_mime_load_globs(Ecore_List *datadirs, const char *datahome)
* in here. * in here.
*/ */
efreet_mime_mime_types_load("/etc/mime.types"); efreet_mime_mime_types_load("/etc/mime.types");
datadir = datahome; datadir = datahome;
ecore_list_first_goto(datadirs); ecore_list_first_goto(datadirs);
while (datadir) while (datadir)
@ -411,16 +411,16 @@ efreet_mime_load_globs(Ecore_List *datadirs, const char *datahome)
* @return Returns no value * @return Returns no value
* @brief Read all magic files in XDG data/home dirs. * @brief Read all magic files in XDG data/home dirs.
*/ */
static void static void
efreet_mime_load_magics(Ecore_List *datadirs, const char *datahome) efreet_mime_load_magics(Ecore_List *datadirs, const char *datahome)
{ {
char buf[4096]; char buf[4096];
const char *datadir = NULL; const char *datadir = NULL;
IF_FREE_LIST(magics); IF_FREE_LIST(magics);
magics = ecore_list_new(); magics = ecore_list_new();
ecore_list_free_cb_set(magics, efreet_mime_magic_free); ecore_list_free_cb_set(magics, efreet_mime_magic_free);
datadir = datahome; datadir = datahome;
ecore_list_first_goto(datadirs); ecore_list_first_goto(datadirs);
while (datadir) while (datadir)
@ -445,23 +445,23 @@ efreet_mime_load_magics(Ecore_List *datadirs, const char *datahome)
* the globs are updated. * the globs are updated.
*/ */
static void static void
efreet_mime_cb_update_file(void *data __UNUSED__, efreet_mime_cb_update_file(void *data __UNUSED__,
Ecore_File_Monitor *monitor __UNUSED__, Ecore_File_Monitor *monitor __UNUSED__,
Ecore_File_Event event __UNUSED__, Ecore_File_Event event __UNUSED__,
const char *path) const char *path)
{ {
Ecore_List *datadirs = NULL; Ecore_List *datadirs = NULL;
const char *datahome = NULL; const char *datahome = NULL;
if (!(datahome = efreet_data_home_get())) if (!(datahome = efreet_data_home_get()))
return; return;
if (!(datadirs = efreet_data_dirs_get())) if (!(datadirs = efreet_data_dirs_get()))
return; return;
if (strstr(path, "magic")) if (strstr(path, "magic"))
efreet_mime_load_magics(datadirs, datahome); efreet_mime_load_magics(datadirs, datahome);
else else
efreet_mime_load_globs(datadirs, datahome); efreet_mime_load_globs(datadirs, datahome);
} }
@ -475,20 +475,20 @@ efreet_mime_cb_update_file(void *data __UNUSED__,
static int static int
efreet_mime_init_files(void) efreet_mime_init_files(void)
{ {
Ecore_List *datadirs = NULL; Ecore_List *datadirs = NULL;
char buf[PATH_MAX]; char buf[PATH_MAX];
const char *datahome, *datadir = NULL; const char *datahome, *datadir = NULL;
if (!(datahome = efreet_data_home_get())) if (!(datahome = efreet_data_home_get()))
return 0; return 0;
if (!(datadirs = efreet_data_dirs_get())) if (!(datadirs = efreet_data_dirs_get()))
return 0; return 0;
/* /*
* Add our file monitors * Add our file monitors
* We watch the directories so we can watch for new files * We watch the directories so we can watch for new files
*/ */
datadir = datahome; datadir = datahome;
ecore_list_first_goto(datadirs); ecore_list_first_goto(datadirs);
while (datadir) while (datadir)
@ -499,7 +499,7 @@ efreet_mime_init_files(void)
datadir = ecore_list_next(datadirs); datadir = ecore_list_next(datadirs);
} }
efreet_mime_monitor_add("/etc/mime.types"); efreet_mime_monitor_add("/etc/mime.types");
/* Load our mime information */ /* Load our mime information */
efreet_mime_load_globs(datadirs, datahome); efreet_mime_load_globs(datadirs, datahome);
efreet_mime_load_magics(datadirs, datahome); efreet_mime_load_magics(datadirs, datahome);
@ -532,59 +532,59 @@ efreet_mime_init_files(void)
*/ */
static const char * static const char *
efreet_mime_special_check(const char *file) efreet_mime_special_check(const char *file)
{ {
struct stat s; struct stat s;
int path_len = 0; int path_len = 0;
if (!lstat(file, &s)) if (!lstat(file, &s))
{ {
if (S_ISREG(s.st_mode)) if (S_ISREG(s.st_mode))
return NULL; return NULL;
if (S_ISLNK(s.st_mode)) if (S_ISLNK(s.st_mode))
return "inode/symlink"; return "inode/symlink";
if (S_ISFIFO(s.st_mode)) if (S_ISFIFO(s.st_mode))
return "inode/fifo"; return "inode/fifo";
if (S_ISCHR(s.st_mode)) if (S_ISCHR(s.st_mode))
return "inode/chardevice"; return "inode/chardevice";
if (S_ISBLK(s.st_mode)) if (S_ISBLK(s.st_mode))
return "inode/blockdevice"; return "inode/blockdevice";
if (S_ISSOCK(s.st_mode)) if (S_ISSOCK(s.st_mode))
return "inode/socket"; return "inode/socket";
if (S_ISDIR(s.st_mode)) if (S_ISDIR(s.st_mode))
{ {
struct stat s2; struct stat s2;
char parent[PATH_MAX]; char parent[PATH_MAX];
char path[PATH_MAX]; char path[PATH_MAX];
strncpy(path, file, PATH_MAX); strncpy(path, file, PATH_MAX);
path_len = strlen(file); path_len = strlen(file);
strncpy(parent, path, PATH_MAX); strncpy(parent, path, PATH_MAX);
/* Kill any trailing slash */ /* Kill any trailing slash */
parent[--path_len] = '\0'; parent[--path_len] = '\0';
/* Truncate to last slash */ /* Truncate to last slash */
while (parent[--path_len] != '/') parent[path_len] = '\0'; while (parent[--path_len] != '/') parent[path_len] = '\0';
if (!lstat(parent, &s2)) if (!lstat(parent, &s2))
{ {
if (s.st_dev != s2.st_dev) if (s.st_dev != s2.st_dev)
return "inode/mount-point"; return "inode/mount-point";
} }
return "inode/directory"; return "inode/directory";
} }
return NULL; return NULL;
} }
return NULL; return NULL;
} }
@ -592,7 +592,7 @@ efreet_mime_special_check(const char *file)
* @internal * @internal
* @param file: File to examine * @param file: File to examine
* @return Returns mime type or NULL if the file doesn't exist * @return Returns mime type or NULL if the file doesn't exist
* @brief Returns text/plain if the file appears to contain text and * @brief Returns text/plain if the file appears to contain text and
* returns application/octet-stream if it appears to be binary. * returns application/octet-stream if it appears to be binary.
*/ */
static const char * static const char *
@ -601,13 +601,13 @@ efreet_mime_fallback_check(const char *file)
FILE *f = NULL; FILE *f = NULL;
char buf[32]; char buf[32];
int i; int i;
if (!(f = fopen(file, "r"))) if (!(f = fopen(file, "r")))
return NULL; return NULL;
i = fread(buf, 1, sizeof(buf), f); i = fread(buf, 1, sizeof(buf), f);
fclose(f); fclose(f);
if (i == 0) if (i == 0)
return "application/octet-stream"; return "application/octet-stream";
/* /*
@ -617,13 +617,13 @@ efreet_mime_fallback_check(const char *file)
*/ */
for (i -= 1; i >= 0; --i) for (i -= 1; i >= 0; --i)
{ {
if ((buf[i] < 0x20) && if ((buf[i] < 0x20) &&
(buf[i] != '\n') && /* Line Feed */ (buf[i] != '\n') && /* Line Feed */
(buf[i] != '\r') && /* Carriage Return */ (buf[i] != '\r') && /* Carriage Return */
(buf[i] != '\t')) /* Tab */ (buf[i] != '\t')) /* Tab */
return "application/octet-stream"; return "application/octet-stream";
} }
return "text/plain"; return "text/plain";
} }
@ -637,7 +637,7 @@ static int
efreet_mime_glob_remove(const char *glob) efreet_mime_glob_remove(const char *glob)
{ {
Efreet_Mime_Glob *mime = NULL; Efreet_Mime_Glob *mime = NULL;
mime = ecore_list_first_goto(globs); mime = ecore_list_first_goto(globs);
while ((mime = ecore_list_current(globs))) while ((mime = ecore_list_current(globs)))
{ {
@ -651,7 +651,7 @@ efreet_mime_glob_remove(const char *glob)
} }
ecore_list_next(globs); ecore_list_next(globs);
} }
return 0; return 0;
} }
@ -659,7 +659,7 @@ efreet_mime_glob_remove(const char *glob)
* @internal * @internal
* @param file: mime.types file to load * @param file: mime.types file to load
* @return Returns no value * @return Returns no value
* @brief Loads values from a mime.types style file * @brief Loads values from a mime.types style file
* into the globs list. * into the globs list.
* @note Format: * @note Format:
* application/msaccess mdb * application/msaccess mdb
@ -688,7 +688,7 @@ efreet_mime_mime_types_load(const char *file)
if ((*p == '\n') || (*p == 0)) continue; if ((*p == '\n') || (*p == 0)) continue;
strncpy(mimetype, pp, (p - pp)); strncpy(mimetype, pp, (p - pp));
mimetype[p - pp] = 0; mimetype[p - pp] = 0;
do do
{ {
while (isspace(*p) && (*p != 0) && (*p != '\n')) p++; while (isspace(*p) && (*p != 0) && (*p != '\n')) p++;
@ -700,7 +700,7 @@ efreet_mime_mime_types_load(const char *file)
strncpy(ext, pp, (p - pp)); strncpy(ext, pp, (p - pp));
ext[p - pp] = 0; ext[p - pp] = 0;
ecore_hash_set(wild, (void*)ecore_string_instance(ext), ecore_hash_set(wild, (void*)ecore_string_instance(ext),
(void*)ecore_string_instance(mimetype)); (void*)ecore_string_instance(mimetype));
} }
@ -713,7 +713,7 @@ efreet_mime_mime_types_load(const char *file)
* @internal * @internal
* @param file: globs file to load * @param file: globs file to load
* @return Returns no value * @return Returns no value
* @brief Loads values from a mime.types style file * @brief Loads values from a mime.types style file
* into the globs list. * into the globs list.
* @note Format: * @note Format:
* text/vnd.wap.wml:*.wml * text/vnd.wap.wml:*.wml
@ -730,7 +730,7 @@ efreet_mime_shared_mimeinfo_globs_load(const char *file)
f = fopen(file, "rb"); f = fopen(file, "rb");
if (!f) return; if (!f) return;
while (fgets(buf, sizeof(buf), f)) while (fgets(buf, sizeof(buf), f))
{ {
p = buf; p = buf;
@ -747,7 +747,7 @@ efreet_mime_shared_mimeinfo_globs_load(const char *file)
mimetype[p - pp] = 0; mimetype[p - pp] = 0;
p++; p++;
pp = ext; pp = ext;
while ((*p != 0) && (*p != '\n')) while ((*p != 0) && (*p != '\n'))
{ {
*pp = *p; *pp = *p;
@ -758,7 +758,7 @@ efreet_mime_shared_mimeinfo_globs_load(const char *file)
*pp = 0; *pp = 0;
if (ext[0] == '*' && ext[1] == '.') if (ext[0] == '*' && ext[1] == '.')
{ {
ecore_hash_set(wild, (void*)ecore_string_instance(&(ext[2])), ecore_hash_set(wild, (void*)ecore_string_instance(&(ext[2])),
(void*)ecore_string_instance(mimetype)); (void*)ecore_string_instance(mimetype));
} }
@ -783,7 +783,7 @@ efreet_mime_shared_mimeinfo_globs_load(const char *file)
} }
} }
} }
fclose(f); fclose(f);
} }
@ -798,10 +798,10 @@ static int
efreet_mime_count_digits(int in) efreet_mime_count_digits(int in)
{ {
int i = 1, j = in; int i = 1, j = in;
if (j < 10) return 1; if (j < 10) return 1;
while ((j /= 10) > 0) ++i; while ((j /= 10) > 0) ++i;
return i; return i;
} }
@ -816,7 +816,7 @@ efreet_mime_shared_mimeinfo_magic_load(const char *file)
{ {
int fd = -1, size; int fd = -1, size;
char *data = (void *)-1; char *data = (void *)-1;
if (!file) return; if (!file) return;
size = ecore_file_size(file); size = ecore_file_size(file);
@ -838,7 +838,7 @@ efreet_mime_shared_mimeinfo_magic_load(const char *file)
close(fd); close(fd);
} }
/** /**
* @param data: The data from the file * @param data: The data from the file
* @return Returns no value * @return Returns no value
* @brief Parses a magic file * @brief Parses a magic file
@ -856,23 +856,23 @@ efreet_mime_shared_mimeinfo_magic_load(const char *file)
* ---------------------------------------------------------------------- * ----------------------------------------------------------------------
* *
* indent * indent
* The nesting depth of the rule, corresponding to the number of '>' * The nesting depth of the rule, corresponding to the number of '>'
* characters in the traditional file format. * characters in the traditional file format.
* ">" start-offset * ">" start-offset
* The offset into the file to look for a match. * The offset into the file to look for a match.
* "=" value * "=" value
* Two bytes giving the (big-endian) length of the value, followed by the * Two bytes giving the (big-endian) length of the value, followed by the
* value itself. * value itself.
* "&" mask * "&" mask
* The mask, which (if present) is exactly the same length as the value. * The mask, which (if present) is exactly the same length as the value.
* "~" word-size * "~" word-size
* On little-endian machines, the size of each group to byte-swap. * On little-endian machines, the size of each group to byte-swap.
* "+" range-length * "+" range-length
* The length of the region in the file to check. * The length of the region in the file to check.
* *
* The indent, range-length, word-size and mask components are optional. * The indent, range-length, word-size and mask components are optional.
* If missing, indent defaults to 0, range-length to 1, the word-size to 1, * If missing, indent defaults to 0, range-length to 1, the word-size to 1,
* and the mask to all 'one' bits. In our case, mask is null as it is * and the mask to all 'one' bits. In our case, mask is null as it is
* quicker, uses less memory and will acheive the same exact effect. * quicker, uses less memory and will acheive the same exact effect.
*/ */
static void static void
@ -916,7 +916,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
mime->mime = ecore_string_instance(buf); mime->mime = ecore_string_instance(buf);
ptr = ++val; ptr = ++val;
while (*ptr != '\n') ptr++; while (*ptr != '\n') ptr++;
} }
else else
@ -941,7 +941,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
ecore_list_append(mime->entries, entry); ecore_list_append(mime->entries, entry);
} }
switch(*ptr) switch(*ptr)
{ {
case '>': case '>':
@ -952,7 +952,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
case '=': case '=':
ptr++; ptr++;
entry->value_len = ntohs(*((short*)(ptr))); entry->value_len = ntohs(*((short*)(ptr)));
ptr += 2; ptr += 2;
entry->value = NEW(1, entry->value_len); entry->value = NEW(1, entry->value_len);
@ -970,9 +970,9 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
case '~': case '~':
ptr++; ptr++;
entry->word_size = atoi(ptr); entry->word_size = atoi(ptr);
if (((entry->word_size != 0) if (((entry->word_size != 0)
&& (entry->word_size != 1) && (entry->word_size != 1)
&& (entry->word_size != 2) && (entry->word_size != 2)
&& (entry->word_size != 4)) && (entry->word_size != 4))
|| (entry->value_len % entry->word_size)) || (entry->value_len % entry->word_size))
{ {
@ -984,7 +984,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
while (*ptr != '\n') ptr++; while (*ptr != '\n') ptr++;
break; break;
} }
if (efreet_mime_endianess == EFREET_ENDIAN_LITTLE) if (efreet_mime_endianess == EFREET_ENDIAN_LITTLE)
{ {
int j; int j;
@ -993,25 +993,25 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
{ {
if (entry->word_size == 2) if (entry->word_size == 2)
{ {
((short*)entry->value)[j] = ((short*)entry->value)[j] =
ntohs(((short*)entry->value)[j]); ntohs(((short*)entry->value)[j]);
if (entry->mask) if (entry->mask)
((short*)entry->mask)[j] = ((short*)entry->mask)[j] =
ntohs(((short*)entry->mask)[j]); ntohs(((short*)entry->mask)[j]);
} }
else if (entry->word_size == 4) else if (entry->word_size == 4)
{ {
((long*)entry->value)[j] = ((long*)entry->value)[j] =
ntohl(((long*)entry->value)[j]); ntohl(((long*)entry->value)[j]);
if (entry->mask) if (entry->mask)
((long*)entry->mask)[j] = ((long*)entry->mask)[j] =
ntohl(((long*)entry->mask)[j]); ntohl(((long*)entry->mask)[j]);
} }
} }
} }
ptr += efreet_mime_count_digits(entry->word_size); ptr += efreet_mime_count_digits(entry->word_size);
break; break;
@ -1020,7 +1020,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
entry->range_len = atoi(ptr); entry->range_len = atoi(ptr);
ptr += efreet_mime_count_digits(entry->range_len); ptr += efreet_mime_count_digits(entry->range_len);
break; break;
case '\n': case '\n':
ptr++; ptr++;
entry = NULL; entry = NULL;
@ -1055,8 +1055,8 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
* @brief Applies magic rules to a file given a start and end priority * @brief Applies magic rules to a file given a start and end priority
*/ */
static const char * static const char *
efreet_mime_magic_check_priority(const char *file, efreet_mime_magic_check_priority(const char *file,
unsigned int start, unsigned int start,
unsigned int end) unsigned int end)
{ {
Efreet_Mime_Magic *m = NULL; Efreet_Mime_Magic *m = NULL;
@ -1068,30 +1068,30 @@ efreet_mime_magic_check_priority(const char *file,
f = fopen(file, "rb"); f = fopen(file, "rb");
if (!f) return NULL; if (!f) return NULL;
if (!(m = ecore_list_first_goto(magics))) if (!(m = ecore_list_first_goto(magics)))
{ {
fclose(f); fclose(f);
return NULL; return NULL;
} }
if ((bytes_read = fread(buf, 1, sizeof(buf), f)) == 0) if ((bytes_read = fread(buf, 1, sizeof(buf), f)) == 0)
{ {
fclose(f); fclose(f);
return NULL; return NULL;
} }
while ((m = ecore_list_next(magics))) while ((m = ecore_list_next(magics)))
{ {
if ((start != 0) && (m->priority > start)) if ((start != 0) && (m->priority > start))
continue; continue;
if (m->priority < end) if (m->priority < end)
break; break;
ecore_list_first_goto(m->entries); ecore_list_first_goto(m->entries);
while ((e = ecore_list_next(m->entries))) while ((e = ecore_list_next(m->entries)))
{ {
if ((level < e->indent) && !match) if ((level < e->indent) && !match)
continue; continue;
@ -1101,13 +1101,13 @@ efreet_mime_magic_check_priority(const char *file,
else if ((level > e->indent) && match) else if ((level > e->indent) && match)
{ {
fclose(f); fclose(f);
if (last_mime) return last_mime; if (last_mime) return last_mime;
} }
for (offset = e->offset; offset < e->offset + e->range_len; offset++) for (offset = e->offset; offset < e->offset + e->range_len; offset++)
{ {
if (((offset + e->value_len) > bytes_read) && if (((offset + e->value_len) > bytes_read) &&
(fseek(f, offset, SEEK_SET) == -1)) (fseek(f, offset, SEEK_SET) == -1))
break; break;
@ -1118,7 +1118,7 @@ efreet_mime_magic_check_priority(const char *file,
c = fgetc(f); c = fgetc(f);
else else
c = buf[offset + i]; c = buf[offset + i];
v = e->value[i]; v = e->value[i];
if (e->mask) v &= e->mask[i]; if (e->mask) v &= e->mask[i];
@ -1128,8 +1128,8 @@ efreet_mime_magic_check_priority(const char *file,
break; break;
} }
} }
if (match) if (match)
{ {
level += 1; level += 1;
last_mime = m->mime; last_mime = m->mime;
@ -1169,7 +1169,7 @@ static void
efreet_mime_magic_free(void *data) efreet_mime_magic_free(void *data)
{ {
Efreet_Mime_Magic *m = data; Efreet_Mime_Magic *m = data;
IF_RELEASE(m->mime); IF_RELEASE(m->mime);
IF_FREE_LIST(m->entries); IF_FREE_LIST(m->entries);
IF_FREE(m); IF_FREE(m);
@ -1185,7 +1185,7 @@ static void
efreet_mime_magic_entry_free(void *data) efreet_mime_magic_entry_free(void *data)
{ {
Efreet_Mime_Magic_Entry *e = data; Efreet_Mime_Magic_Entry *e = data;
IF_FREE(e->mask); IF_FREE(e->mask);
IF_FREE(e->value); IF_FREE(e->value);
IF_FREE(e); IF_FREE(e);
@ -1237,4 +1237,3 @@ efreet_mime_glob_case_match(char *str, const char *glob)
if (!fnmatch(str, tglob, 0)) return 1; if (!fnmatch(str, tglob, 0)) return 1;
return 0; return 0;
} }

View File

@ -43,14 +43,14 @@
#define NEW(x, c) calloc(c, sizeof(x)) #define NEW(x, c) calloc(c, sizeof(x))
/** /**
* @def FREE(x) * @def FREE(x)
* Free x and set to NULL * Free x and set to NULL
*/ */
#define FREE(x) do { free(x); x = NULL; } while (0) #define FREE(x) do { free(x); x = NULL; } while (0)
/** /**
* @def IF_FREE(x) * @def IF_FREE(x)
* If x is set, free x and set to NULL * If x is set, free x and set to NULL
*/ */
#define IF_FREE(x) do { if (x) FREE(x); } while (0) #define IF_FREE(x) do { if (x) FREE(x); } while (0)
@ -66,7 +66,7 @@
} while (0) } while (0)
/** /**
* @def IF_FREE_LIST(x) * @def IF_FREE_LIST(x)
* If x is a valid pointer destroy x and set to NULL * If x is a valid pointer destroy x and set to NULL
*/ */
#define IF_FREE_LIST(x) do { \ #define IF_FREE_LIST(x) do { \
@ -77,7 +77,7 @@
} while (0) } while (0)
/** /**
* @def IF_FREE_DLIST(x) * @def IF_FREE_DLIST(x)
* If x is a valid pointer destroy x and set to NULL * If x is a valid pointer destroy x and set to NULL
*/ */
#define IF_FREE_DLIST(x) do { \ #define IF_FREE_DLIST(x) do { \
@ -88,7 +88,7 @@
} while (0) } while (0)
/** /**
* @def IF_FREE_HASH(x) * @def IF_FREE_HASH(x)
* If x is a valid pointer destroy x and set to NULL * If x is a valid pointer destroy x and set to NULL
*/ */
#define IF_FREE_HASH(x) do { \ #define IF_FREE_HASH(x) do { \
@ -120,7 +120,7 @@
* @internal * @internal
* The different types of commands in an Exec entry * The different types of commands in an Exec entry
*/ */
enum Efreet_Desktop_Command_Flag enum Efreet_Desktop_Command_Flag
{ {
EFREET_DESKTOP_EXEC_FLAG_FULLPATH = 0x0001, EFREET_DESKTOP_EXEC_FLAG_FULLPATH = 0x0001,
EFREET_DESKTOP_EXEC_FLAG_URI = 0x0002, EFREET_DESKTOP_EXEC_FLAG_URI = 0x0002,
@ -187,8 +187,8 @@ void efreet_icon_shutdown(void);
int efreet_menu_init(void); int efreet_menu_init(void);
void efreet_menu_shutdown(void); void efreet_menu_shutdown(void);
Ecore_List *efreet_default_dirs_get(const char *user_dir, Ecore_List *efreet_default_dirs_get(const char *user_dir,
Ecore_List *system_dirs, Ecore_List *system_dirs,
const char *suffix); const char *suffix);
int efreet_ini_init(void); int efreet_ini_init(void);
@ -212,4 +212,3 @@ const char *efreet_desktop_environment_get(void);
*/ */
#endif #endif

View File

@ -491,7 +491,7 @@ efreet_util_cache_fill(void *data __UNUSED__)
printf("%d\n", ecore_hash_count(desktop_by_file_id)); printf("%d\n", ecore_hash_count(desktop_by_file_id));
#endif #endif
ecore_event_add(EFREET_EVENT_DESKTOP_LIST_CHANGE, NULL, NULL, NULL); ecore_event_add(EFREET_EVENT_DESKTOP_LIST_CHANGE, NULL, NULL, NULL);
return 0; return 0;
} }
} }
@ -1047,7 +1047,7 @@ efreet_util_desktops_by_category_add(Efreet_Desktop *desktop)
if (!list) if (!list)
{ {
list = ecore_list_new(); list = ecore_list_new();
ecore_hash_set(desktops_by_category, ecore_hash_set(desktops_by_category,
(void *)ecore_string_instance(category), list); (void *)ecore_string_instance(category), list);
} }
if (!ecore_list_goto(list, desktop)) if (!ecore_list_goto(list, desktop))

View File

@ -6,7 +6,7 @@ static void efreet_xml_dump(Efreet_Xml *xml, int level);
static Efreet_Xml *efreet_xml_parse(char **data, int *size); static Efreet_Xml *efreet_xml_parse(char **data, int *size);
static int efreet_xml_tag_parse(char **data, int *size, const char **tag); static int efreet_xml_tag_parse(char **data, int *size, const char **tag);
static void efreet_xml_attributes_parse(char **data, int *size, static void efreet_xml_attributes_parse(char **data, int *size,
Efreet_Xml_Attribute ***attributes); Efreet_Xml_Attribute ***attributes);
static void efreet_xml_text_parse(char **data, int *size, char **text); static void efreet_xml_text_parse(char **data, int *size, char **text);
@ -117,7 +117,7 @@ efreet_xml_del(Efreet_Xml *xml)
IF_FREE(xml->text); IF_FREE(xml->text);
FREE(xml); FREE(xml);
} }
/** /**
* @param xml: The xml struct to work with * @param xml: The xml struct to work with
* @param key: The attribute key to look for * @param key: The attribute key to look for
@ -150,7 +150,7 @@ efreet_xml_dump(Efreet_Xml *xml, int level)
{ {
int i; int i;
for (i = 0; i < level; i++) for (i = 0; i < level; i++)
printf("\t"); printf("\t");
printf("<%s", xml->tag); printf("<%s", xml->tag);
if (xml->attributes) if (xml->attributes)
@ -170,7 +170,7 @@ efreet_xml_dump(Efreet_Xml *xml, int level)
while ((child = ecore_dlist_next(xml->children))) while ((child = ecore_dlist_next(xml->children)))
efreet_xml_dump(child, level + 1); efreet_xml_dump(child, level + 1);
for (i = 0; i < level; i++) for (i = 0; i < level; i++)
printf("\t"); printf("\t");
printf("</%s>\n", xml->tag); printf("</%s>\n", xml->tag);
} }
@ -234,7 +234,7 @@ efreet_xml_tag_parse(char **data, int *size, const char **tag)
if (*(*data + 1) == '/') return 0; if (*(*data + 1) == '/') return 0;
/* skip comments */ /* skip comments */
if (*size > 3 && *(*data + 1) == '!' && *(*data + 2) == '-' && *(*data + 3) == '-') if (*size > 3 && *(*data + 1) == '!' && *(*data + 2) == '-' && *(*data + 3) == '-')
{ {
(*data) += 3; (*data) += 3;
(*size) -= 3; (*size) -= 3;
@ -562,7 +562,7 @@ efreet_xml_tag_close(char **data, int *size, const char *tag)
return 0; return 0;
} }
static void static void
efreet_xml_comment_skip(char **data, int *size) efreet_xml_comment_skip(char **data, int *size)
{ {
while (*size > 2) while (*size > 2)

View File

@ -6,18 +6,18 @@
* @internal * @internal
* @file efreet_xml.h * @file efreet_xml.h
* @brief A simple and fast XML parser * @brief A simple and fast XML parser
* @addtogroup Efreet_Xml Efreet_Xml: An XML parser * @addtogroup Efreet_Xml Efreet_Xml: An XML parser
* *
* @{ * @{
*/ */
/** /**
* Efreet_Xml_Attributes * Efreet_Xml_Attributes
*/ */
typedef struct Efreet_Xml_Attribute Efreet_Xml_Attribute; typedef struct Efreet_Xml_Attribute Efreet_Xml_Attribute;
/** /**
* Efreet_Xml_Attributes * Efreet_Xml_Attributes
* @brief Contains information about a given XML attribute * @brief Contains information about a given XML attribute
*/ */
struct Efreet_Xml_Attribute struct Efreet_Xml_Attribute
@ -32,7 +32,7 @@ struct Efreet_Xml_Attribute
typedef struct Efreet_Xml Efreet_Xml; typedef struct Efreet_Xml Efreet_Xml;
/** /**
* Efreet_Xml * Efreet_Xml
* @brief Contains the XML tree for a given XML document * @brief Contains the XML tree for a given XML document
*/ */
struct Efreet_Xml struct Efreet_Xml
@ -58,4 +58,3 @@ const char *efreet_xml_attribute_get(Efreet_Xml *xml, const char *key);
*/ */
#endif #endif