Giter Site home page Giter Site logo

Comments (4)

probonopd avatar probonopd commented on September 24, 2024

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

bool checkWhetherAppDirOrBundle(FmFileInfo* _info)
{
bool isAppDirOrBundle = false;
if((fm_file_info_is_dir(_info) || fm_file_info_is_symlink(_info)) == false) {
return(isAppDirOrBundle);
}
QString path = QString(fm_path_to_str(fm_file_info_get_path(_info)));
qDebug() << "probono: checkWhetherAppDirOrBundle" << path.toUtf8();
QFileInfo fileInfo = QFileInfo(path);
QString nameWithoutSuffix = QFileInfo(fileInfo.completeBaseName()).fileName();
// Check whether we have a GNUstep .app bundle
if (path.toLower().endsWith(".app")) {
// TODO: Before falling back to foo.app/foo, parse the Info-gnustep.plist/Info.plist and get the NSExecutable from there
// as described in http://www.gnustep.org/resources/documentation/Developer/Gui/ProgrammingManual/AppKit_1.html
QFile executableFile(path.toUtf8() + "/" + nameWithoutSuffix);
if (executableFile.exists() && QFileInfo(executableFile).isExecutable()) {
isAppDirOrBundle = true;
}
}
// Check whether we have a macOS .app bundle
if (path.toLower().endsWith(".app")) {
QFile infoPlistFIle(path.toUtf8() + "/Contents/Info.plist");
QFile resourcesDirectory(path.toUtf8() + "/Contents/Resources");
if (infoPlistFIle.exists() && resourcesDirectory.exists()) {
isAppDirOrBundle = true;
}
}
// Check whether we have a ROX AppDir
QFile appRunFile(path.toUtf8() + "/AppRun");
if ((appRunFile.exists()) && QFileInfo(appRunFile).isExecutable()) {
isAppDirOrBundle = true;
}
return(isAppDirOrBundle);
}

or in

bool isAppDirOrBundle = checkWhetherAppDirOrBundle(_info);
icon = IconTheme::icon(fm_file_info_get_icon(_info));
// probono: Set some things differently for AppDir/app bundle than for normal folder
if(isAppDirOrBundle) {
QString path = QString(fm_path_to_str(fm_file_info_get_path(info)));
QFileInfo fileInfo = QFileInfo(path);
QString nameWithoutSuffix = QFileInfo(fileInfo.completeBaseName()).fileName();
qDebug("probono: AppDir/app bundle detected xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx " + path.toUtf8());

But where?

from filer.

probonopd avatar probonopd commented on September 24, 2024

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

from filer.

probonopd avatar probonopd commented on September 24, 2024

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

from filer.

probonopd avatar probonopd commented on September 24, 2024

Much better!

image

from filer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.