| 1230 | } |
| 1231 | |
| 1232 | QString 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 | |
| 1261 | bool unregisterAppImage(const QString& pathToAppImage) { |
| 1262 | auto rv = appimage_unregister_in_system(pathToAppImage.toStdString().c_str(), false); |
no outgoing calls
no test coverage detected