| 265 | } |
| 266 | |
| 267 | bool MainWindow::unpackArchive(const QString &archiveName) |
| 268 | { |
| 269 | // Unpack archive |
| 270 | QStringList args; |
| 271 | #ifdef Q_OS_WIN |
| 272 | /* On Windows --force-local is necessary because tar wants to connect to a remote system |
| 273 | * when a colon is found in the archiveName. So "C:/Users/blah/triage/package" would not work |
| 274 | * without it. */ |
| 275 | args << "--force-local"; |
| 276 | #endif |
| 277 | if (archiveName.endsWith(".tar.gz")) |
| 278 | args << "-xzvf"; |
| 279 | else if (archiveName.endsWith(".tar.bz2")) |
| 280 | args << "-xjvf"; |
| 281 | else if (archiveName.endsWith(".tar.xz")) |
| 282 | args << "-xJvf"; |
| 283 | else { |
| 284 | // Try to automatically find an (un)compressor for this archive |
| 285 | args << "-xavf"; |
| 286 | } |
| 287 | args << archiveName; |
| 288 | |
| 289 | return runProcess("tar", args); |
| 290 | } |
| 291 | |
| 292 | void MainWindow::showResult(QListWidgetItem *item) |
| 293 | { |