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

Function pathToPrivateDataDirectory

src/shared/shared.cpp:1232–1259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1230}
1231
1232QString pathToPrivateDataDirectory() {
1233 // first we need to find the translation directory
1234 // if this is run from the build tree, we try a path that can only work within the build directory
1235 // then, we try the expected install location relative to the main binary
1236 const auto binaryDirPath = QApplication::applicationDirPath();
1237
1238 // our helper tools are not shipped in usr/bin but usr/lib/<arch>-linux-gnu/appimagelauncher
1239 // therefore we need to check for the translations directory relative to this directory as well
1240 // as <arch-linux-gnu> may not be used in the path, we also check for its parent directory
1241 QString dataDir = binaryDirPath + "/../../share/appimagelauncher/";
1242
1243 if (!QDir(dataDir).exists()) {
1244 dataDir = binaryDirPath + "/../../../share/appimagelauncher/";
1245 }
1246
1247 // this directory should work for the main application in usr/bin
1248 if (!QDir(dataDir).exists()) {
1249 dataDir = binaryDirPath + "/../share/appimagelauncher/";
1250 }
1251
1252 if (!QDir(dataDir).exists()) {
1253 std::cerr << "[AppImageLauncher] Warning: "
1254 << "Path to private data directory could not be found" << std::endl;
1255 return "";
1256 }
1257
1258 return dataDir;
1259}
1260
1261bool unregisterAppImage(const QString& pathToAppImage) {
1262 auto rv = appimage_unregister_in_system(pathToAppImage.toStdString().c_str(), false);

Callers 2

getTranslationDirMethod · 0.85
loadIconWithFallbackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected