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

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. 🙂

Tags: ,

7 Responses to “Comic Plasmoid for 4.7: Creating Comic Book Archives, memory leaks ..”

  1. Ricardo Says:

    I like your plasmoid, and I dont know about others, but I am going to miss 2 removed features:
    – “press Ctrl + Scroll the mouse”
    – Automatic switching tabs

    Did they complicated too much the code?
    What you say you will implement instead of automatic switching, will be ready for 4.7?

    Thanks for all the hard work

    • mat69 Says:

      The Ctrl + Scroll did not complicate things. The automatic switching did complicate it and made it harder to understand. It was necessary to always keep it in mind when doing changes. [1]

      I plan to highlight tabs where a newer comic strip is available. Suppose you have Calvin and Hobbes open and set the checking to every ten minutes. If it recognises that there is a new comic strip it will mark this tab. It does that for all tabs you have. Thus it will work a little like rss feeds. As a result you don’t have to look at say 5 tabs just to see if there is a new comic strip.

      Could you please describe use cases you have for these two features?

      [1] Stopping/Starting the timer, so that tabs would not switch while you were interacting with the applet, as that was really anoying.

  2. Ricardo Says:

    I have around 12-14 comics, so not all the tabs are visible at the same time, only 5-7.
    I with the autoscolling and the new rss feature, everytime i see the desktop I could see if there are new comics around the current one, and that current one would change each time i see the desktop, so it would be easier to see if something had changed.

    Also because this long list of comics, is much faster to go to a specific comic by using control+scroll than using the scroll buttons

    • mat69 Says:

      Depending on the settings for each comics (save position or not) auto switch would result in looking at the most recent strip, thus removing the highlight.

      Essentially what you are saying is that you want an easy way to jump to the most recent comic strips right?

      Just a thought (for sure needs more thoughts 😀 ), this could maybe be accomplished in the context menu where an entry contains a submenu with all updated comic strips.

      In which way works ctrl+scroll better, than scrolling on the tabbar with the scrollwheel?

      • Ricardo Says:

        Upps, I didnt know about scroll wheel at the tabbar… so consider deprecated my comments about Control+scroll 🙂

  3. mat69 Says:

    Now that I have thought about it, what would most likely work best is a “jump to next new comic strip” (or what it would be called) option in the context menu that has a shortcut assigned.

    That way you’d only have to press the shortcut and if the tab does not change you’d know that there is no new comic strip anywhere, otherwise it would go to the correct strip.

Leave a reply to mat69 Cancel reply