pidgin.next.minor: 5247eb71: No need to access SHGetFolderPath() indi...

datallah at pidgin.im datallah at pidgin.im
Sat Oct 31 16:06:46 EDT 2009


-----------------------------------------------------------------
Revision: 5247eb71da299226e92373855e0a4afe762e052f
Ancestor: 59e1045386913cff7780ff1f741af25ad817c71e
Author: datallah at pidgin.im
Date: 2009-10-31T20:03:26
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/5247eb71da299226e92373855e0a4afe762e052f

Modified files:
        libpurple/win32/win32dep.c
        pidgin/win32/nsis/pidgin-installer.nsi

ChangeLog: 

No need to access SHGetFolderPath() indirectly any more with required versions of Windows.

-------------- next part --------------
============================================================
--- libpurple/win32/win32dep.c	011da107935da2cdb6aa037fb962892bed2f0839
+++ libpurple/win32/win32dep.c	2fde234ebfc481bc45ac00bd79a2015feaba541f
@@ -30,14 +30,6 @@
 #include "notify.h"
 
 /*
- *  DEFINES & MACROS
- */
-
-/* For shfolder.dll */
-typedef HRESULT (CALLBACK* LPFNSHGETFOLDERPATHA)(HWND, int, HANDLE, DWORD, LPSTR);
-typedef HRESULT (CALLBACK* LPFNSHGETFOLDERPATHW)(HWND, int, HANDLE, DWORD, LPWSTR);
-
-/*
  * LOCALS
  */
 static char *app_data_dir = NULL, *install_dir = NULL,
@@ -115,23 +107,14 @@ gchar *wpurple_get_special_folder(int fo
 
 /* Get paths to special Windows folders. */
 gchar *wpurple_get_special_folder(int folder_type) {
-	static LPFNSHGETFOLDERPATHW MySHGetFolderPathW = NULL;
 	gchar *retval = NULL;
+	wchar_t utf_16_dir[MAX_PATH + 1];
 
-	if (!MySHGetFolderPathW) {
-		MySHGetFolderPathW = (LPFNSHGETFOLDERPATHW)
-			wpurple_find_and_loadproc("shfolder.dll", "SHGetFolderPathW");
+	if (SUCCEEDED(SHGetFolderPathW(NULL, folder_type, NULL,
+					SHGFP_TYPE_CURRENT, utf_16_dir))) {
+		retval = g_utf16_to_utf8(utf_16_dir, -1, NULL, NULL, NULL);
 	}
 
-	if (MySHGetFolderPathW) {
-		wchar_t utf_16_dir[MAX_PATH + 1];
-
-		if (SUCCEEDED(MySHGetFolderPathW(NULL, folder_type, NULL,
-						SHGFP_TYPE_CURRENT, utf_16_dir))) {
-			retval = g_utf16_to_utf8(utf_16_dir, -1, NULL, NULL, NULL);
-		}
-	}
-
 	return retval;
 }
 
============================================================
--- pidgin/win32/nsis/pidgin-installer.nsi	db7c177c4249f8ffc9fc9ec565875083535ea895
+++ pidgin/win32/nsis/pidgin-installer.nsi	22d610d8f4b3120ee1cd871ed0f30dbc8f165fdd
@@ -480,14 +480,6 @@ Section $(PIDGIN_SECTION_TITLE) SecPidgi
     File "${PIDGIN_INSTALLER_DEPS}\exchndl.dll"
     !endif
 
-    ; Install shfolder.dll if need be..
-    SearchPath $R4 "shfolder.dll"
-    StrCmp $R4 "" 0 got_shfolder
-      SetOutPath "$SYSDIR"
-      File "${PIDGIN_INSTALLER_DEPS}\shfolder.dll"
-      SetOutPath "$INSTDIR"
-    got_shfolder:
-
     ; Check if Perl is installed, if so add it to the AppPaths
     ReadRegStr $R2 HKLM ${PERL_REG_KEY} ""
     StrCmp $R2 "" 0 perl_exists


More information about the Commits mailing list