[maemo-commits] [maemo-commits] r12276 - in projects/haf/trunk/hildon-desktop: . data libhildondesktop src
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Wed Jun 13 16:42:09 EEST 2007
- Previous message: [maemo-commits] r12275 - projects/haf/trunk/hildon-fm/hildon-fm
- Next message: [maemo-commits] r12277 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: lucasr Date: 2007-06-13 16:42:06 +0300 (Wed, 13 Jun 2007) New Revision: 12276 Modified: projects/haf/trunk/hildon-desktop/ChangeLog projects/haf/trunk/hildon-desktop/configure.ac projects/haf/trunk/hildon-desktop/data/Makefile.am projects/haf/trunk/hildon-desktop/libhildondesktop/Makefile.am projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.c projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.h projects/haf/trunk/hildon-desktop/src/Makefile.am projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c projects/haf/trunk/hildon-desktop/src/hn-others-button.c Log: 2007-06-13 Lucas Rocha <lucas.rocha at nokia.com> * src/hd-applications-menu.c, src/hn-others-button.c, src/Makefile.am, libhildondesktop/libhildonmenu.[ch], libhildondesktop/Makefile.am, data/Makefile.am, configure.ac: do not hardcode the absolute path of the menu definition file in libhildonmenu. Modified: projects/haf/trunk/hildon-desktop/ChangeLog =================================================================== --- projects/haf/trunk/hildon-desktop/ChangeLog 2007-06-13 13:08:22 UTC (rev 12275) +++ projects/haf/trunk/hildon-desktop/ChangeLog 2007-06-13 13:42:06 UTC (rev 12276) @@ -1,5 +1,12 @@ 2007-06-13 Lucas Rocha <lucas.rocha at nokia.com> + * src/hd-applications-menu.c, src/hn-others-button.c, src/Makefile.am, + libhildondesktop/libhildonmenu.[ch], libhildondesktop/Makefile.am, + data/Makefile.am, configure.ac: do not hardcode the absolute path of + the menu definition file in libhildonmenu. + +2007-06-13 Lucas Rocha <lucas.rocha at nokia.com> + * src/hn-others-button.c, src/hd-applications-menu.c: always copy the system-wide menu definition to user directory to make sure restore work. Fixes bug NB#42202. Modified: projects/haf/trunk/hildon-desktop/configure.ac =================================================================== --- projects/haf/trunk/hildon-desktop/configure.ac 2007-06-13 13:08:22 UTC (rev 12275) +++ projects/haf/trunk/hildon-desktop/configure.ac 2007-06-13 13:42:06 UTC (rev 12276) @@ -190,8 +190,6 @@ [Whether libxcomposite is present on the system]) fi - - PKG_CHECK_MODULES(XLIBS, x11) AC_SUBST(XLIBS_CFLAGS) AC_SUBST(XLIBS_ERROR_LIBS) @@ -243,6 +241,9 @@ hildondesktopstartupdir=${sysconfdir}/osso-af-init AC_SUBST(hildondesktopstartupdir) +hildondesktopmenudir=${sysconfdir}/xdg/menus +AC_SUBST(hildondesktopmenudir) + #++++++++++++++++++++ # Background Manager #++++++++++++++++++++ Modified: projects/haf/trunk/hildon-desktop/data/Makefile.am =================================================================== --- projects/haf/trunk/hildon-desktop/data/Makefile.am 2007-06-13 13:08:22 UTC (rev 12275) +++ projects/haf/trunk/hildon-desktop/data/Makefile.am 2007-06-13 13:42:06 UTC (rev 12276) @@ -11,8 +11,7 @@ applications-menu.desktop \ switcher-menu.desktop -applications_menudir = $(sysconfdir)/xdg/menus -applications_menu_DATA = applications.menu +hildondesktopmenu_DATA = applications.menu hildondesktopstartup_SCRIPTS = \ hildon-desktop.sh Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/Makefile.am =================================================================== --- projects/haf/trunk/hildon-desktop/libhildondesktop/Makefile.am 2007-06-13 13:08:22 UTC (rev 12275) +++ projects/haf/trunk/hildon-desktop/libhildondesktop/Makefile.am 2007-06-13 13:42:06 UTC (rev 12276) @@ -46,6 +46,7 @@ $(XCOMPOSITE_CFLAGS) \ $(XDAMAGE_CFLAGS) \ -DLOCALEDIR=\"$(localedir)\" \ + -DHILDON_DESKTOP_MENU_DIR=\"$(hildondesktopmenudir)\" \ -DHILDON_HOME_DESKTOP_ENTRY_DIR=\"$(hildonhomedesktopentrydir)\" \ -I$(top_srcdir)/libhildonwm Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.c =================================================================== --- projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.c 2007-06-13 13:08:22 UTC (rev 12275) +++ projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.c 2007-06-13 13:42:06 UTC (rev 12276) @@ -1025,7 +1025,7 @@ user_home_dir = getenv( "HOME" ); /* Build the user menu filename */ - user_menu_conf_file = g_build_filename( user_home_dir, USER_MENU_FILE, NULL ); + user_menu_conf_file = g_build_filename( user_home_dir, USER_MENU_DIR, MENU_FILE, NULL); /* If the user has her own menu file.. */ if ( g_file_test( user_menu_conf_file, G_FILE_TEST_EXISTS ) ) { @@ -1037,7 +1037,7 @@ NULL, NULL, &content_iter, desktop_files); } else { /* Use the system-wide menu file */ - read_menu_conf(SYSTEMWIDE_MENU_FILE, contents, + read_menu_conf(HILDON_DESKTOP_MENU_DIR "/" MENU_FILE, contents, NULL, NULL, &content_iter, desktop_files); } @@ -1625,7 +1625,7 @@ user_home_dir = getenv( "HOME" ); user_menu_conf_file = g_build_filename( - user_home_dir, USER_MENU_FILE, NULL ); + user_home_dir, USER_MENU_DIR, MENU_FILE, NULL ); /* Make sure we have the directory for user's menu file */ user_menu_dir = g_path_get_dirname( user_menu_conf_file ); Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.h =================================================================== --- projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.h 2007-06-13 13:08:22 UTC (rev 12275) +++ projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.h 2007-06-13 13:42:06 UTC (rev 12276) @@ -60,12 +60,10 @@ #define FAVOURITES_LOGICAL_STRING "tncpa_li_of_favourites" #define FAVOURITES_NAME dgettext("osso-applet-tasknavigator", FAVOURITES_LOGICAL_STRING) -/* Default systemwide menu */ -#define SYSTEMWIDE_MENU_FILE "/etc/xdg/menus/applications.menu" - /* User specific menu. $HOME is prepended to this! */ -#define USER_MENU_FILE ".osso/menus/applications.menu" +#define USER_MENU_DIR ".osso/menus" +#define MENU_FILE "applications.menu" /* TreeModel items */ enum { Modified: projects/haf/trunk/hildon-desktop/src/Makefile.am =================================================================== --- projects/haf/trunk/hildon-desktop/src/Makefile.am 2007-06-13 13:08:22 UTC (rev 12275) +++ projects/haf/trunk/hildon-desktop/src/Makefile.am 2007-06-13 13:42:06 UTC (rev 12276) @@ -24,6 +24,7 @@ -DHD_DESKTOP_ENTRY_PATH=\"$(hildondesktopentrydir)\" \ -DHD_DESKTOP_CONFIG_PATH=\"$(hildondesktopconfdir)\" \ -DHD_DESKTOP_MODULE_PATH=\"$(hildondesktoplibdir)\" \ + -DHD_DESKTOP_MENU_PATH=\"$(hildondesktopmenudir)\" \ -DHD_DESKTOP_BACKGROUNDS_PATH=\"$(hildondesktopbackgroundsdir)\" \ -DHD_PLUGIN_LOADER_MODULES_PATH=\"$(hildonpluginloaderlibdir)\" \ -DHD_UI_POLICY_MODULES_PATH=\"$(hildonuipolicylibdir)\" \ Modified: projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c =================================================================== --- projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c 2007-06-13 13:08:22 UTC (rev 12275) +++ projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c 2007-06-13 13:42:06 UTC (rev 12276) @@ -1061,22 +1061,19 @@ gchar *file = NULL; gchar *conf_file; - conf_file = g_build_filename (g_get_home_dir (), USER_MENU_FILE, NULL); - + conf_file = g_build_filename (g_get_home_dir (), USER_MENU_DIR, MENU_FILE, NULL); + /* We copy SYSTEMWIDE_MENU_FILE to always track the changes */ if (!g_file_test (conf_file, G_FILE_TEST_EXISTS)) - if (g_file_get_contents (SYSTEMWIDE_MENU_FILE, &file, NULL, NULL)) + if (g_file_get_contents (HD_DESKTOP_MENU_PATH "/" MENU_FILE, &file, NULL, NULL)) { g_file_set_contents (conf_file, file, -1, NULL); } g_free (file); - /* Watch systemwide menu conf */ - dir = g_path_get_dirname (SYSTEMWIDE_MENU_FILE); - if (gnome_vfs_monitor_add (&button->priv->system_dir_monitor, - dir, + HD_DESKTOP_MENU_PATH, GNOME_VFS_MONITOR_DIRECTORY, (GnomeVFSMonitorCallback) hd_applications_menu_dir_changed, button) != GNOME_VFS_OK) @@ -1085,8 +1082,6 @@ "failed setting monitor callback " "for systemwide menu conf." ); } - - g_free (dir); /* Have to get the directory from the path because the USER_MENU_FILE define might contain directory (it does, in fact). */ Modified: projects/haf/trunk/hildon-desktop/src/hn-others-button.c =================================================================== --- projects/haf/trunk/hildon-desktop/src/hn-others-button.c 2007-06-13 13:08:22 UTC (rev 12275) +++ projects/haf/trunk/hildon-desktop/src/hn-others-button.c 2007-06-13 13:42:06 UTC (rev 12276) @@ -1018,11 +1018,11 @@ gchar *file = NULL; gchar *conf_file; - conf_file = g_build_filename (g_get_home_dir (), USER_MENU_FILE, NULL); + conf_file = g_build_filename (g_get_home_dir (), USER_MENU_DIR, MENU_FILE, NULL); /* We copy SYSTEMWIDE_MENU_FILE to always track the changes */ if (!g_file_test (conf_file, G_FILE_TEST_EXISTS)) - if (g_file_get_contents (SYSTEMWIDE_MENU_FILE, &file, NULL, NULL)) + if (g_file_get_contents (HD_DESKTOP_MENU_PATH "/" MENU_FILE, &file, NULL, NULL)) { g_file_set_contents (conf_file, file, -1, NULL); } @@ -1030,10 +1030,8 @@ g_free (file); /* Watch systemwide menu conf */ - dir = g_path_get_dirname (SYSTEMWIDE_MENU_FILE); - if (gnome_vfs_monitor_add (&button->priv->system_dir_monitor, - dir, + HD_DESKTOP_MENU_PATH, GNOME_VFS_MONITOR_DIRECTORY, (GnomeVFSMonitorCallback) hn_others_button_dir_changed, button) != GNOME_VFS_OK) @@ -1043,8 +1041,6 @@ "for systemwide menu conf." ); } - g_free (dir); - /* Have to get the directory from the path because the USER_MENU_FILE define might contain directory (it does, in fact). */ dir = g_path_get_dirname (conf_file);
- Previous message: [maemo-commits] r12275 - projects/haf/trunk/hildon-fm/hildon-fm
- Next message: [maemo-commits] r12277 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]