void GaduEmoticonParser::parse() { QChar c = peek(); if (c.isNull()) return; if (c == '*') // ignore first *, I don't know why eat(); QStringList aliases = parseAliases(); eat(); // , QString animatedPath = parseQuoted(); eat(); // , QString staticPath = parseQuoted(); if (aliases.isEmpty() || animatedPath.isEmpty()) return; animatedPath = ThemePath + fixFileName(ThemePath, animatedPath); if (staticPath.isEmpty()) staticPath = animatedPath; else staticPath = ThemePath + fixFileName(ThemePath, staticPath); Result = Emoticon(aliases.at(0), staticPath, animatedPath); foreach (const QString &alias, aliases) Aliases.append(Emoticon(alias, staticPath, animatedPath)); }
Emoticons::Emoticons() { emoticons.append(Emoticon(":)", "smile.png")); emoticons.append(Emoticon(":-)", "smile.png")); // TODO: add more emoticons and load other from file or directory. }