11 DownloadDict(QString html) {
12 QRegExp reg("<td.*>(.*)</td>");
16 while ((pos = reg.indexIn(html, pos)) != -1) {
18 pos += reg.matchedLength();
23 QString sizeStr = tmp.at(3);
25 _size = sizeStr.remove(',').toInt();
27 _size = _size / 1024 / 1024;
29 _size = round(_size*1000) / 1000;
31 QRegExp lreg("href=\"(.*)\"");
32 lreg.setMinimal(true);
33 lreg.indexIn(tmp.at(2));
34 _link = lreg.capturedTexts().at(1);
37 QString fromLang() const {return _from;}
38 QString toLang() const {return _to;}
39 QString title() const {return _title;}
40 float size() const {return _size;}
41 QString link() const {return _link;}
43 bool operator <(DownloadDict other) const {
44 if(_from < other.fromLang()) return true;
45 if(_from > other.fromLang()) return false;
46 if(_to < other.toLang()) return true;
51 QString _from, _to, _title, _link;
56 #endif // DOWNLOADDICT_H