diff options
author | Maurice Kalinowski <maurice.kalinowski@nokia.com> | 2011-04-08 16:53:35 +0200 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@nokia.com> | 2011-04-08 16:53:35 +0200 |
commit | 6431cc7a539973e756fbcb2a56cfe72f031b8b48 (patch) | |
tree | 86dd213d372a326a0d8a5c63f5146de08061756b /tools/repocompare/mainwindow.h | |
parent | ff837125c11be52dcfa11d2c070bced5d6728fac (diff) |
add repocompare
this is a little helper tool comparing to different repositories
and checks for updates. It nominates components which can be
updated and warns about potential errors.
Diffstat (limited to 'tools/repocompare/mainwindow.h')
-rw-r--r-- | tools/repocompare/mainwindow.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/tools/repocompare/mainwindow.h b/tools/repocompare/mainwindow.h new file mode 100644 index 000000000..40b03cf2d --- /dev/null +++ b/tools/repocompare/mainwindow.h @@ -0,0 +1,84 @@ +/************************************************************************** +** +** This file is part of Qt SDK** +** +** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).* +** +** Contact: Nokia Corporation qt-info@nokia.com** +** +** No Commercial Usage +** +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception version +** 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you are unsure which license is appropriate for your use, please contact +** (qt-info@nokia.com). +** +**************************************************************************/ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include <QtCore/QTemporaryFile> +#include <QtCore/QUrl> +#include <QtCore/QDate> +#include <QtCore/QString> +#include <QtCore/QMap> +#include <QtGui/QMainWindow> +#include <QtNetwork/QNetworkAccessManager> + +namespace Ui { + class MainWindow; +} + +struct RepositoryDescription { + QString version; + QDate releaseDate; + QString checksum; + QString updateText; +}; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + + void compareRepositories(); + +public slots: + void receiveRepository(QNetworkReply* reply); + void getProductionRepository(); + void getUpdateRepository(); + void createExportFile(); + +private: + void createRepositoryMap(const QByteArray &data, QMap<QString, RepositoryDescription> &map); + + Ui::MainWindow *ui; + QTemporaryFile productionFile; + QTemporaryFile updateFile; + QNetworkReply *productionReply; + QNetworkReply *updateReply; + QNetworkAccessManager *manager; + QMap<QString, RepositoryDescription> productionMap; + QMap<QString, RepositoryDescription> updateMap; +}; + +#endif // MAINWINDOW_H |