1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fast concatenation

This commit is contained in:
krepa098 2014-07-29 10:59:58 +02:00
parent f9cc5dbccd
commit 57a7324d41
2 changed files with 3 additions and 3 deletions

View File

@ -103,7 +103,7 @@ QString SmileyPack::replaceEmoticons(const QString &msg)
loadSmiley(file);
}
QString imgRichText = "<img src=\"data:image/png;base64," + cache[file] + "\">";
QString imgRichText = "<img src=\"data:image/png;base64," % cache[file] % "\">";
out.replace(index + offset, key.length(), imgRichText);
offset += imgRichText.length() - key.length();
@ -117,7 +117,7 @@ QString SmileyPack::replaceEmoticons(const QString &msg)
void SmileyPack::loadSmiley(const QString &name)
{
QSize size(16, 16); // TODO: adapt to text size
QString filename = path + "/" + name;
QString filename = path % "/" % name;
QImage img(filename);
if (!img.isNull())

View File

@ -42,7 +42,7 @@ private:
void loadSmiley(const QString& name);
QHash<QString, QString> assignmentTable; // matches an emoticon to its corresponding smiley
QHash<QString, QByteArray> cache;
QHash<QString, QString> cache;
QString path; // directory containing the cfg file
};