Trim spaces from entries to certificate download pages.
[dcpomatic.git] / src / wx / qube_certificate_panel.cc
index 8e9662e7d3ae24508400df4b0173e7a4ad205eec..b40a9ecf64e1d2c6b86a93026cc96683600fcd82 100644 (file)
 */
 
 
-#include "qube_certificate_panel.h"
 #include "download_certificate_dialog.h"
+#include "qube_certificate_panel.h"
 #include "wx_util.h"
-#include "lib/internet.h"
 #include "lib/compose.hpp"
 #include "lib/config.h"
-#include <boost/algorithm/string/predicate.hpp>
+#include "lib/internet.h"
+#include <boost/algorithm/string.hpp>
 
 
 using std::string;
 using std::list;
+using namespace boost::algorithm;
 using boost::optional;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
@@ -56,7 +57,9 @@ QubeCertificatePanel::do_download ()
                return;
        }
 
-       auto const serial = wx_to_std(_serial->GetValue());
+       auto serial = wx_to_std(_serial->GetValue());
+       trim(serial);
+
        optional<string> name;
        for (auto i: files) {
                if (boost::algorithm::starts_with(i, String::compose("%1-%2-", _type, serial))) {