| 91 | } |
| 92 | |
| 93 | bool SLAVLogic::needToOverwriteBaseInstall() { |
| 94 | // case 1: we run from temp installation and CurrentChannel != BaseChannel || CurrentVersion>=BaseVersion |
| 95 | QString apppath = qApp->applicationDirPath(); |
| 96 | QString workdir = QDir::currentPath(); |
| 97 | if(workdir.endsWith("install_temp")) { |
| 98 | QDir parent_dir(workdir); |
| 99 | if(!parent_dir.cdUp()) { |
| 100 | qDebug() << "Cd up from temp install dir fails"; |
| 101 | return false; |
| 102 | } |
| 103 | AppVersionManifest parent_dir_manifest; |
| 104 | if(QFile::exists(parent_dir.filePath("project.manifest"))) { |
| 105 | QFile manifest_contents(parent_dir.filePath("project.manifest")); |
| 106 | if(!manifest_contents.open(QFile::ReadOnly)) { |
| 107 | qDebug() << "Cannot open parent dir manifest"; |
| 108 | return false; |
| 109 | } |
| 110 | if(!loadFrom(parent_dir_manifest,manifest_contents.readAll())) { |
| 111 | qDebug() << "Failed to parse manifest contents"; |
| 112 | parent_dir_manifest.buildFromFileSystem(parent_dir.path()); |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | AppVersionManifest current_manifest; |
| 117 | QString manifest_path = workdir + "/project.manifest"; |
| 118 | if(QFile::exists(manifest_path)) { |
| 119 | QFile manifest_contents(manifest_path); |
| 120 | if(!manifest_contents.open(QFile::ReadOnly)) { |
| 121 | qDebug() << "Cannot open parent dir manifest"; |
| 122 | return false; |
| 123 | } |
| 124 | if(!loadFrom(current_manifest,manifest_contents.readAll())) { |
| 125 | qDebug() << "Failed to parse manifest contents"; |
| 126 | } |
| 127 | } |
| 128 | current_manifest.buildFromFileSystem(workdir); |
| 129 | return false; |
| 130 | } |
| 131 | |
| 132 | void SLAVLogic::createBackupIfNeeded() |
| 133 | { |
nothing calls this directly
no test coverage detected