I'm trying to write modules for PCManFM to read metadata from music files (ID3, vorbis comment etc.) and show them in columns. I found out that after loading a folder, such modules are invoked many times, not just once. On a folder containing about 200 mp3s, this creates a significant and sustained CPU usage.
Steps to reproduce:
1) compile attached module with make && sudo make install. You may want to edit MODULES_DIR in Makefile. TagLib C development files are needed (libtagc0-dev on Debian and derivatives);
2) close all active instances of PCManFM;
3) open PCManFM from a terminal to see debugging output, switch to column view and activate the new column named "Title";
4) navigate to a directory with many mp3s (the more, the better). Their titles should be shown in the new column. They are also printed on the terminal every time the module is invoked. At this point, if I do nothing, they're printed again about every second. If I move the pointer or scroll the list they're printed again even faster.
I experienced this on Debian Testing (version 1.2.0 installed from repository) and Lubuntu 13.10 (version 1.2.0 compiled from source). Is PCManFM supposed to do so, or am I doing something wrong?
Thanks anyway for your great work!