Archive for November, 2006

Another infrequent commit

November 12th 2006

So I made a minor improvement to JuK yesterday (in the 3.5 branch, I’m still seeing how it applies to KDE 4). Basically the “Add to JuK Collection” action that is added to Konqueror when selecting music files didn’t work. And, not only did it not work, but if you selected 20 different files and tried to add them to JuK, your taskbar would fill up with 20 different buttons as DCOP was run 20 times simultaneously trying to add the files at once.

Implementing the fix led me to discover a feature of the dcop command line tool that I was not aware of. Let’s say that you wanted to call a function that had different variants with the same name. This is something I ran into with JuK, as the openFile() command I’d be using has 4 different variants, allowing you to add one or multiple files, into either the Collection List or a specific playlist.

The easy part is telling dcop which function to use. In my case, I wanted openFile(QStringList). So my dcop command line looked something like dcop juk Collection 'openFile(QStringList)' files.

But the command wouldn’t work, complaining that there were not enough arguments. A brief Google search didn’t lead me to any help either, so I started digging in the source code for the dcop command line client. Eventually I discovered that when the dcop client is reading in a QStringList, it expects it to be specially marked out. You can use brackets for this purpose. So my (working) command line was dcop juk Collection 'openFile(QStringList)' [ files ].

Converting this into the service menu was easy enough. Aaron Seigo’s service menu tutorial covers basically everything you need to know. The problem that caused 20+ taskbar entries when selecting multiple files is from the original service menu entry using the %u field (which says pass one URL at a time) instead of the %U field (which means to pass all URLs at once to the application). So the final service menu entry was this: Exec=dcop juk Collection 'openFile(QStringList)' [ %U ].

Noting the change in the KDE 3.5 changelog was much easier than last time when I had to do so. Now we have a fancy XML file that we add entries into, and the appropriate PHP page is automagically generated, with all the fancy hyperlinks as appropriate. It’s actually pretty nice, so good job Carsten!

Posted by mpyne under KDE | No Comments »

Update update

November 2nd 2006

This has been a really busy two weeks for me. One thing I’ve noticed is that all through the Navy training pipeline, the message has always been, “Oh, it’ll be better at the next command.” But the only time that was true was during OCS (i.e. boot camp).

I went next to Power School, which was hard but was really pretty easy compared with the next stop, Prototype, where I was always busy and being run ragged with studying and trying to get people to sign qualifications off. Now on the boat I am, if anything, even busier. I’m almost looking forward to going to sea because of it. After all, I haven’t been able to do much with my programming, can’t spend time with my wife, and I never get enough sleep. No wonder the Nukes make so much money, because I can’t find any junior officers who are stoked about signing up for more time in the Navy. ;-)

I bought an iPod for the upcoming patrol. The iPod Nano isn’t horribly well supported but the latest gtkpod (with libgpod) program seems to work well enough most of the time. What I need to do when I get back is see if I can hack in iPod support to JuK in some kind of sane fashion. Beyond that though, the iPod itself is as nice as people claim, very easy to use and no detail left unconsidered, not even the packaging.

Adriaan blogged the other day about how he setup a aggregator for the KDE blogs that actually deal mostly with technical talk. I noticed mine’s not on there, and why not? I haven’t published anything that wasn’t whining about politics or how busy I’ve been in a long time. It’s a pity too, as one reason I’d been working so hard on programming during Power School and the beginning of Prototype was so that I could have an alternative to the Navy when it comes time to decide whether to leave the Navy or sign up for another tour. There’s always the off-crew periods where I’ll hopefully be able to focus on getting my hobbies done, but failing that it almost seems as if I won’t have time until my shore duty comes around in a couple of years.

I may not post again for awhile, but rest assured I haven’t left permanently. I’ll just have to find time somehow. :)

Posted by mpyne under Navy & Personal | No Comments »