Is there a PreviewJob version where i can add more items?

Sebastian K├╝gler sebas at kde.org
Fri Jan 25 12:58:40 GMT 2013


On Thursday, January 24, 2013 22:48:00 Mark wrote:
> In my project is need to create thumbnails of files and am using
> PreviewJob for that right now. It works fine, no issue there, but i
> have a slightly different workflow that doesn't seem to fit the
> PreviewJob class.
> 
> My flow "should" go as follows:
> 
> - A batch of files arrives
> - - for each item a check is done to see if a thumbnail exists for it,
> if not then the item should be added to a Queue (QQueue perhaps?)
> - - PreviewJob gets notified of items in the queue and start processing them
> 
> That is how i would like to have it because then i can just add items
> to the queue as a want and the PreviewJob class just progresses all
> items. Not really a strange request, right?
> 
> So the question is, how can i use the current PreviewJob class for
> this? It doesn't seem to be capable of doing that. There also doesn't
> seem to be a function to add additional items other then through the
> constructor.
> 
> What i'm doing right now is creating a PreviewJob instance for every
> batch that arrives. It works, but "feels" as if it needs to be changed
> to a proper queue. Please do correct me if i'm wrong.

To me, that sounds fine. In the end, KIO will do the scheduling for you, so 
PreviewJobs are, in that regard, just fire and forget.

> It really seems like i'm taking on all kdelibs part that have anything
> to do with file listing and progressing.. It's fun though
-- 
sebas

http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9




More information about the kde-core-devel mailing list