<br><br><div class="gmail_quote">2009/11/15 Yuen Hoe Lim <span dir="ltr"><<a href="mailto:yuenhoe86@gmail.com">yuenhoe86@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br>
<br>
So I've been doing some work with PlasMate's publisher widget, and was<br>
wondering what is the correct way to do a zip (afaik plasmoid packages<br>
are basically zipped archives right?). Right now I'm basically calling<br>
a 'zip -r', my code looks like this:<br>
<br>
QStringList argv("zip");<br>
argv.append("-r");<br>
argv.append(targetFile.path());<br>
argv.append(".");<br>
KProcess p;<br>
p.setProgram(argv);<br>
p.setWorkingDirectory(toExport.path());<br>
p.execute();<br>
<br>
Is this an acceptable approach? In particular does this have<br>
portability issues and such?<br>
<br>
Thanks :)<br>
<font color="#888888">--<br>
----<br>
Jason "moofang" Lim Yuen Hoe<br>
<a href="http://yuenhoe.co.cc/" target="_blank">http://yuenhoe.co.cc/</a><br>
_______________________________________________<br>
Plasma-devel mailing list<br>
<a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/plasma-devel" target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br>
</font></blockquote></div><br><br clear="all">Well, imho this is not the way to go.<br>There's no control for the actual existence of the zip executable and probably you should have used KStandardDirs for the executable path.<br>
Anyway I do not think we should go for executable when we have already a consistent api for archives.<br>You should use the KZip/KArchive api: <a href="http://api.kde.org/4.x-api/kdelibs-apidocs/kio/html/classKArchive.html">http://api.kde.org/4.x-api/kdelibs-apidocs/kio/html/classKArchive.html</a>. This way we assure portability without checking any executable existence.<br>
<br>Cheers :)<br>-- <br>Alessandro Diaferia<br>KDE Developer<br>KDE e.V. member<br><br>