From: Steve Brokenshire Date: Fri, 11 Mar 2016 17:02:28 +0000 (+0000) Subject: Added comments to describe functions in common/preferences.cpp X-Git-Tag: release-0.11~148 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=73418d4e12f279e021976f4d26c8234ec8e7cba6;p=xestiaab%2F.git Added comments to describe functions in common/preferences.cpp --- diff --git a/source/common/preferences.cpp b/source/common/preferences.cpp index 151d194..0a739e5 100644 --- a/source/common/preferences.cpp +++ b/source/common/preferences.cpp @@ -31,6 +31,9 @@ void LoadPreferences(); XABPreferences::XABPreferences(wxString PreferencesFilename){ + // Load the settings into the XABPreferences object using the + // settings file received in PreferencesFilename. + wxString fullprefpath; bool accountnamevalid, accountaddressvalid, accounttypevalid, accountportvalid, @@ -226,6 +229,8 @@ XABPreferences::~XABPreferences(){ bool XABPreferences::GetBoolData(wxString SettingName){ + // GetBoolData from the XABPreferences object. + if (SettingName == wxT("SaveWindowPosition")) { return SaveWindowPos; } else if (SettingName == wxT("HideLocalAddressBooks")) { return HideLocalABs; } @@ -235,12 +240,16 @@ bool XABPreferences::GetBoolData(wxString SettingName){ wxRect XABPreferences::GetMainWindowData(){ + // Return the main window data as a wxRect object. + return MainWindowData; } void XABPreferences::SetMainWindowData(wxRect WindowData){ + // Set the main window data from a wxRect object. + MainWindowData = WindowData; } @@ -248,7 +257,11 @@ void XABPreferences::SetMainWindowData(wxRect WindowData){ // XABPrefAccounts XABPrefAccounts::XABPrefAccounts(){ + + // Setup the default values for XABPrefAccounts. + AccountsCount = 0; + } int XABPrefAccounts::AddAccount(wxString NewAccName, @@ -263,6 +276,9 @@ int XABPrefAccounts::AddAccount(wxString NewAccName, long NewAccRefresh ){ + // Add an account to the list of accounts in the + // XABPrefAccounts object. + AccountName.Add(NewAccName, 1); AccountType.Add(NewAccType, 1); AccountAddress.Add(NewAccAddress, 1); @@ -282,12 +298,16 @@ int XABPrefAccounts::AddAccount(wxString NewAccName, int XABPrefAccounts::GetCount(){ + // Get the count of accounts in the XABPrefAccounts object. + return AccountsCount; } wxString XABPrefAccounts::GetAccountName(int AccountNum){ + // Get the account name. + if (AccountNum > AccountsCount){ return wxT(""); } @@ -298,6 +318,8 @@ wxString XABPrefAccounts::GetAccountName(int AccountNum){ wxString XABPrefAccounts::GetAccountType(int AccountNum){ + // Get the account type. + if (AccountNum > AccountsCount){ return wxT(""); } @@ -308,6 +330,8 @@ wxString XABPrefAccounts::GetAccountType(int AccountNum){ wxString XABPrefAccounts::GetAccountAddress(int AccountNum){ + // Get the account server address. + if (AccountNum > AccountsCount){ return wxT(""); } @@ -318,6 +342,8 @@ wxString XABPrefAccounts::GetAccountAddress(int AccountNum){ int XABPrefAccounts::GetAccountPort(int AccountNum){ + // Get the account server port. + if (AccountNum > AccountsCount){ return 0; } @@ -328,6 +354,8 @@ int XABPrefAccounts::GetAccountPort(int AccountNum){ bool XABPrefAccounts::GetAccountSSL(int AccountNum){ + // Get the account server SSL support. + if (AccountNum > AccountsCount){ return wxT(""); } @@ -338,6 +366,8 @@ bool XABPrefAccounts::GetAccountSSL(int AccountNum){ wxString XABPrefAccounts::GetAccountUsername(int AccountNum){ + // Get the account username. + if (AccountNum > AccountsCount){ return wxT(""); } @@ -348,6 +378,8 @@ wxString XABPrefAccounts::GetAccountUsername(int AccountNum){ wxString XABPrefAccounts::GetAccountPassword(int AccountNum){ + // Get the account password. + if (AccountNum > AccountsCount){ return wxT(""); } @@ -358,6 +390,8 @@ wxString XABPrefAccounts::GetAccountPassword(int AccountNum){ wxString XABPrefAccounts::GetAccountDirectory(int AccountNum){ + // Get the account directory. + if (AccountNum > AccountsCount){ return wxT(""); } @@ -368,6 +402,8 @@ wxString XABPrefAccounts::GetAccountDirectory(int AccountNum){ wxString XABPrefAccounts::GetAccountDirPrefix(int AccountNum){ + // Get the account server directory prefix. + if (AccountNum > AccountsCount){ return wxT(""); } @@ -378,6 +414,8 @@ wxString XABPrefAccounts::GetAccountDirPrefix(int AccountNum){ long XABPrefAccounts::GetAccountRefresh(int AccountNum){ + // Get the account refresh time. + if (AccountNum > AccountsCount){ return 0; }