Work on updating...
This commit is contained in:
parent
ce8d020415
commit
e06fb13ed3
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<releases>
|
<releases>
|
||||||
<release version="1.9.9.5" type="maintenance">
|
<release version="1.9.9.5" type="maintenance" platform="x86" os="OS2">
|
||||||
<url platform="x86" os="OS2">https://bitbucket.org/skunkos/rssguard/downloads/rssguard-1.9.9.5-os2.7z</url>
|
<url>https://bitbucket.org/skunkos/rssguard/downloads/rssguard-1.9.9.5-os2.7z</url>
|
||||||
<changes>
|
<changes>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
<ul>
|
<ul>
|
||||||
@ -17,8 +17,8 @@
|
|||||||
]]>
|
]]>
|
||||||
</changes>
|
</changes>
|
||||||
</release>
|
</release>
|
||||||
<release version="1.9.9.5" type="maintenance">
|
<release version="1.9.9.5" type="maintenance" platform="x86" os="Windows">
|
||||||
<url platform="x86" os="Windows">https://bitbucket.org/skunkos/rssguard/downloads/rssguard-1.9.9.5-win32.7z</url>
|
<url>https://bitbucket.org/skunkos/rssguard/downloads/rssguard-1.9.9.5-win32.7z</url>
|
||||||
<changes>
|
<changes>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QDomDocument>
|
||||||
|
#include <QDomElement>
|
||||||
|
#include <QDomAttr>
|
||||||
|
|
||||||
|
|
||||||
QPointer<SystemFactory> SystemFactory::s_instance;
|
QPointer<SystemFactory> SystemFactory::s_instance;
|
||||||
@ -148,6 +151,29 @@ bool SystemFactory::setAutoStartStatus(const AutoStartStatus &new_status) {
|
|||||||
QList<UpdateInfo> SystemFactory::parseUpdatesFile(const QByteArray &updates_file) {
|
QList<UpdateInfo> SystemFactory::parseUpdatesFile(const QByteArray &updates_file) {
|
||||||
QList<UpdateInfo> updates;
|
QList<UpdateInfo> updates;
|
||||||
|
|
||||||
|
QDomDocument document; document.setContent(updates_file, false);
|
||||||
|
QDomNodeList releases = document.elementsByTagName("release");
|
||||||
|
|
||||||
|
for (int i = 0; i < releases.size(); i++) {
|
||||||
|
UpdateInfo info;
|
||||||
|
QDomElement rel_elem = releases.at(0).toElement();
|
||||||
|
QString type = rel_elem.attributes().namedItem("type").toAttr().value();
|
||||||
|
|
||||||
|
info.m_availableVersion = rel_elem.attributes().namedItem("version").toAttr().value();
|
||||||
|
info.m_changes = rel_elem.namedItem("changes").toElement().text();
|
||||||
|
info.m_fileUrl = rel_elem.namedItem("url").toElement().text();
|
||||||
|
info.m_os = rel_elem.attributes().namedItem("os").toAttr().value();
|
||||||
|
info.m_platform = rel_elem.attributes().namedItem("platform").toAttr().value();
|
||||||
|
|
||||||
|
if (type == "maintenance") {
|
||||||
|
info.m_type = UpdateInfo::Maintenance;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
info.m_type = UpdateInfo::Evolution;
|
||||||
|
}
|
||||||
|
|
||||||
|
updates.append(info);
|
||||||
|
}
|
||||||
|
|
||||||
return updates;
|
return updates;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class UpdateInfo {
|
|||||||
QString m_changes;
|
QString m_changes;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(UpdateInfo);
|
Q_DECLARE_METATYPE(UpdateInfo)
|
||||||
|
|
||||||
class SystemFactory : public QObject {
|
class SystemFactory : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -43,7 +43,7 @@ void FormUpdate::checkForUpdates() {
|
|||||||
|
|
||||||
foreach (const UpdateInfo &release, releases_list) {
|
foreach (const UpdateInfo &release, releases_list) {
|
||||||
m_ui->m_cmbAvailableRelease->comboBox()->addItem(release.m_availableVersion,
|
m_ui->m_cmbAvailableRelease->comboBox()->addItem(release.m_availableVersion,
|
||||||
release);
|
QVariant::fromValue(release));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user