Commit c9e036e2 authored by Fabian Vogt's avatar Fabian Vogt

Support font/ttf and font/otf mimetypes in kfontinst

Summary:
Those mimetypes are new and kfontinst/kfontview/fontthumbnail weren't aware
of that.
As the old types are aliases of the new types, it doesn't need to be added
to the file dialog options (it would create duplicate entries).
However, it broke thumbnail generation.

Test Plan: .ttf files have thumbnails again.

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: anthonyfieroni, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9738
parent 4ee8304c
[Desktop Entry]
X-KDE-ServiceTypes=KonqPopupMenu/Plugin,application/x-font-ttf,application/x-font-type1,application/x-font-bdf,application/x-font-pcf,application/x-font-otf,application/x-font-afm,fonts/package
X-KDE-ServiceTypes=KonqPopupMenu/Plugin,application/x-font-ttf,application/x-font-type1,application/x-font-bdf,application/x-font-pcf,application/x-font-otf,application/x-font-afm,fonts/package,font/ttf,font/otf
Actions=installFont;
Type=Service
......
......@@ -92,7 +92,7 @@ Exec=kfontview %U
Icon=kfontview
X-KDE-StartupNotify=true
Type=Application
MimeType=application/x-font-ttf;application/x-font-type1;application/x-font-otf;application/x-font-pcf;application/x-font-bdf;application/vnd.kde.fontspackage;
MimeType=application/x-font-ttf;application/x-font-type1;application/x-font-otf;application/x-font-pcf;application/x-font-bdf;application/vnd.kde.fontspackage;font/otf;font/ttf;
GenericName=Font Viewer
GenericName[af]=Skriftipe Besigter
GenericName[ar]=عارض الخطوط
......
......@@ -54,7 +54,9 @@
namespace KFI
{
const QStringList CFontList::fontMimeTypes(QStringList() << "application/x-font-ttf"
const QStringList CFontList::fontMimeTypes(QStringList() << "font/ttf"
<< "font/otf"
<< "application/x-font-ttf"
<< "application/x-font-otf"
<< "application/x-font-type1"
<< "application/x-font-pcf"
......
......@@ -290,7 +290,8 @@ int getIntQueryVal(const QUrl &url, const char *key, int defVal)
bool printable(const QString &mime)
{
return "application/x-font-type1"==mime || "application/x-font-ttf"==mime ||
return "font/otf"==mime || "font/ttf"==mime ||
"application/x-font-type1"==mime || "application/x-font-ttf"==mime ||
"application/x-font-otf"==mime || "application/x-font-type1"==mime;
}
......
......@@ -93,8 +93,8 @@ bool CFontThumbnail::create(const QString &path, int width, int height, QImage &
QString mime(db.mimeTypeForFile(tempDir->path()+QLatin1Char('/')+entry->name()).name());
if(mime=="application/x-font-ttf" || mime=="application/x-font-otf" ||
mime=="application/x-font-type1")
if(mime=="font/ttf" || mime=="font/otf" || mime=="application/x-font-ttf" ||
mime=="application/x-font-otf" || mime=="application/x-font-type1")
{
realPath=tempDir->path()+QLatin1Char('/')+entry->name();
break;
......
......@@ -92,6 +92,6 @@ Name[x-test]=xxFont Filesxx
Name[zh_CN]=字体文件
Name[zh_TW]=字型檔案
X-KDE-ServiceTypes=ThumbCreator
MimeType=application/x-font-ttf;application/x-font-type1;application/x-font-bdf;application/x-font-pcf;application/x-font-otf;fonts/package;
MimeType=application/x-font-ttf;application/x-font-type1;application/x-font-bdf;application/x-font-pcf;application/x-font-otf;fonts/package;font/ttf;font/otf;
X-KDE-Library=fontthumbnail
CacheThumbnail=true
......@@ -319,8 +319,8 @@ void CFontViewPart::timeout()
QMimeDatabase db;
QString mime(db.mimeTypeForFile(itsTempDir->path()+QLatin1Char('/')+entry->name()).name());
if(mime=="application/x-font-ttf" || mime=="application/x-font-otf" ||
mime=="application/x-font-type1")
if(mime=="font/ttf" || mime=="font/otf" || mime=="application/x-font-ttf" ||
mime=="application/x-font-otf" || mime=="application/x-font-type1")
{
fontFile=itsTempDir->path()+QLatin1Char('/')+entry->name();
//setLocalFilePath(itsTempDir->path()+QLatin1Char('/')+entry->name());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment