Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Removed unused variables and some code cleanup done on the CardDAV support.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 2 Aug 2015 18:29:34 +0000 (19:29 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 2 Aug 2015 18:29:34 +0000 (19:29 +0100)
source/carddav/carddav.cpp

index 5a07c41..095ab95 100644 (file)
@@ -13,7 +13,6 @@
 size_t WritebackFunc(char *ptr, size_t size, size_t nmemb, wxString *stream){\r
        \r
        wxString Data;\r
-       wxString *PageInput;\r
        Data = wxString::FromUTF8((char *)ptr);\r
        \r
        stream->Append(Data);\r
@@ -496,7 +495,7 @@ void CardDAV::ProcessDataThread(){
        struct UploadDataStruc UploadData;\r
        \r
        \r
-       ActIter = ActivityListPtr->find(ItemIndex);\r
+       ActIter = ActivityListPtr->find((int)ItemIndex);\r
        \r
        // Update result flag.\r
 \r
@@ -768,7 +767,7 @@ void CardDAV::ProcessDataThread(){
                \r
                        fprintf(stderr, "curl_easy_perform() failed: %s\n",\r
                                        curl_easy_strerror(claconncode));\r
-                       long http_code = 0;\r
+                       int http_code = 0;\r
                        curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code);\r
                        fprintf(stderr, "Error code was: %d\n", http_code);\r
                                        \r
@@ -778,7 +777,7 @@ void CardDAV::ProcessDataThread(){
 \r
                        fprintf(stderr, "curl_easy_perform() failed: %s\n",\r
                                        curl_easy_strerror(claconncode));\r
-                       long http_code = 0;\r
+                       int http_code = 0;\r
                        curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code);\r
                        fprintf(stderr, "Error code was: %d\n", http_code);\r
 \r
@@ -1062,7 +1061,7 @@ void CardDAV::GetServerContactData()
        struct UploadDataStruc UploadData;\r
        \r
        \r
-       ActIter = ActivityListPtr->find(ItemIndex);\r
+       ActIter = ActivityListPtr->find((int)ItemIndex);\r
 \r
        //ActIter->second = 1;\r
 \r
@@ -1299,7 +1298,7 @@ void CardDAV::GetServerContactData()
                \r
                        fprintf(stderr, "curl_easy_perform() failed: %s\n",\r
                                        curl_easy_strerror(claconncode));\r
-                       long http_code = 0;\r
+                       int http_code = 0;\r
                        curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code);\r
                        fprintf(stderr, "Error code was: %d\n", http_code);\r
                                        \r
@@ -1309,7 +1308,7 @@ void CardDAV::GetServerContactData()
 \r
                        fprintf(stderr, "curl_easy_perform() failed: %s\n",\r
                                        curl_easy_strerror(claconncode));\r
-                       long http_code = 0;\r
+                       int http_code = 0;\r
                        curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code);\r
                        fprintf(stderr, "Error code was: %d\n", http_code);\r
 \r
@@ -1452,7 +1451,7 @@ void CardDAV::GetServerETagValueThread()
        struct UploadDataStruc UploadData;\r
        \r
        \r
-       ActIter = ActivityListPtr->find(ItemIndex);\r
+       ActIter = ActivityListPtr->find((int)ItemIndex);\r
        \r
        static const char* query =\r
        "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"\r
@@ -1702,7 +1701,7 @@ void CardDAV::GetServerETagValueThread()
                \r
                        fprintf(stderr, "curl_easy_perform() failed: %s\n",\r
                                        curl_easy_strerror(claconncode));\r
-                       long http_code = 0;\r
+                       int http_code = 0;\r
                        curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code);\r
                        fprintf(stderr, "Error code was: %d\n", http_code);\r
                                        \r
@@ -1712,7 +1711,7 @@ void CardDAV::GetServerETagValueThread()
 \r
                        fprintf(stderr, "curl_easy_perform() failed: %s\n",\r
                                        curl_easy_strerror(claconncode));\r
-                       long http_code = 0;\r
+                       int http_code = 0;\r
                        curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code);\r
                        fprintf(stderr, "Error code was: %d\n", http_code);\r
 \r
@@ -1778,7 +1777,7 @@ void CardDAV::GetServerETagValueThread()
        \r
        xmlDocPtr xmlCardDAVDoc;\r
 \r
-       xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), PageData.Len(), "noname.xml", NULL, 0);\r
+       xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), (int)PageData.Len(), "noname.xml", NULL, 0);\r
 \r
        xmlNodePtr nodeLevel1;\r
        xmlNodePtr nodeLevel2;\r
@@ -1892,7 +1891,7 @@ void CardDAV::GetServerETagValueThread()
 \r
                                }\r
 \r
