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

refactor: removed meaningless 'isValid' method

This commit is contained in:
noavarice 2017-04-08 19:45:51 +03:00
parent e0f1a01a74
commit 935c1a2aa8
3 changed files with 2 additions and 7 deletions

View File

@ -232,8 +232,9 @@ void Settings::loadGlobal()
const QString DEFAULT_SMILEYS = ":/smileys/emojione/emoticons.xml"; const QString DEFAULT_SMILEYS = ":/smileys/emojione/emoticons.xml";
smileyPack = s.value("smileyPack", DEFAULT_SMILEYS).toString(); smileyPack = s.value("smileyPack", DEFAULT_SMILEYS).toString();
if (!SmileyPack::isValid(smileyPack)) if (!QFile::exists(smileyPack)) {
smileyPack = DEFAULT_SMILEYS; smileyPack = DEFAULT_SMILEYS;
}
emojiFontPointSize = s.value("emojiFontPointSize", 24).toInt(); emojiFontPointSize = s.value("emojiFontPointSize", 24).toInt();
firstColumnHandlePos = s.value("firstColumnHandlePos", 50).toInt(); firstColumnHandlePos = s.value("firstColumnHandlePos", 50).toInt();

View File

@ -159,11 +159,6 @@ QVector<QPair<QString, QString>> SmileyPack::listSmileyPacks(const QStringList&
return smileyPacks; return smileyPacks;
} }
bool SmileyPack::isValid(const QString& filename)
{
return QFile(filename).exists();
}
/** /**
* @brief Load smile pack * @brief Load smile pack
* @note The caller must lock loadingMutex and should run it in a thread * @note The caller must lock loadingMutex and should run it in a thread

View File

@ -32,7 +32,6 @@ public:
static SmileyPack& getInstance(); static SmileyPack& getInstance();
static QVector<QPair<QString, QString>> listSmileyPacks(const QStringList& paths); static QVector<QPair<QString, QString>> listSmileyPacks(const QStringList& paths);
static QVector<QPair<QString, QString>> listSmileyPacks(); static QVector<QPair<QString, QString>> listSmileyPacks();
static bool isValid(const QString& filename);
QString smileyfied(const QString& msg); QString smileyfied(const QString& msg);
QList<QStringList> getEmoticons() const; QList<QStringList> getEmoticons() const;