---------------------------------------------------------------
| 450 | |
| 451 | // --------------------------------------------------------------- |
| 452 | int PackageDialog::extractFile(QFile& PkgFile, Q_UINT32 Count, QDir& currDir) |
| 453 | { |
| 454 | char *p = (char*)malloc(Count); |
| 455 | PkgFile.read(p, Count); |
| 456 | QByteArray Content = qUncompress((unsigned char*)p, Count); |
| 457 | free(p); |
| 458 | |
| 459 | p = Content.data(); |
| 460 | QFile File(currDir.absoluteFilePath(QString(p))); |
| 461 | if(!File.open(QIODevice::WriteOnly)) { |
| 462 | MsgText->append(tr("ERROR: Cannot create file \"%1\"!").arg(QString(p))); |
| 463 | return -1; |
| 464 | } |
| 465 | |
| 466 | File.write(p+strlen(p)+1, Content.size()-strlen(p)-1); |
| 467 | File.close(); |
| 468 | MsgText->append(tr("Create file \"%1\"").arg(QString(p))); |
| 469 | return 1; |
| 470 | } |
| 471 | |
| 472 | // --------------------------------------------------------------- |
| 473 | int PackageDialog::extractLibrary(QFile& PkgFile, Q_UINT32 Count) |