Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Fixed new account creation for Win32 using GetUserPrefDir and GetUserDir properly.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 26 Oct 2015 23:51:18 +0000 (23:51 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 26 Oct 2015 23:51:18 +0000 (23:51 +0000)
source/frmNewAccount.cpp

index 55acf26..a28eefd 100644 (file)
@@ -338,6 +338,7 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event )
         // Finished.
         
         wxString XestiaABPrefDirectory;
+       wxString XestiaABDirectory;
         wxString AccountSettingsFile;
         //wxFile ASFile;
         wxString RandomNumberSuffix = wxString::Format(wxT("%i"), rand() % 32767);
@@ -350,7 +351,8 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event )
 #elif defined(__WIN32__)
         
         XestiaABPrefDirectory = GetUserPrefDir();
-        
+        XestiaABDirectory = GetUserDir();
+       
         AccountSettingsFile = XestiaABPrefDirectory + wxT("accounts");
         
         // Open the file for writing.
@@ -385,7 +387,7 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event )
             
             wxString DirectoryName = txtAccountName->GetValue().Mid(0, 30) + RandomNumberSuffix;
             
-            if (wxMkdir(XestiaABPrefDirectory + wxT("/accounts/") + DirectoryName + wxT(".carddav"), 0740) == TRUE){
+            if (wxMkdir(XestiaABDirectory + wxT("\\accounts\\") + DirectoryName + wxT(".carddav"), 0740) == TRUE){
                 
                 DirectoryCreated = TRUE;
                 
@@ -408,7 +410,7 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event )
             
             wxString DirectoryName = txtAccountName->GetValue().Mid(0, 30) + RandomNumberSuffix;
             
-            if (wxMkdir(XestiaABPrefDirectory + wxT("/accounts/") + DirectoryName + wxT(".local"), 0740) == TRUE){
+            if (wxMkdir(XestiaABDirectory + wxT("\\accounts\\") + DirectoryName + wxT(".local"), 0740) == TRUE){
                 
                 DirectoryCreated = TRUE;
                 
@@ -434,9 +436,10 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event )
         
 #else
         
-        XestiaABPrefDirectory = GetUserDir();
+        XestiaABPrefDirectory = GetUserPrefDir();
+       XestiaABDirectory = GetUserDir();
         
-        AccountSettingsFile = GetUserPrefDir() + wxT("accounts");
+        AccountSettingsFile = XestiaABPrefDirectory + wxT("accounts");
         
         // Open the file for writing.
         
@@ -470,7 +473,7 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event )
             
             wxString DirectoryName = txtAccountName->GetValue().Mid(0, 30) + RandomNumberSuffix;
             
-            if (wxMkdir(XestiaABPrefDirectory + wxT("/accounts/") + DirectoryName + wxT(".carddav"), 0740) == TRUE){
+            if (wxMkdir(XestiaABDirectory + wxT("/accounts/") + DirectoryName + wxT(".carddav"), 0740) == TRUE){
                 
                 DirectoryCreated = TRUE;
                 
@@ -493,7 +496,7 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event )
             
             wxString DirectoryName = txtAccountName->GetValue().Mid(0, 30) + RandomNumberSuffix;
             
-            if (wxMkdir(XestiaABPrefDirectory + wxT("/accounts/") + DirectoryName + wxT(".local"), 0740) == TRUE){
+            if (wxMkdir(XestiaABDirectory + wxT("/accounts/") + DirectoryName + wxT(".local"), 0740) == TRUE){
                 
                 DirectoryCreated = TRUE;
                 
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy