Revert "Fix emoji search in dictionary (#234)"

As regression has not been fixed :(
This reverts commits d0de5d31e6
This commit is contained in:
leha-bot 2020-04-16 22:45:06 +03:00
parent ee4888685c
commit 2d2a39ff41
2 changed files with 4 additions and 5 deletions

View File

@ -64,7 +64,6 @@ void writeLicense(QTextStream &stream, const ProjectInfo &project) {
CppFile::CppFile(const QString &path, const ProjectInfo &project)
: stream_(&content_)
, forceReGenerate_(project.forceReGenerate) {
stream_.setCodec("UTF-8");
bool cpp = path.toLower().endsWith(".cpp");
QFileInfo info(path);

View File

@ -643,7 +643,7 @@ const std::map<QString, int> EmojiMap = {\n\
\n";
for (auto &item : data_.map) {
source_->stream() << "{QString(\"" << item.first << "\")," << item.second << "},\n";
source_->stream() << "{\"" << item.first << "\"," << item.second << "},\n";
}
source_->stream() << "\
\n\
@ -674,10 +674,10 @@ bool Generator::writeFindFromDictionary(const std::map<QString, int, std::greate
auto max_length = max_el->first.size();
source_->stream() << "\tstd::array<size_t, " << max_length + 1 << "> sizes;\n";
if (skipPostfixes) {
source_->stream() << "\tfor (int i=0,l=0; i<full_str.size() && l < " << max_length << R"code(; ++i) {
if (full_str[i] == kPostfix) {continue;}
source_->stream() << "\tfor (int i=0,l=0; i<str.size() && l < " << max_length << R"code(; ++i) {
if (str[i] == kPostfix) {continue;}
++l;
sizes[l]=i+1;
sizes[l]=i;
str+=full_str[i];
}
)code";