[Gambas-user] Beta testing - Photo organizer.

T Lee Davidson t.lee.davidson at gmail.com
Mon Oct 31 20:59:32 CET 2022

On 10/30/22 19:11, Martin wrote:
>  > The application now launches with no errors. But, I am unable to test 
>  > it any further because selecting "Computer" from the drop-down does
>  > not show devices and Dialog.SelectDirectory does not allow for
>  > entering a location manually. I would need to enter a location using
>  > Media Transfer Protocol (MTP).
> What graphics library is the desktop you are using based on? GTK, QT other? I'm using Manjaro GTK then I see the devices on the 
> dialog box. maybe if you are using qt based try to switch to to "qt" components.

I use KDE which defaults to Qt5 since there is no Qt4 installed. I changed the graphical component to gb.gtk3. The GTK3 dialog 
shows devices including the MTP-based device although it could not open it for whatever reason. A USB device could be selected 
and opened. Qt5's selection dialog seems to be lacking.

The regular expression method I used to parse out the distro string seems to be simpler. The string output of:
Shell "cat /etc/[A-Za-z]*[_-][rv]e[lr]*" To sDistro
is stored by Gambas with the quotation marks escaped with a backslash. To get a usable distro name, I changed the parsing 
algorithm of System.Distro() thus:
   Shell "cat /etc/[A-Za-z]*[_-][rv]e[lr]*" To sDistro
   aDistro = Split(sDistro, "\n")

   If aDistro.Count > 0 Then
     For Each sText In aDistro
       If InStr(sText, "=") > 0 Then
         sTag = Split(sText, "=")[0]
         sVal = Split(sText, "=")[1]
         If sTag = "ID" Then
           sDistro = Split(Trim(Lower(sVal)), "-")[0]
           sDistro = Replace(sDistro, "\"", "")

The filename of the shared libexif library on my system is 'libexif.so.12'. I had to change line 30 in Meta.module like so:
Library "libexif:12"

After making the above changes, the program works as expected.

BTW, System.Distro() is being called a second time unnecessarily because sDistro is not being passed to System.PkgStat at line 
58 of FMain.Form_Open().


More information about the User mailing list