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

prevent duplicating emoticons on the list

This commit is contained in:
agilob 2014-10-29 20:24:56 +00:00
parent 8197cc574c
commit c079641fc1
No known key found for this signature in database
GPG Key ID: 2CACF3EEF598C663

View File

@ -68,11 +68,13 @@ QList<QPair<QString, QString> > SmileyPack::listSmileyPacks(const QStringList &p
QString relPath = QDir(QCoreApplication::applicationDirPath()).relativeFilePath(absPath);
if (relPath.leftRef(2) == "..")
smileyPacks << QPair<QString, QString>(packageName, absPath);
else
smileyPacks << QPair<QString, QString>(packageName, relPath); // use relative path for subdirectories
{
if(!smileyPacks.contains(QPair<QString, QString>(packageName, absPath)))
smileyPacks << QPair<QString, QString>(packageName, absPath);
else if(!smileyPacks.contains(QPair<QString, QString>(packageName, relPath)))
smileyPacks << QPair<QString, QString>(packageName, relPath); // use relative path for subdirectories
}
}
dir.cdUp();
}
}