From: Bartosz Szatkowski Date: Tue, 5 Oct 2010 11:13:03 +0000 (+0200) Subject: Fixed downloaded dict untar on Maemo X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=fbef91e6b3590a9693b78d45858495c1f2d8f8b7;p=mdictionary Fixed downloaded dict untar on Maemo --- diff --git a/debian/mdictionary.install b/debian/mdictionary.install index 80cb872..b67ebf1 100644 --- a/debian/mdictionary.install +++ b/debian/mdictionary.install @@ -7,4 +7,4 @@ usr/lib/mdictionary/plugins/eng-us.xdxf usr/lib/mdictionary/plugins/eng-thai.xdxf usr/share/mdictionary/xdxf.png usr/share/mdictionary/css/ -usr/share/applications/mdictionary.desktop +usr/share/applications/hildon/mdictionary.desktop diff --git a/src/plugins/xdxf/XdxfDictDownloader.cpp b/src/plugins/xdxf/XdxfDictDownloader.cpp index 38066f4..4cdb4eb 100644 --- a/src/plugins/xdxf/XdxfDictDownloader.cpp +++ b/src/plugins/xdxf/XdxfDictDownloader.cpp @@ -27,6 +27,8 @@ #include "XdxfDictDownloader.h" #include "XdxfDictDownloadProgressDialog.h" #include +#include + #include #include @@ -201,6 +203,7 @@ bool XdxfDictDownloader::extract(QString file) { fclose(archive); // Extracting tar + #ifndef Q_WS_MAEMO_5 TAR *t; char * tarfname = new char[file.replace(QRegExp(".bz2%"), "").size()+1]; strcpy(tarfname, file.replace(QRegExp(".bz2%"), "").toStdString().c_str()); @@ -214,6 +217,11 @@ bool XdxfDictDownloader::extract(QString file) { return false; } tar_close(t); + #else + QProcess tar; + tar.start("tar -xvf " + file.replace(QRegExp(".bz2%"), "") + " -C /tmp/mdict"); + tar.waitForFinished(-1); + #endif return true; }