|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
#include "helper.h"
|
|
|
|
|
#include "define.h"
|
|
|
|
|
|
|
|
|
|
#ifndef _WIN32
|
|
|
|
|
const QMap<QString, QString> Helper::m_numMap{
|
|
|
|
|
{"+", "1"},
|
|
|
|
|
{"ě", "2"},
|
|
|
|
@ -13,6 +14,7 @@ const QMap<QString, QString> Helper::m_numMap{
|
|
|
|
|
{"í", "9"},
|
|
|
|
|
{"é", "0"}
|
|
|
|
|
};
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
Helper::Helper()
|
|
|
|
|
{
|
|
|
|
@ -22,6 +24,20 @@ QString Helper::replaceByNumbers(const QString &str)
|
|
|
|
|
{
|
|
|
|
|
QString ret;
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
QMap<QString, QString> 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];
|
|
|
|
|
|
|
|
|
|