From 91f9751a859fa66958f0a492c0ef4baa124f9f60 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Fri, 8 May 2015 04:12:12 +0200 Subject: [PATCH] [BUG_FIXED] Fix Setting on cloud for Google drive unrecognized regression. --- PowerEditor/src/Parameters.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index ad88aeec9..5778fbb4e 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -1029,15 +1029,25 @@ generic_string NppParameters::getCloudSettingsPath(CloudChoice cloudChoice) int valType; ::RegQueryValueEx(hGoogleDriveKey, TEXT("Path"), NULL, (LPDWORD)&valType, (LPBYTE)valData, (LPDWORD)&valDataLen); - if (::PathFileExists(valData)) + if (::PathFileExists(valData)) // Windows 8 { googleDriveInfoDB = valData; + PathAppend(googleDriveInfoDB, TEXT("\\user_default\\sync_config.db")); + } + else // Windows 7 + { + // try to guess google drive info path + ITEMIDLIST *pidl2; + SHGetSpecialFolderLocation(NULL, CSIDL_LOCAL_APPDATA, &pidl2); + TCHAR tmp2[MAX_PATH]; + SHGetPathFromIDList(pidl2, tmp2); + googleDriveInfoDB = tmp2; + + PathAppend(googleDriveInfoDB, TEXT("Google\\Drive\\sync_config.db")); } ::RegCloseKey(hGoogleDriveKey); } - PathAppend(googleDriveInfoDB, TEXT("\\user_default\\sync_config.db")); - generic_string settingsPath4GoogleDrive = TEXT(""); if (::PathFileExists(googleDriveInfoDB.c_str()))