-                               if (HREFFound = TRUE && ETagFound == TRUE){\r
+                               if (HREFFound == TRUE && ETagFound == TRUE){\r
                                \r
                                        // Add to the map data.\r
                                        \r
@@ -1915,7 +1914,6 @@ void CardDAV::GetServerETagValueThread()
        xmlFreeDoc(xmlCardDAVDoc);\r
 \r
        // Get the first result.\r
-       \r
 \r
        for (std::map<wxString,wxString>::iterator iter = xmlDataMap.begin(); \r
                iter != xmlDataMap.end(); ++iter){\r
@@ -2005,12 +2003,10 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
        AbortConnection = FALSE;\r
 \r
        CURL *conn;\r
-       CURLcode conncode;\r
        wxString ServerAddressURL;\r
        wxString ServerAuth;\r
        wxString ServerAddressSSL;\r
-       wxString ServerAddressNormal;   \r
-\r
+       wxString ServerAddressNormal;\r
 \r
        conn = curl_easy_init();\r
        \r
@@ -2098,7 +2094,7 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
        std::map<int,int>::iterator ActIter;\r
        struct UploadDataStruc UploadData;\r
        \r
-       ActIter = ActivityListPtr->find(ItemIndex);\r
+       ActIter = ActivityListPtr->find((int)ItemIndex);\r
 \r
        curl_slist *slist = NULL;       \r
 \r
@@ -2346,7 +2342,7 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
                \r
                        fprintf(stderr, "curl_easy_perform() failed: %s\n",\r
                                        curl_easy_strerror(claconncode));\r
-                       long http_code = 0;\r
+                       int http_code = 0;\r
                        curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code);\r
                        fprintf(stderr, "Error code was: %d\n", http_code);\r
                                        \r
@@ -2356,7 +2352,7 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
 \r
                        fprintf(stderr, "curl_easy_perform() failed: %s\n",\r
                                        curl_easy_strerror(claconncode));\r
-                       long http_code = 0;\r
+                       int http_code = 0;\r
                        curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code);\r
                        fprintf(stderr, "Error code was: %d\n", http_code);\r
 \r
@@ -2411,9 +2407,9 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
                \r
                        fprintf(stderr, "curl_easy_perform() failed: %s\n",\r
                                        curl_easy_strerror(claconncode));\r
-                       long http_code = 0;\r
+                       int http_code = 0;\r
                        curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code);\r
-                       fprintf(stderr, "Error code was: %l\n", http_code);\r
+                       fprintf(stderr, "Error code was: %i\n", http_code);\r
                                        \r
                        return ContactListFinal;\r
                        \r
@@ -2421,9 +2417,9 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
 \r
                        fprintf(stderr, "curl_easy_perform() failed: %s\n",\r
                                        curl_easy_strerror(claconncode));\r
-                       long http_code = 0;\r
+                       int http_code = 0;\r
                        curl_easy_getinfo(conn, CURLINFO_RESPONSE_CODE, &http_code);\r
-                       fprintf(stderr, "Error code was: %l\n", http_code);\r
+                       fprintf(stderr, "Error code was: %i\n", http_code);\r
                                \r
                        return ContactListFinal;\r
 \r
@@ -2432,7 +2428,7 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
        }\r
 \r
        xmlDocPtr xmlCardDAVDoc;\r
-       xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), PageData.Len(), "noname.xml", NULL, 0);\r
+       xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), (int)PageData.Len(), "noname.xml", NULL, 0);\r
 \r
        xmlNodePtr nodeLevel1;\r
        xmlNodePtr nodeLevel2;\r
@@ -2541,8 +2537,8 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
                                        \r
                                                        if ((!xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"status") ||\r
                                                        !xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"d:status") ||\r
-                                                       !xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"D:status") && HTTPStatus == FALSE)\r
-                                                       ){\r
+                                                       !xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"D:status")) && HTTPStatus == FALSE)\r
+                                                       {\r
 \r
                                                                // Get the filename.\r
                                        \r
@@ -2750,8 +2746,8 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){
                                        \r
                                                        if ((!xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"status") ||\r
                                                        !xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"d:status") ||\r
-                                                       !xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"D:status") && HTTPStatus == FALSE)\r
-                                                       ){\r
+                                                       !xmlStrcmp(nodeStatusLv1->name, (const xmlChar *)"D:status")) && HTTPStatus == FALSE)\r
+                                                       {\r
 \r
                                                                // Get the filename.\r
                                        \r
@@ -3147,7 +3143,7 @@ wxString CardDAV::GetDefaultAddressBookURL(){
        // Process the XML data from the application.\r
        \r
        xmlDocPtr xmlCardDAVDoc;\r
-       xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), PageData.Len(), "noname.xml", NULL, 0);\r
+       xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), (int)PageData.Len(), "noname.xml", NULL, 0);\r
 \r
        xmlNodePtr nodeLevel1;\r
        xmlNodePtr nodeLevel2;\r
@@ -3326,7 +3322,7 @@ wxString CardDAV::GetDefaultAddressBookURL(){
                \r
        }\r
 \r
-       xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), PageData.Len(), "noname.xml", NULL, 0);\r
+       xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), (int)PageData.Len(), "noname.xml", NULL, 0);\r
                \r
        for (nodeLevel1 = xmlCardDAVDoc->children;\r
                nodeLevel1 != NULL;\r
@@ -3497,7 +3493,7 @@ wxString CardDAV::GetDefaultAddressBookURL(){
                \r
        }\r
        \r
-       xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), PageData.Len(), "noname.xml", NULL, 0);\r
+       xmlCardDAVDoc = xmlReadMemory(PageData.mb_str(wxConvUTF8), (int)PageData.Len(), "noname.xml", NULL, 0);\r
                \r
        for (nodeLevel1 = xmlCardDAVDoc->children;\r
                nodeLevel1 != NULL;\r
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