comparison ui/mainwindow.cpp @ 82:1f27d6db5ee3

Polarssl based certificate handling
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 19 Mar 2014 18:04:14 +0000
parents 7e304573ebd1
children c0fdb8d336cf
comparison
equal deleted inserted replaced
81:112228bd7e4b 82:1f27d6db5ee3
77 QString swFileName = mSettings.value("Software/available").toString(); 77 QString swFileName = mSettings.value("Software/available").toString();
78 78
79 if (!listFileName.isEmpty()) { 79 if (!listFileName.isEmpty()) {
80 mListToInstall.readList(listFileName.toLocal8Bit().constData()); 80 mListToInstall.readList(listFileName.toLocal8Bit().constData());
81 if (!mListToInstall.isValid()) { 81 if (!mListToInstall.isValid()) {
82 mCurState = TransferError;
82 // Probably a bug when Qt fileName is encoded and cFileName 83 // Probably a bug when Qt fileName is encoded and cFileName
83 // fails because of this. This needs a unit test! 84 // fails because of this. This needs a unit test!
84 // Maybe check that the file is in our data directory 85 // Maybe check that the file is in our data directory
85 QFile::remove(listFileName); 86 QFile::remove(listFileName);
86 mSettings.remove("List/available"); 87 mSettings.remove("List/available");
110 /* TODO: Error count. Error handling. Otherwise 111 /* TODO: Error count. Error handling. Otherwise
111 * we can go into an endless loop here */ 112 * we can go into an endless loop here */
112 113
113 /* Retry the download again in 10 - 20 minutes */ 114 /* Retry the download again in 10 - 20 minutes */
114 QTimer::singleShot(600000 + (qrand() % 60000), this, SLOT(checkUpdates())); 115 QTimer::singleShot(600000 + (qrand() % 60000), this, SLOT(checkUpdates()));
116 } else {
117 mCurMessage = tr("An updated certificate list is available. Click here to install.");
118 setState(NewListAvailable);
119 showMessage();
115 } 120 }
116 mCurMessage = tr("An updated certificate list is available. Click here to install.");
117 setState(NewListAvailable);
118 showMessage();
119 } 121 }
120 122
121 void MainWindow::handleNewSW(const QString& fileName, const QDateTime& modDate) { 123 void MainWindow::handleNewSW(const QString& fileName, const QDateTime& modDate) {
122 mCurMessage = tr("An update for %1 is available. Click here to install.").arg( 124 mCurMessage = tr("An update for %1 is available. Click here to install.").arg(
123 QApplication::applicationName()); 125 QApplication::applicationName());

http://wald.intevation.org/projects/trustbridge/