Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code detecting existence of template doesn’t work #43

Open
flying-sheep opened this issue Feb 11, 2020 · 0 comments
Open

Code detecting existence of template doesn’t work #43

flying-sheep opened this issue Feb 11, 2020 · 0 comments

Comments

@flying-sheep
Copy link
Contributor

flying-sheep commented Feb 11, 2020

I created a readable plain text file, selected it as template, but still the else branch is hit here:

QFile templateFile(templateFileName);
#ifdef KTIKZ_USE_KDE
KFileItem templateFileItem(QUrl::fromLocalFile(templateFileName));
if (templateFileItem.determineMimeType().parentMimeTypes().contains(QLatin1String("text/plain"))
#else
if (QFileInfo(templateFile).isFile()
#endif
&& templateFile.open(QIODevice::ReadOnly | QIODevice::Text) // if user-specified template file is readable
&& !tikzReplaceText.isEmpty())
{

If I output the mime list, I get just ("application/octet-stream"), while I also get

$ file --mime-type Dev/TeX/ktikz-context.pgs
Dev/TeX/ktikz-context.pgs: text/plain

I assume if the file itself has the text/plain mime already, its parents only contain application/octet-stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant