Mercurial > trustbridge
comparison ui/downloader.cpp @ 809:4b702f6cf9b6
Download sofware with .sh extension on linux and make it exeutable
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 15 Jul 2014 16:30:55 +0200 |
parents | 13cf42dbe9bd |
children | d1c951b3012d |
comparison
equal
deleted
inserted
replaced
808:13cf42dbe9bd | 809:4b702f6cf9b6 |
---|---|
229 return; | 229 return; |
230 } | 230 } |
231 | 231 |
232 QString fileName = dataDirectory.append("/SW-") | 232 QString fileName = dataDirectory.append("/SW-") |
233 .append(remoteModSW.toString("yyyyMMddHHmmss")) | 233 .append(remoteModSW.toString("yyyyMMddHHmmss")) |
234 #ifdef WIN32 | |
234 .append(".exe"); | 235 .append(".exe"); |
236 #else | |
237 .append(".sh"); | |
238 #endif | |
235 | 239 |
236 qDebug() << "fileName: " << fileName; | 240 qDebug() << "fileName: " << fileName; |
237 | 241 |
238 if (mDownloadSW) { | 242 if (mDownloadSW) { |
239 if (!downloadFile(mResourceSW, fileName, MAX_SW_SIZE)) { | 243 if (!downloadFile(mResourceSW, fileName, MAX_SW_SIZE)) { |
244 qDebug() << "Failed to download software update."; | |
240 return; | 245 return; |
241 } | 246 } |
247 QFile::setPermissions(fileName, QFileDevice::ReadOwner | | |
248 QFileDevice::WriteOwner | | |
249 QFileDevice::ExeOwner); | |
242 } | 250 } |
243 | 251 |
244 emit newSoftwareAvailable(fileName, remoteModSW); | 252 emit newSoftwareAvailable(fileName, remoteModSW); |
245 return; | 253 return; |
246 } | 254 } |