equal
deleted
inserted
replaced
70 if(url.host().isEmpty()) |
70 if(url.host().isEmpty()) |
71 finalUrl = QUrl("http://www.hedgewars.org" + url.path()); |
71 finalUrl = QUrl("http://www.hedgewars.org" + url.path()); |
72 else |
72 else |
73 finalUrl = url; |
73 finalUrl = url; |
74 |
74 |
75 if(url.path().endsWith(".hwp")) |
75 if(url.path().endsWith(".hwp") || url.path().endsWith(".zip")) |
76 { |
76 { |
77 qWarning() << "Download Request" << url.toString(); |
77 qWarning() << "Download Request" << url.toString(); |
78 QString fileName = QFileInfo(url.toString()).fileName(); |
78 QString fileName = QFileInfo(url.toString()).fileName(); |
79 |
79 |
80 QNetworkRequest newRequest(finalUrl); |
80 QNetworkRequest newRequest(finalUrl); |
136 |
136 |
137 QDir extractDir(*cfgdir); |
137 QDir extractDir(*cfgdir); |
138 extractDir.cd("Data"); |
138 extractDir.cd("Data"); |
139 |
139 |
140 QString fileName = extractDir.filePath(QFileInfo(reply->url().path()).fileName()); |
140 QString fileName = extractDir.filePath(QFileInfo(reply->url().path()).fileName()); |
|
141 if(fileName.endsWith(".zip")) |
|
142 fileName = fileName.left(fileName.length() - 4) + ".hwp"; |
141 |
143 |
142 QFile out(fileName); |
144 QFile out(fileName); |
143 if(!out.open(QFile::WriteOnly)) |
145 if(!out.open(QFile::WriteOnly)) |
144 { |
146 { |
145 qWarning() << "out.open():" << out.errorString(); |
147 qWarning() << "out.open():" << out.errorString(); |