Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Commit

Permalink
fix: suffix is not lower case.
Browse files Browse the repository at this point in the history
Change-Id: I4579361c546ad994cdb5a76cadd871f73936b963
  • Loading branch information
reionwong committed Jan 22, 2018
1 parent 9fd3a51 commit fe83600
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libdeepin-font-installer/dfontinfomanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ QString dirSyntax(const QString &d)
return d;
}

QString getFontPath(DFontInfo *info)
QString getInstalledFontPath(DFontInfo *info)
{
const QList<DFontInfo> famList = dataList;
QString filePath = nullptr;
Expand Down Expand Up @@ -143,7 +143,7 @@ QStringList DFontInfoManager::getAllFontPath() const

for (const QFileInfo &info : infoList) {
const QString filePath = info.absoluteFilePath();
const QString suffix = info.suffix();
const QString suffix = info.suffix().toLower();

if (suffix == "ttf" || suffix == "ttc" || suffix == "otf") {
pathList.append(filePath);
Expand Down Expand Up @@ -272,7 +272,7 @@ bool DFontInfoManager::fontsInstall(const QStringList &files)
bool DFontInfoManager::fontRemove(DFontInfo *data)
{
QProcess process;
QString filePath = getFontPath(data);
QString filePath = getInstalledFontPath(data);
bool isRemove;

process.start("pkexec", QStringList() << "rm" << "-rf" << filePath);
Expand All @@ -294,7 +294,7 @@ bool DFontInfoManager::fontRemove(DFontInfo *data)
QString DFontInfoManager::fontReinstall(DFontInfo *data) const
{
QProcess process;
QString sysPath = getFontPath(data);
QString sysPath = getInstalledFontPath(data);
QString instPath = nullptr;

process.start("pkexec", QStringList() << "cp" << "-f" << data->filePath << sysPath);
Expand Down

0 comments on commit fe83600

Please sign in to comment.