*******************************************************************************/
/*!
\file XdxfDictDownloader.cpp
+ \brief XdxfDictDownloader is responsible for getting dict list from XDXF website
+ and other actions necessary to download and add dictionary
+
\author Mateusz Półrola <mateusz.polrola@comarch.com>
*/
#include <QDebug>
#include <QProcess>
#include <bzlib.h>
-#include <libtar.h>
#include <stdio.h>
#include <fcntl.h>
+#ifndef Q_WS_MAEMO_5
+ #include <libtar.h>
+#endif
+
+
typedef void BZFILE;
+
XdxfDictDownloader::XdxfDictDownloader(QObject *parent) :
QObject(parent) {
parentDialog = 0;
QRegExp regInner("<tr>.*</tr>");
regInner.setMinimal(true);
int pos = 0;
-
+ dicts.clear();
while ((pos = regInner.indexIn(page, pos)) != -1) {
DownloadDict temp = DownloadDict(regInner.cap(0));
if(!temp.fromLang().isEmpty())
progressDialog->show();
QString url = selectDialog.link();
-
_fileName = url.split('/').last();
QProcess clean;
int bufflen = 100;
char buff[bufflen];
while(err == BZ_OK) {
- int len = BZ2_bzRead(&err, afterbzFile, buff, bufflen);
+ unsigned int len = BZ2_bzRead(&err, afterbzFile, buff, bufflen);
if(fwrite(buff, 1, len, tarfile) != len)
return false;
}
if(err == -1)
return false;
- err = tar_extract_all(t, "/tmp/mdict/");
+ char text[]={"/tmp/mdict/"};
+ err = tar_extract_all(t,text);
if(err == -1) {
return false;
}