From 1c22eb3c0af388d1a00aa713cff28fca511bbd45 Mon Sep 17 00:00:00 2001 From: Pepa Rokos Date: Tue, 19 Jun 2018 19:20:37 +0200 Subject: [PATCH] Fixed MSVC 2012 build. --- core/helper.cpp | 16 ++++++++++++++++ core/helper.h | 6 +++++- core/idashboardwidget.h | 4 +++- shop/shopservice.cpp | 4 ++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/core/helper.cpp b/core/helper.cpp index a2dcc9c..48f6285 100644 --- a/core/helper.cpp +++ b/core/helper.cpp @@ -1,6 +1,7 @@ #include "helper.h" #include "define.h" +#ifndef _WIN32 const QMap Helper::m_numMap{ {"+", "1"}, {"ě", "2"}, @@ -13,6 +14,7 @@ const QMap Helper::m_numMap{ {"í", "9"}, {"é", "0"} }; +#endif Helper::Helper() { @@ -22,6 +24,20 @@ QString Helper::replaceByNumbers(const QString &str) { QString ret; +#ifdef _WIN32 + QMap m_numMap; + m_numMap["+"] = "1"; + m_numMap["ě"] = "2"; + m_numMap["š"] = "3"; + m_numMap["č"] = "4"; + m_numMap["ř"] = "5"; + m_numMap["ž"] = "6"; + m_numMap["ý"] = "7"; + m_numMap["á"] = "8"; + m_numMap["í"] = "9"; + m_numMap["é"] = "0"; +#endif + std::for_each(ALL(str), [&](QChar c){ QString replaced = m_numMap[c]; diff --git a/core/helper.h b/core/helper.h index cd8d28b..51f5c83 100644 --- a/core/helper.h +++ b/core/helper.h @@ -4,7 +4,9 @@ #include #include -class Helper +#include "core_global.h" + +class CORESHARED_EXPORT Helper { public: Helper(); @@ -12,7 +14,9 @@ public: static QString replaceByNumbers(const QString &str); private: +#ifndef _WIN32 static const QMap m_numMap; +#endif }; #endif // HELPER_H diff --git a/core/idashboardwidget.h b/core/idashboardwidget.h index ead363f..9cb3f61 100644 --- a/core/idashboardwidget.h +++ b/core/idashboardwidget.h @@ -1,7 +1,9 @@ #ifndef IDASHBOARDWIDGET_H #define IDASHBOARDWIDGET_H -class IDashboardWidget +#include "core_global.h" + +class CORESHARED_EXPORT IDashboardWidget { public: virtual void refresh() = 0; diff --git a/shop/shopservice.cpp b/shop/shopservice.cpp index 17852e5..74feb82 100644 --- a/shop/shopservice.cpp +++ b/shop/shopservice.cpp @@ -10,6 +10,10 @@ #include #include +#ifdef _WIN32 +inline double round(double value) { return value < 0 ? -std::floor(0.5 - value) : std::floor(0.5 + value); } +#endif + ShopService::ShopService() { }