| 129 | } |
| 130 | |
| 131 | QUrl ProvisioningInfo::addPluginToInstall(const QString &file) |
| 132 | { |
| 133 | QUrl pluginUrl(file); |
| 134 | if (!pluginUrl.isValid()) |
| 135 | { |
| 136 | MITK_WARN << "The plugin URL " << file.toStdString() << " is invalid:" << pluginUrl.errorString().toStdString(); |
| 137 | return QUrl(); |
| 138 | } |
| 139 | |
| 140 | QFileInfo fileInfo(pluginUrl.toLocalFile()); |
| 141 | if (!fileInfo.exists()) |
| 142 | { |
| 143 | QString fileName = fileInfo.fileName(); |
| 144 | QString filePath = fileInfo.absolutePath(); |
| 145 | if (!intermediateOutDir.isEmpty()) |
| 146 | { |
| 147 | // search in the intermediate output dir |
| 148 | QString filePath2 = filePath + "/" + intermediateOutDir; |
| 149 | fileInfo = QFileInfo(filePath2 + "/" + fileName); |
| 150 | if (!fileInfo.exists()) |
| 151 | { |
| 152 | MITK_WARN << "The plugin " << fileName.toStdString() << " was not found in " << filePath.toStdString() |
| 153 | << " or " << filePath2.toStdString(); |
| 154 | return QUrl(); |
| 155 | } |
| 156 | pluginUrl = QUrl::fromLocalFile(fileInfo.canonicalFilePath()); |
| 157 | pluginDirs.insert(fileInfo.canonicalPath()); |
| 158 | } |
| 159 | else |
| 160 | { |
| 161 | MITK_WARN << "The plugin " << fileName.toStdString() << " was not found in " << filePath.toStdString(); |
| 162 | return QUrl(); |
| 163 | } |
| 164 | } |
| 165 | else |
| 166 | { |
| 167 | pluginDirs.insert(fileInfo.canonicalPath()); |
| 168 | } |
| 169 | |
| 170 | pluginsToInstall.append(pluginUrl); |
| 171 | return pluginUrl; |
| 172 | } |
| 173 | |
| 174 | void ProvisioningInfo::addPluginToStart(const QString &file) |
| 175 | { |
no test coverage detected