Android bulding guide
David Faure
faure at kde.org
Sat May 6 09:21:09 UTC 2017
On jeudi 4 mai 2017 17:19:57 CEST Fernando Theirs wrote:
> Hi everyone!
>
> I'm working with Qt and I have to port a Linux application to Android.
> Basically I need to manage some compressed files (targz, zip, among others)
> and in Qt Forum they recommend me to use KArchive.
>
> I started working with Qt only a year ago and I'm still a rookie. I could
> not find binaries for this library and the source code uses CMake (I was
> expecting a .pro :/) so it's getting really hard for me to get it work.
>
> Asking to the same guy that recommended me the library and following his
> indications I could compile KArchive for Linux and I'm testing it but I
> can't understand very well the documentation.
>
> 1) Using KTar I could create a tar.gz with two txt files with the following
> code:
>
> QString input = "/home/ferni/QtBuild/KArchiveTest/testTar.txt";
> QString input2 = "/home/ferni/QtBuild/KArchiveTest/testTar2.txt";
> QString output = "/home/ferni/QtBuild/KArchiveTest/testTar.tar.gz";
>
> KTar archive(output, "application/x-gzip");
> // Prepare the archive for writing.
> if (!archive.open(QIODevice::ReadOnly)) {
Don't you mean WriteOnly here?
> // Failed to open file.
> return 1;
> }
>
> // Create or open an archive
> archive.addLocalFile(input, input);
> archive.addLocalFile(input2, input2);
> archive.close();
>
> My question is: how can I decompress the file that I created?
Using KTar again, this time with ReadOnly ;-)
See the KArchive API (base class for KTar).
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
More information about the Kde-frameworks-devel
mailing list