Fix duplicate name of _mutex in ExceptionStore and some of its children.
[dcpomatic.git] / src / lib / update.cc
index 26944ecc32d2bc3503d2472f91d7feff49849533..7a3f0bd5ddec3ae4dd6e72a390b185e38f628af0 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "update.h"
 #include "version.h"
-#include "ui_signaller.h"
 #include "safe_stringstream.h"
 #include "config.h"
 #include "util.h"
@@ -58,14 +57,13 @@ UpdateChecker::UpdateChecker ()
        , _emits (0)
        , _to_do (0)
 {
-       curl_global_init (CURL_GLOBAL_ALL);
        _curl = curl_easy_init ();
 
        curl_easy_setopt (_curl, CURLOPT_URL, "http://dcpomatic.com/update");
        curl_easy_setopt (_curl, CURLOPT_WRITEFUNCTION, write_callback_wrapper);
        curl_easy_setopt (_curl, CURLOPT_WRITEDATA, this);
        curl_easy_setopt (_curl, CURLOPT_TIMEOUT, 20);
-       
+
        string const agent = "dcpomatic/" + string (dcpomatic_version);
        curl_easy_setopt (_curl, CURLOPT_USERAGENT, agent.c_str ());
 
@@ -75,9 +73,8 @@ UpdateChecker::UpdateChecker ()
 UpdateChecker::~UpdateChecker ()
 {
        /* We are not cleaning up our thread, but hey well */
-       
+
        curl_easy_cleanup (_curl);
-       curl_global_cleanup ();
        delete[] _buffer;
 }
 
@@ -101,12 +98,12 @@ UpdateChecker::thread ()
                }
                --_to_do;
                lock.unlock ();
-               
+
                try {
                        _offset = 0;
 
                        /* Perform the request */
-                       
+
                        int r = curl_easy_perform (_curl);
                        if (r != CURLE_OK) {
                                set_state (FAILED);
@@ -114,7 +111,7 @@ UpdateChecker::thread ()
                        }
 
                        /* Parse the reply */
-                       
+
                        _buffer[_offset] = '\0';
                        string s (_buffer);
                        cxml::Document doc ("Update");
@@ -134,7 +131,7 @@ UpdateChecker::thread ()
                        if (version_less_than (dcpomatic_version, stable)) {
                                _stable = stable;
                        }
-                       
+
                        if (Config::instance()->check_for_test_updates() && version_less_than (dcpomatic_version, test)) {
                                _test = test;
                        }
@@ -149,7 +146,7 @@ UpdateChecker::thread ()
                }
        }
 }
-       
+
 size_t
 UpdateChecker::write_callback (void* data, size_t size, size_t nmemb)
 {
@@ -204,13 +201,13 @@ UpdateChecker::version_less_than (string const & a, string const & b)
        } else {
                am = raw_convert<int> (ap[2]);
        }
-       
+
        float bm;
        if (ends_with (bp[2], "devel")) {
                bm = raw_convert<int> (bp[2].substr (0, bp[2].length() - 5)) + 0.5;
        } else {
                bm = raw_convert<int> (bp[2]);
        }
-       
+
        return am < bm;
 }