Posts Tagged ‘plasmoid’

Comic Plasmoid for 4.7: Creating Comic Book Archives, memory leaks ..

April 28, 2011

Lately I worked again on the comic plasmoid and added some features and also removed some.

Bugs and Nepomuk

No, I am not saying Nepomuk is buggy, but that my code (sometimes?) is.

That is why I fixed some comic plasmoid bugs.

Memory leak

One was quite nasty to say the least. In 4.5 I added prefetching. The idea and patch were posted by a person on the plasma-list and the idea is indeed cool:

When you look at a comic strip the previous and next strip are automatically fetched, thus if you click next/previous you don’t have to wait for long. This improved reading comics a lot but added a memory leak. We did not disconnect the source, so it was staying around and using memory.

When looking at many comic strips it could happen that the memory usage of plasma-desktop would sky rocket. So if that is the case for you, then I am sorry.

In fact I wrote to the packagers ml mentioning the commits that fix this and hopefully — no clue if distributions created new packages — you have updates already.

Nepomuk

I am using Nepomuk for quite some time in the comic plasmoid by now. That means if you save a comic strip to your hard drive it will get tags automatically. Also the author will be assigned to it etc.

Only that the implementation was partially incorrect. Thanks to Sebastian — I suppose this is another KDE dev we need clones of — the implementation is correct now.

What does that mean for you? Well let’s say you also like Calvin and Hobbes and stored some fantastic strips on your hd, clicking on the author "Bill Watterson" will show all comics you have from that person. Some comics have multiple authors which change, so this could help you finding comics from a specific author.

Also other data is stored via Nepomuk but I don’t want to go into detail here.
And for those who don’t use Nepomuk? Well the comic plugin works fine without it.

Comic Book Archives

One of the features I was adding is support for creating Comic Book Archives. With 4.7 you can right click on a comic and choose "Create Comic Book Archive".

In the following dialog you can choose different types of ranges:

  • Archive all comic strips
  • Archive from the beginning to a certain identifier
  • Archive from the end to a certain identifier
  • Archive a defined range

Depending on the type of the comic (Date, Number, String) you’ll get different input fields.

Clicking ok will start a job which downloads all the needed files and informs you of errors. You can create multiple jobs, there is no limit.

If possible it will determine how many files are to be downloaded and display the percentage that has been downloaded already. When done Nepomuk is used here as well.

Automatic Comic Plugin Updating:

This has not only been a feature request on bko but also something I wanted to do for a long time. It sucked big time to go to the get new comics dialog to see which comics needed updating.

Yet when I first tried to implement auto-updating I was not only greated by a magnitude of "do you want to overwrite xy file" dialogs, but also the updates wouldn’t be recognised as such. Restarting I would be asked again …

These problems were caused by bugs in KNS which I — FOSS for the win — fixed. Now it is working really good. 🙂

Btw. I did not forget about the people who modify comic plugins and don’t want them to be updated. You can turn auto updating off if you don’t like it.

Cleanup

The config dialogs got more and more messy and when I asked Aaron to review a patch of mine he mentioned that. So I started improving those dialogs with the input of Aaron and Todd and imo they are a lot better now.

As you can see choosing comic strips via a combox is not supported anymore. The reason to have them both have a lot to do with the history of the comic plasmoid and me hesitating to remove existing stuff.

Other than that you can’t hide the tab bar anymore. Instead it will be always shown if you have at least two comics selected. That also means that I removed the "press Ctrl + Scroll the mouse" feature for changing tabs. Automatically switching tabs is also removed. No clue if anyone used that feature and I am working on something which should be better anyway.

Btw. the default values might change, I have not decided on them yet.

All this made not only the code more clear but imo also the user interface. There is for sure a lot more to do, but I think this is a lot better already.

Outlook

This are not all changes I wanna do for the comic plugin for 4.7, so I hope to be able to blog about some other cool things in the next few days/weeks.

PS.: If you wonder why there is no Oxygen style in my pictures, well, I don’t use it on my devel account.
Why?
Do I hate Oxygen?
Yeah, I do, I hate breathing it.
No in fact not, but that way it is easier to distinguish it from apps from my normal account which I run over sux. 🙂