Re: [Plasmoids] Can I write to file from a pure QML plasmoid?

2015-12-15 Thread kdea
On Monday, December 14, 2015 21:54:02 Sebastian Kügler wrote:

> I'm very reluctant to add generic file I/O to our QML API, as that is going
> to make it very hard to secure it later on. We haven't redone the file I/O
> portions for that reason.

Personally I don't see much difference between a standard application running 
in a window and a QML application running in the panel. Why the first one 
should be able to do File I/O and the second one not? Why running in the panel 
is less secure than running in a window?

On the other hand, I don't see any advantage in having to add C++ to do file 
I/O. A plasmoid isn't more secure if I do file I/O with C++ than if I could do 
file I/O with a QML library. I only see disadvantages in the C++ option:

- The developer will have to learn C++.
- The developer will have to learn how to communicate QML with C++.
- The developer will have to compile the plasmoid for each 
distribution/architecture. Or the user will have to download the source code 
and compile it.

> Perhaps you could tell us about your exact use case, maybe we're able to
> suggest a better solution than to offer a generic file I/O API. (Often,
> there are already solutions for a given purpose.)

Well, the plasmoid will be a surprise :-), so I would prefer to keep the 
details secret until I publish it. I can only say that it requires to read and 
write from/to files in disk, it is a core feature.

Thank you
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: [Plasmoids] Can I write to file from a pure QML plasmoid?

2015-12-14 Thread Sebastian Kügler
On Monday, December 14, 2015 20:46:54 kdea wrote:
> Hi. One week ago I asked a question at forum.kde.org, but nobody responded,
> so I'm now trying here in the mail list, please redirect me to the
> appropiate list if this one is not the correct one. I'm copying the
> question... 
> Hi, I'm creating a QML plasmoid that will write data to a file in disk. I
> have searched a lot, and it seems that it is not possible with a pure QML
> plasmoid. Web pages say that the only way to do it is by adding C++. 

Correct.

> The problem with adding C++ is that, as I understand, the plasmoid will have
> to be compiled, so I will get some binary files that won't work in all
> Linux distributions. In other words, the plasmoid will be less portable: I
> will have to create a different file for each Linux distribution before

...and for each architecture as well.

> posting the plasmoid to kde-apps.org, or the user will have to download the
> source code and compile it for his/her distribution. It is a mess. 
> I think that file I/O should be possible from a pure QML plasmoid. It is a
> core functionality for a high percentage of plasmoids. If you make it
> difficult (by requiring the C++ mess), less programmers will create
> plasmoids, so less plasmoids will be created. 
> In fact, file I/O was possible in kde4 from a pure javascript plasmoid, by
> using the "Local IO" library:
> https://techbase.kde.org/Development/Tutorials/Plasma4/JavaScript/API-Local
> IO 
> I really would like to listen that file I/O is possible from a pure QML
> plasmoid in kde5. Or at least that developers are already working on a kde
> library to make it possible. 

I'm very reluctant to add generic file I/O to our QML API, as that is going to 
make it very hard to secure it later on. We haven't redone the file I/O 
portions for that reason.

Perhaps you could tell us about your exact use case, maybe we're able to 
suggest a better solution than to offer a generic file I/O API. (Often, there 
are already solutions for a given purpose.)

> (I didn't know if I should post it at "Brainstorm" forum or here, but I
> wanted to ask first) ___

This list if fine for this question.

Cheers,
-- 
sebas

Sebastian Kügler|http://vizZzion.org| http://kde.org

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[Plasmoids] Can I write to file from a pure QML plasmoid?

2015-12-14 Thread kdea
Hi. One week ago I asked a question at forum.kde.org, but nobody responded, so 
I'm now trying here in the mail list, please redirect me to the appropiate list 
if this one is not the correct one. I'm copying the question...
 
Hi, I'm creating a QML plasmoid that will write data to a file in disk. I have 
searched a lot, and it seems that it is not possible with a pure QML plasmoid. 
Web pages say that the only way to do it is by adding C++.
 
The problem with adding C++ is that, as I understand, the plasmoid will have to 
be compiled, so I will get some binary files that won't work in all Linux 
distributions. In other words, the plasmoid will be less portable: I will have 
to create a different file for each Linux distribution before posting the 
plasmoid to kde-apps.org, or the user will have to download the source code and 
compile it for his/her distribution. It is a mess.
 
I think that file I/O should be possible from a pure QML plasmoid. It is a core 
functionality for a high percentage of plasmoids. If you make it difficult (by 
requiring the C++ mess), less programmers will create plasmoids, so less 
plasmoids will be created.
 
In fact, file I/O was possible in kde4 from a pure javascript plasmoid, by 
using the "Local IO" library: 
https://techbase.kde.org/Development/Tutorials/Plasma4/JavaScript/API-LocalIO
 
I really would like to listen that file I/O is possible from a pure QML 
plasmoid in kde5. Or at least that developers are already working on a kde 
library to make it possible.
 
Thank you
 
(I didn't know if I should post it at "Brainstorm" forum or here, but I wanted 
to ask first)
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel