| 25 | } |
| 26 | |
| 27 | void PackageManager::extractPackage(const QString &packagePath, const QString &destDir) |
| 28 | { |
| 29 | QStringList attributes; |
| 30 | QString output = "-o"; |
| 31 | output += destDir; |
| 32 | attributes << "x" |
| 33 | << "-y" << output << packagePath; |
| 34 | _7z = new QProcess(); |
| 35 | connect(_7z, SIGNAL(error(QProcess::ProcessError)), this, SLOT(openingError(QProcess::ProcessError))); |
| 36 | connect(_7z, SIGNAL(finished(int, QProcess::ExitStatus)), this, SIGNAL(imported())); |
| 37 | #if defined Q_OS_UNIX && !defined Q_OS_MACOS |
| 38 | _7z->start("7z", attributes); // TODO: use 7z.so |
| 39 | #else |
| 40 | _7z->start(QCoreApplication::applicationDirPath() + "/utils/7zip", attributes); // TODO: use 7z.dll |
| 41 | #endif |
| 42 | } |
| 43 | |
| 44 | void PackageManager::cancel() |
| 45 | { |