helloSystem / Filer

A file manager that can also render the desktop
GNU General Public License v2.0
32 stars 8 forks source link

.app bundles within mounted .zip archives are not recognized #47

Closed probonopd closed 3 years ago

probonopd commented 3 years ago

Now that we are mounting, rather than extracting, archives and images including .zip files I wonder why .app bundles within mounted .zip files don't seem to get treated as such:

image

As soon as one copies the .app out of the archive (and refreshes the window), it works as intended.

(The application can be executed just fine from the mounted archive, it is just not treated correctly by Filer.)

probonopd commented 3 years ago

For the extracted one it correctly says:

probono: checkWhetherAppDirOrBundle "/home/user/Desktop/Falkon.app"
probono: AppDir/app bundle detected xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx /home/user/Desktop/Falkon.app
probono: Set different icon for AppDir/app bundle

For the mounted one it doesn't:

probono: checkWhetherAppDirOrBundle "/var/run/user/1001/_home_user_Desktop_Falkon_FreeBSD.zip/Falkon.app"

So the bug might be lingering somewhere in

https://github.com/helloSystem/Filer/blob/69149a39fb300f04c0669270d434abbd35de8e24/libfm-qt/bundle.cpp#L15-L56

or in

https://github.com/helloSystem/Filer/blob/69149a39fb300f04c0669270d434abbd35de8e24/libfm-qt/foldermodelitem.cpp#L34-L46

But where?

probonopd commented 3 years ago

Turns out that Qt QFile exists() seems to return false for files in mounted archives for whatever reason.

probonopd commented 3 years ago

QFile::exists((QFileInfo(...).canonicalFilePath())) works.

probonopd commented 3 years ago

Much better!

image