summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-10-30 23:33:34 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-10-30 23:33:34 +0300
commitf375e4f961eb52fa504c17e7825e832829310e8a (patch)
tree3dd7498fe7ccd918a5f36c8e480514965e1dabf7 /main.cpp
parentb8cfe44100dbfbf6ca1dd204356cad622dcd073d (diff)
modified: main.cpp
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index 34bb175..ab3739d 100644
--- a/main.cpp
+++ b/main.cpp
@@ -732,7 +732,17 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
MessageBox(0, _T("please set keyring's home directory"), _T("Warning"), MB_OK);
break;
}
- DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", tmp);
+ DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", tmp);
+ {
+ TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
+ DWORD dwFileAttr = GetFileAttributes(path);
+ if (dwFileAttr != INVALID_FILE_ATTRIBUTES)
+ {
+ dwFileAttr &=~ FILE_ATTRIBUTE_READONLY;
+ SetFileAttributes(path, dwFileAttr);
+ }
+ mir_free(path);
+ }
DestroyWindow(hwndDlg);
ShowFirstRunDialog();
break;
@@ -1530,6 +1540,16 @@ void InitCheck()
if(MessageBoxA(0, question.c_str(), "Own secret key warning", MB_YESNO) == IDYES)
ShowFirstRunDialog();
}
+ {
+ TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
+ DWORD dwFileAttr = GetFileAttributes(path);
+ if (dwFileAttr != INVALID_FILE_ATTRIBUTES)
+ {
+ dwFileAttr &=~ FILE_ATTRIBUTE_READONLY;
+ SetFileAttributes(path, dwFileAttr);
+ }
+ mir_free(path);
+ }
extern bool bAutoExchange;
if(bAutoExchange && (ServiceExists("ICQ"PS_ICQ_ADDCAPABILITY))) //work only for one icq instance
{