Menu

#1023 Modules of type tab_page_status do not work

1.2
closed
nobody
None
5
2016-12-08
2016-08-27
AL89
No

Hi,

I'm trying to use modules which add info to the status bar, but without luck (I want to write my own module to display the number of pages in PDF files, but first I need a working example).

I tried with both the link target module in the LXDE wiki (http://wiki.lxde.org/en/Extension_modules_for_LibFM) and the image size module linked at the bottom of the same page.
I can compile both, but they seem to be completely ignored at runtime by PCManFM, i.e the status bar does not display any additional info when image or link files are selected. I added some dummy printf() here and there, but none of them gets actually printed.

My configuration:
Ubuntu 16.04
PCManFM 1.2.4 (from repositories)
libFM 1.2.4 (from repositories)
Modules are placed in /usr/lib/x86_64-linux-gnu/pcmanfm/
(I also tried with /usr/lib/x86_64-linux-gnu/libfm/modules/, doesn't make any difference)

I don't know how to investigate the problem further. Can you give me any advice?

Discussion

  • Lonely Stranger

    Lonely Stranger - 2016-08-27

    Try doing export G_MESSAGES_DEBUG=all before running pcmanfm (as recommended by http://wiki.lxde.org/en/LXDE:PCManFM_build_and_setup_guide), then debug messages like DEBUG: scanning modules directory /usr/lib/x86_64-linux-gnu/pcmanfm/ should appear, look if your module is found and loaded (a message DEBUG: found handler tab_page_status:your_module_key will be shown if so).

     
  • Lonely Stranger

    Lonely Stranger - 2016-12-03
    • status: open --> moreinfoneed
     
  • Lonely Stranger

    Lonely Stranger - 2016-12-03
    • status: moreinfoneed --> moreinfoneeded
     
  • AL89

    AL89 - 2016-12-07

    Thanks for the suggestion, it was very helpful: the module was found but the handler was not found (looks like I was missing a library at linking time).
    The plugin for PDF page number is available here: https://github.com/alessandro-g89/pcmanfm-statusbar-pdf-pages.

     
    • Lonely Stranger

      Lonely Stranger - 2016-12-08

      Glad you could find the source of your problem. Using -Wl,-z,defs as it was suggestted on Wiki would reveal missing library right away. BTW, your module has a serious flaw - each time it was used by statusbar, it will consume more and more memory. That is called "memory leak".

       
      • AL89

        AL89 - 2016-12-10

        Thank you for pointing it out, it should be fixed now. What fooled me is the fact that poppler-glib does not provide an explicit function to destroy a created document. I resorted to using g_object_unref() for this purpose.

         
        • Lonely Stranger

          Lonely Stranger - 2016-12-10

          Note that fm_path_to_uri() returned value also should be freed. :)
          And right, it you looked into retrospection, PopplerDocument is a GObject, so no special function should be implemented to unref it.

           

          Last edit: Lonely Stranger 2016-12-10
          • AL89

            AL89 - 2016-12-12

            Thanks again. I fixed that and made other minor changes.

             
  • Lonely Stranger

    Lonely Stranger - 2016-12-08
    • status: moreinfoneeded --> closed
     

Anonymous
Anonymous

Add attachments
Cancel