MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / unpackArchive

Method unpackArchive

tools/triage/mainwindow.cpp:267–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267bool 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
292void MainWindow::showResult(QListWidgetItem *item)
293{

Callers

nothing calls this directly

Calls 1

endsWithMethod · 0.80

Tested by

no test coverage detected