Hi Raj!
I ended up using quazip as well. I just looked it up in my old code - direct reading works like this:
QString zipName
= QFileDialog::getOpenFileName(this,
"Convis DB Import",
"",
"Zip-File (*.zip)");
QuaZip zip(zipName);
if(!zip.open(QuaZip::mdUnzip))
{Maintenance_PTE
->appendPlainText
(QString("Import: zip open error: %1").
arg(zip.
getZipError()));return;
} if (!zip.setCurrentFile("entries.txt"))
{Maintenance_PTE
->appendPlainText
(QString("Zip entries.txt error: %1").
arg(zip.
getZipError()));return;
} QuaZipFile inFile(&zip);
if (!inFile.
open(QIODevice::ReadOnly)) {Maintenance_PTE
->appendPlainText
(QString("Import entries error: %1").
arg(inFile.
getZipError()));return;
} {
...
inFile.close();
}
zip.close();
QString zipName = QFileDialog::getOpenFileName(this, "Convis DB Import", "", "Zip-File (*.zip)");
QuaZip zip(zipName);
if(!zip.open(QuaZip::mdUnzip))
{Maintenance_PTE->appendPlainText(QString("Import: zip open error: %1").arg(zip.getZipError()));return;}
if (!zip.setCurrentFile("entries.txt"))
{Maintenance_PTE->appendPlainText(QString("Zip entries.txt error: %1").arg(zip.getZipError()));return;}
QuaZipFile inFile(&zip);
if (!inFile.open(QIODevice::ReadOnly)) {Maintenance_PTE->appendPlainText(QString("Import entries error: %1").arg(inFile.getZipError()));return;}
{
QTextStream ts(&inFile);
...
inFile.close();
}
zip.close();
To copy to clipboard, switch view to plain text mode
HIH
Joh
Bookmarks