This commit is contained in:
Don HO 2015-05-08 12:53:51 +02:00
commit b02adce942

View File

@ -1028,15 +1028,25 @@ generic_string NppParameters::getCloudSettingsPath(CloudChoice cloudChoice)
int valType; int valType;
::RegQueryValueEx(hGoogleDriveKey, TEXT("Path"), NULL, (LPDWORD)&valType, (LPBYTE)valData, (LPDWORD)&valDataLen); ::RegQueryValueEx(hGoogleDriveKey, TEXT("Path"), NULL, (LPDWORD)&valType, (LPBYTE)valData, (LPDWORD)&valDataLen);
if (::PathFileExists(valData)) if (::PathFileExists(valData)) // Windows 8
{ {
googleDriveInfoDB = valData; 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); ::RegCloseKey(hGoogleDriveKey);
} }
PathAppend(googleDriveInfoDB, TEXT("\\user_default\\sync_config.db"));
generic_string settingsPath4GoogleDrive = TEXT(""); generic_string settingsPath4GoogleDrive = TEXT("");
if (::PathFileExists(googleDriveInfoDB.c_str())) if (::PathFileExists(googleDriveInfoDB.c_str()))