Giter VIP home page Giter VIP logo

Comments (14)

r00tr4v3n avatar r00tr4v3n commented on July 17, 2024 1

A default cache folder might be useful to add to the API. I see what I can get done next week.

from scripts.

pbek avatar pbek commented on July 17, 2024

Can you please mention the authors of the script.

from scripts.

yunesj avatar yunesj commented on July 17, 2024

Calling @r00tr4v3n!

from scripts.

yunesj avatar yunesj commented on July 17, 2024

Although @pbek, I naively put in a:

script.startSynchronousProcess('/usr/bin/touch', ['/tmp/hi']);

and it didn't seem to work. Do startDetachedProcess and startSynchronousProcess work on Mac?

from scripts.

r00tr4v3n avatar r00tr4v3n commented on July 17, 2024

and it didn't seem to work. Do startDetachedProcess and startSynchronousProcess work on Mac?

Maybe I broke those for Mac on the last PR? I'll have a look later.

from scripts.

pbek avatar pbek commented on July 17, 2024

Do startDetachedProcess and startSynchronousProcess work on Mac?

Yes, they should work.

e.g. startDetachedProcess works like that:
https://github.com/pbek/QOwnNotes/blob/da7c23f11062f91c53578c94836cee1b69b18d5d/src/utils/misc.cpp#L401-L437

from scripts.

r00tr4v3n avatar r00tr4v3n commented on July 17, 2024

Warning: QQmlComponent: Component is not ready ((null):0, (null))
Warning: script errors: (file:///Users/jeff/Library/Application Support/PBE/QOwnNotes/scripts/latex-math/latex-math.qml:1:1: module "QtQml" version 2.14 is not installed
import QtQml 2.14
^) ((null):0, (null))

This shouldn't happen in the first place independently from other script API calls.
Maybe a problem with the Qt version on Mac?

from scripts.

yunesj avatar yunesj commented on July 17, 2024

Hi @r00tr4v3n , why do you think this shouldn't happen, and why do you suggest it's a problem with the Qt version?

Also, what do you think of my comment on theexecBashDetached(rm ${workDir}/*), which I think is very risky?

from scripts.

r00tr4v3n avatar r00tr4v3n commented on July 17, 2024

Since he is complaining about the imports and doesn't even reach the function calls, I suspected it to not be the scripts fault.
Good hint on the rm command. At least directories should be fine though. I could add a file suffix like rm ${workDir}/*.lat?

from scripts.

yunesj avatar yunesj commented on July 17, 2024

@r00tr4v3n I don't have that problem with the @pbek 's script paste-latex-image.qml, which does import QtQml 2.0 rather than import QtQml 2.14.

It seems that all example scripts in the scripting/examples use import QtQml 2.0.

QOwnNotes seems to be packaged with Qt 5.13.2. According to the QML documentation for QT 5.13.2, you should use import QtQml 2.13 if you must use the latest features. 2.14 seems to be an invalid version of QtQml for Qt 5.13.2.

Are you sure you are only using the QtQml version packaged with the QOwnNotes binary, and you aren't using your own QOwnNotes binary with a different version of QtQml, or didn't otherwise alter the import path used by your script during development?


As for the rm command, I think it would be best to just store the files by default in ~/.cache/latex-math. If you want to allow a user to specify a different folder, then I think the script should still create a latex-math subfolder which you can delete without worry. If you don't like that solution, I think it would still be better to simply warn the user that all of the contents of the given directory will be deleted (and should not be set to ~/Desktop!

from scripts.

r00tr4v3n avatar r00tr4v3n commented on July 17, 2024

I might have copied the import version from another script, I can just change it to 2.0.
The default folder would cause problems with Windows users, I'd have to set the defaults according to the operating system.

from scripts.

yunesj avatar yunesj commented on July 17, 2024

Yes, I should have said, [user cache folder]/latex-math. I think you can get the platform-dependent path via the QStandardPaths Class.

My main point was that, if you allow the user to specify the directory, you should either warn the user that its contents will be deleted, or create your own latex-math subfolder at the given location.

from scripts.

r00tr4v3n avatar r00tr4v3n commented on July 17, 2024

Please have a look at the update, see if it works for you.

from scripts.

pbek avatar pbek commented on July 17, 2024

I will close this issue until there is more information.

from scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.