summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2009-01-21 16:18:39 +0000
committerTor Lillqvist <tml@src.gnome.org>2009-01-21 16:18:39 +0000
commit98d2cdd9e64f43ee05b4368aa7479a85a58668e9 (patch)
treeb5eac4c824bfb2caebc70d03eccba29d2817e2a4
parenta9c978a354d236a2cb6eb55ae8ff3dbd2c797960 (diff)
Drop the code in the else branch of #if GLIB_CHECK_VERSION (2, 19, 0).
2009-01-21 Tor Lillqvist <tml@novell.com> * glib/gwin32.c (g_win32_locale_filename_from_utf8): Drop the code in the else branch of #if GLIB_CHECK_VERSION (2, 19, 0). Drop unused variables. svn path=/trunk/; revision=7826
-rw-r--r--ChangeLog6
-rw-r--r--glib/gwin32.c64
2 files changed, 6 insertions, 64 deletions
diff --git a/ChangeLog b/ChangeLog
index bec2a1c60..baa322cc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-21 Tor Lillqvist <tml@novell.com>
+
+ * glib/gwin32.c (g_win32_locale_filename_from_utf8): Drop the code
+ in the else branch of #if GLIB_CHECK_VERSION (2, 19, 0). Drop
+ unused variables.
+
2009-01-20 Matthias Clasen <mclasen@redhat.com>
Bug 568294 – A wrong reference in the description of
diff --git a/glib/gwin32.c b/glib/gwin32.c
index d722a874a..c2ced69d4 100644
--- a/glib/gwin32.c
+++ b/glib/gwin32.c
@@ -380,75 +380,11 @@ get_package_directory_from_module (const gchar *module_name)
g_win32_get_package_installation_directory_utf8 (const gchar *package,
const gchar *dll_name)
{
- static GHashTable *package_dirs = NULL;
- G_LOCK_DEFINE_STATIC (package_dirs);
gchar *result = NULL;
- gchar *key;
- wchar_t *wc_key;
- HKEY reg_key = NULL;
- DWORD type;
- DWORD nbytes;
-#if GLIB_CHECK_VERSION (2, 19, 0)
if (package != NULL)
g_warning ("Passing a non-NULL package to g_win32_get_package_installation_directory() is deprecated and it is ignored.");
-#else
- if (package != NULL)
- {
- g_warning ("Passing a non-NULL package to g_win32_get_package_installation_directory() is deprecated and will not work in GLib after 2.18.");
-
- G_LOCK (package_dirs);
-
- if (package_dirs == NULL)
- package_dirs = g_hash_table_new (g_str_hash, g_str_equal);
-
- result = g_hash_table_lookup (package_dirs, package);
-
- if (result && result[0])
- {
- G_UNLOCK (package_dirs);
- return g_strdup (result);
- }
-
- key = g_strconcat ("Software\\", package, NULL);
-
- nbytes = 0;
-
- wc_key = g_utf8_to_utf16 (key, -1, NULL, NULL, NULL);
- if (((RegOpenKeyExW (HKEY_CURRENT_USER, wc_key, 0,
- KEY_QUERY_VALUE, &reg_key) == ERROR_SUCCESS
- && RegQueryValueExW (reg_key, L"InstallationDirectory", 0,
- &type, NULL, &nbytes) == ERROR_SUCCESS)
- ||
- (RegOpenKeyExW (HKEY_LOCAL_MACHINE, wc_key, 0,
- KEY_QUERY_VALUE, &reg_key) == ERROR_SUCCESS
- && RegQueryValueExW (reg_key, L"InstallationDirectory", 0,
- &type, NULL, &nbytes) == ERROR_SUCCESS))
- && type == REG_SZ)
- {
- wchar_t *wc_temp = g_new (wchar_t, (nbytes+1)/2 + 1);
- RegQueryValueExW (reg_key, L"InstallationDirectory", 0,
- &type, (LPBYTE) wc_temp, &nbytes);
- wc_temp[nbytes/2] = '\0';
- result = g_utf16_to_utf8 (wc_temp, -1, NULL, NULL, NULL);
- g_free (wc_temp);
- }
- g_free (wc_key);
-
- if (reg_key != NULL)
- RegCloseKey (reg_key);
-
- g_free (key);
- if (result)
- {
- g_hash_table_insert (package_dirs, g_strdup (package), result);
- G_UNLOCK (package_dirs);
- return g_strdup (result);
- }
- G_UNLOCK (package_dirs);
- }
-#endif
if (dll_name != NULL)
result = get_package_directory_from_module (dll_name);