Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added copyright and license header to the C++ files and headers in the top source...
[xestiaab/.git] / source / frmNewAccount.cpp
index 55acf26..e320223 100644 (file)
@@ -1,3 +1,21 @@
+// frmNewAccount.cpp - New Account form.
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
+
 #include "frmNewAccount.h"
 #include <thread>
 #include <cstdlib>
@@ -338,6 +356,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 +369,8 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event )
 #elif defined(__WIN32__)
         
         XestiaABPrefDirectory = GetUserPrefDir();
-        
+        XestiaABDirectory = GetUserDir();
+       
         AccountSettingsFile = XestiaABPrefDirectory + wxT("accounts");
         
         // Open the file for writing.
@@ -385,7 +405,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 +428,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 +454,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 +491,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 +514,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