comparison ui/mainwindow.cpp @ 17:c12825a651ed

Read out content-length and use this to skip existing files
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 19 Feb 2014 14:22:26 +0000
parents 225a5ec20dad
children 9af6198deb8e
comparison
equal deleted inserted replaced
16:225a5ec20dad 17:c12825a651ed
99 QApplication::applicationName()); 99 QApplication::applicationName());
100 setState(NewSoftwareAvailable); 100 setState(NewSoftwareAvailable);
101 mSettings.setValue("Software/available", fileName); 101 mSettings.setValue("Software/available", fileName);
102 mSettings.setValue("Software/availableDate", modDate); 102 mSettings.setValue("Software/availableDate", modDate);
103 103
104 qDebug() << "Settings value: " << mSettings.value("Software/available");
105 mSettings.sync(); 104 mSettings.sync();
106 showMessage(); 105 showMessage();
107 } 106 }
108 107
109 void MainWindow::checkUpdates() 108 void MainWindow::checkUpdates()
110 { 109 {
111 verifyAvailableData(); 110 verifyAvailableData();
112 111
113 QDateTime listAvailableLastMod = mSettings.value("List/availableDate").toDateTime(); 112 QDateTime listInstalledLastMod = mSettings.value("List/installedDate").toDateTime();
114 QDateTime swAvailableLastMod = mSettings.value("Software/availableDate").toDateTime(); 113 QDateTime swInstalledLastMod = mSettings.value("Software/installedDate").toDateTime();
115
116 if (!listAvailableLastMod.isValid()) {
117 listAvailableLastMod = mSettings.value("List/installedLastMod").toDateTime();
118 }
119
120 if (!swAvailableLastMod.isValid()) {
121 swAvailableLastMod = mSettings.value("List/installedLastMod").toDateTime();
122 }
123 114
124 Downloader* downloader = new Downloader(this, QString::fromLatin1("www.files.kolab.org"), 115 Downloader* downloader = new Downloader(this, QString::fromLatin1("www.files.kolab.org"),
125 QByteArray(), swAvailableLastMod, listAvailableLastMod); 116 QByteArray(), swInstalledLastMod, listInstalledLastMod);
117
126 connect(downloader, SIGNAL(newListAvailable(const QString&, const QDateTime&)), 118 connect(downloader, SIGNAL(newListAvailable(const QString&, const QDateTime&)),
127 this, SLOT(handleNewList(const QString&, const QDateTime&))); 119 this, SLOT(handleNewList(const QString&, const QDateTime&)));
128 connect(downloader, SIGNAL(newSoftwareAvailable(const QString&, const QDateTime&)), 120 connect(downloader, SIGNAL(newSoftwareAvailable(const QString&, const QDateTime&)),
129 this, SLOT(handleNewSW(const QString&, const QDateTime&))); 121 this, SLOT(handleNewSW(const QString&, const QDateTime&)));
130 connect(downloader, SIGNAL(finished()), downloader, SLOT(deleteLater())); 122 connect(downloader, SIGNAL(finished()), downloader, SLOT(deleteLater()));

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