Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Fixed code for checking if a CalDAVConnectionData object is valid.
[xestiacalendar/.git] / source / objects / CalDAV / CalDAV.cpp
1 // CalDAV.cpp - CalDAV Connection Object.
2 //
3 // (c) 2016 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
6 //
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
10 //
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
19 #include "CalDAV.h"
21 bool CalDAVObjectValidSettings(CalDAVConnectionData *ConnData){
23         // Check if the passed CalDAV Connection Data is has
24         // an address set. Return false if nullptr is used.
26         if (ConnData == nullptr){
27         
28                 return false;
29         
30         }
31         
32         // Check the server hostname. Return false
33         // if no value has been set.
34         
35         if (ConnData->Hostname.size() == 0){
36         
37                 return false;
38         
39         }
40         
41         // Check the server port. Return false if
42         // no value has been set or the port number
43         // is less than 1 or higher than 65535.
44         
45         if (ConnData->Port < 1 || ConnData->Port > 65535){
46         
47                 return false;
48         
49         }
50         
51         // Check the server username. Return false
52         // if no value has been set.
53         
54         if (ConnData->Username.size() == 0){
55                 
56                 return false;
57                 
58         }       
59         
60         // Check the server password. Return false
61         // if no value has been set.
62         
63         if (ConnData->Password.size() == 0){
64                 
65                 return false;
66                 
67         }
69         // Cannot check UseSSL: It is either true
70         // or false.
71         
72         // Cannot check Prefix: The prefix may need
73         // to be worked out first.
75         // No errors were found whilst checking so
76         // return true.
77         
78         return true;
80 }
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