MCPcopy Create free account
hub / github.com/TheAssassin/AppImageLauncher / buildPathToIntegratedAppImage

Function buildPathToIntegratedAppImage

src/shared/shared.cpp:472–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470}
471
472QString buildPathToIntegratedAppImage(const QString& pathToAppImage) {
473 // if type 2 AppImage, we can build a "content-aware" filename
474 // see #7 for details
475 auto digest = getAppImageDigestMd5(pathToAppImage);
476
477 const QFileInfo appImageInfo(pathToAppImage);
478
479 QString baseName = appImageInfo.completeBaseName();
480
481 // if digest is available, append a separator
482 if (!digest.isEmpty()) {
483 const auto digestSuffix = "_" + digest;
484
485 // check whether digest is already contained in filename
486 if (!pathToAppImage.contains(digestSuffix))
487 baseName += "_" + digest;
488 }
489
490 auto fileName = baseName;
491
492 // must not use completeSuffix() in combination with completeBasename(), otherwise the final filename is composed
493 // incorrectly
494 if (!appImageInfo.suffix().isEmpty()) {
495 fileName += "." + appImageInfo.suffix();
496 }
497
498 return integratedAppImagesDestination().path() + "/" + fileName;
499}
500
501std::map<std::string, std::string> findCollisions(const QString& currentNameEntry) {
502 std::map<std::string, std::string> collisions{};

Callers 3

execMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 3

getAppImageDigestMd5Function · 0.85
pathMethod · 0.80

Tested by

no test coverage detected