[planner] Get rid of deprecated g_win32_get_package_installation_subdirectory (fixes #613623)



commit 896c594e63155a11f7e195e6e8274c134d22bcc2
Author: Alexandre Franke <alexandre franke gmail com>
Date:   Sun Oct 17 20:53:53 2010 +0200

    Get rid of deprecated g_win32_get_package_installation_subdirectory (fixes #613623)

 libplanner/mrp-paths-win32.c |   50 +++++++++++++++++++++++++++++++++--------
 src/planner-main.c           |    5 +++-
 2 files changed, 44 insertions(+), 11 deletions(-)
---
diff --git a/libplanner/mrp-paths-win32.c b/libplanner/mrp-paths-win32.c
index fb039ca..a16e5d2 100644
--- a/libplanner/mrp-paths-win32.c
+++ b/libplanner/mrp-paths-win32.c
@@ -51,7 +51,10 @@ gchar *
 mrp_paths_get_glade_dir (const gchar *filename)
 {
 	if (!glade_dir) {
-		glade_dir = g_win32_get_package_installation_subdirectory (NULL, NULL, GLADEDIR);
+		gchar *module_dir;
+		module_dir = g_win32_get_package_installation_directory_of_module (NULL);
+		glade_dir = g_build_filename (module_dir, GLADEDIR);
+		g_free (module_dir);
 	}
 
 	return g_build_filename (glade_dir, filename, NULL);
@@ -61,7 +64,10 @@ gchar *
 mrp_paths_get_image_dir (const gchar *filename)
 {
 	if (!image_dir) {
-		image_dir = g_win32_get_package_installation_subdirectory (NULL, NULL, IMAGEDIR);
+		gchar *module_dir;
+		module_dir = g_win32_get_package_installation_directory_of_module (NULL);
+		image_dir = g_build_filename (module_dir, IMAGEDIR);
+		g_free (module_dir);
 	}
 
 	return g_build_filename (image_dir, filename, NULL);
@@ -71,7 +77,10 @@ gchar *
 mrp_paths_get_plugin_dir (const gchar *filename)
 {
 	if (!plugin_dir) {
-		plugin_dir = g_win32_get_package_installation_subdirectory (NULL, NULL, PLUGINDIR);
+		gchar *module_dir;
+		module_dir = g_win32_get_package_installation_directory_of_module (NULL);
+		plugin_dir = g_build_filename (module_dir, PLUGINDIR);
+		g_free (module_dir);
 	}
 
 	return g_build_filename (plugin_dir, filename, NULL);
@@ -81,7 +90,10 @@ gchar *
 mrp_paths_get_dtd_dir (const gchar *filename)
 {
 	if (!dtd_dir) {
-		dtd_dir = g_win32_get_package_installation_subdirectory (NULL, NULL, DTDDIR);
+		gchar *module_dir;
+		module_dir = g_win32_get_package_installation_directory_of_module (NULL);
+		dtd_dir = g_build_filename (module_dir, DTDDIR);
+		g_free (module_dir);
 	}
 
 	return g_build_filename (dtd_dir, filename, NULL);
@@ -91,7 +103,10 @@ gchar *
 mrp_paths_get_stylesheet_dir (const gchar *filename)
 {
 	if (!stylesheet_dir) {
-		stylesheet_dir = g_win32_get_package_installation_subdirectory (NULL, NULL, STYLESHEETDIR);
+		gchar *module_dir;
+		module_dir = g_win32_get_package_installation_directory_of_module (NULL);
+		stylesheet_dir = g_build_filename (module_dir, STYLESHEETDIR);
+		g_free (module_dir);
 	}
 
 	return g_build_filename (stylesheet_dir, filename, NULL);
@@ -101,7 +116,10 @@ gchar *
 mrp_paths_get_ui_dir (const gchar *filename)
 {
 	if (!ui_dir) {
-		ui_dir = g_win32_get_package_installation_subdirectory (NULL, NULL, UIDIR);
+		gchar *module_dir;
+		module_dir = g_win32_get_package_installation_directory_of_module (NULL);
+		ui_dir = g_build_filename (module_dir, UIDIR);
+		g_free (module_dir);
 	}
 
 	return g_build_filename (ui_dir, filename, NULL);
@@ -111,7 +129,10 @@ gchar *
 mrp_paths_get_storagemodule_dir (const gchar *filename)
 {
 	if (!storagemodule_dir) {
-		storagemodule_dir = g_win32_get_package_installation_subdirectory (NULL, NULL, STORAGEMODULEDIR);
+		gchar *module_dir;
+		module_dir = g_win32_get_package_installation_directory_of_module (NULL);
+		storagemodule_dir = g_build_filename (module_dir, STORAGEMODULEDIR);
+		g_free (module_dir);
 	}
 
 	return g_build_filename (storagemodule_dir, filename, NULL);
@@ -121,7 +142,10 @@ gchar *
 mrp_paths_get_file_modules_dir (const gchar *filename)
 {
 	if (!file_modules_dir) {
-		file_modules_dir = g_win32_get_package_installation_subdirectory (NULL, NULL, FILEMODULEDIR);
+		gchar *module_dir;
+		module_dir = g_win32_get_package_installation_directory_of_module (NULL);
+		file_modules_dir = g_build_filename (module_dir, FILEMODULEDIR);
+		g_free (module_dir);
 	}
 
 	return g_build_filename (file_modules_dir, filename, NULL);
@@ -131,7 +155,10 @@ gchar *
 mrp_paths_get_sql_dir (void)
 {
 	if (!sql_dir) {
-		sql_dir = g_win32_get_package_installation_subdirectory (NULL, NULL, SQLDIR);
+		gchar *module_dir;
+		module_dir = g_win32_get_package_installation_directory_of_module (NULL);
+		sql_dir = g_build_filename (module_dir, SQLDIR);
+		g_free (module_dir);
 	}
 
 	return sql_dir;
@@ -141,7 +168,10 @@ gchar *
 mrp_paths_get_locale_dir (void)
 {
 	if (!locale_dir) {
-		locale_dir = g_win32_get_package_installation_subdirectory (NULL, NULL, GNOMELOCALEDIR);
+		gchar *module_dir;
+		module_dir = g_win32_get_package_installation_directory_of_module (NULL);
+		locale_dir = g_build_filename (module_dir, GNOMELOCALEDIR);
+		g_free (module_dir);
 	}
 
 	return locale_dir;
diff --git a/src/planner-main.c b/src/planner-main.c
index 4bf07f2..14c1f7c 100644
--- a/src/planner-main.c
+++ b/src/planner-main.c
@@ -75,7 +75,10 @@ main (int argc, char **argv)
 	g_free (filename);
 
 #ifdef WIN32
-	filename = g_win32_get_package_installation_subdirectory (NULL, NULL, "share/icons");
+	gchar *module_dir;
+	module_dir = g_win32_get_package_installation_directory_of_module (NULL);
+	filename = g_build_filename (module_dir, "share/icons");
+	g_free (module_dir);
 	gtk_icon_theme_append_search_path (gtk_icon_theme_get_default(),
 					   filename);
 	g_free (filename);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]