Dominique Leuenberger 2015-02-25 01:15:57 +00:00 committed by Git OBS Bridge
parent 0333cc164f
commit 91c09b564d
4 changed files with 266 additions and 6 deletions

View File

@ -0,0 +1,36 @@
From: Sune Vuorela <sune@vuorela.dk>
Date: Sun, 15 Feb 2015 21:51:44 +0000
Subject: Change creation date to a fixed date
X-Git-Url: http://quickgit.kde.org/?p=qt%2Fqttools.git&a=commitdiff&h=d1e639a800a105f4611c87f024664559c7d33aaa
---
Change creation date to a fixed date
Encoding the dates makes reproducing the output impossible, and doesn't
really have much gain. It most of the time not relevant when something
was built, but more 'what was built' and 'with what tools was it built'
In this case, the creation date isn't read by any thing, so it is likely
just filler data.
Keep the key anyways to not break any third party readers of the file
and set a fixed date, in this case the same date as used for a fixed
date in QtCore's QLibraryInfo::buildDate function at noon.
Change-Id: I560e43dfce538e2f25c3cf51482b946a7cfa179e
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
---
--- a/src/assistant/help/qhelpgenerator.cpp
+++ b/src/assistant/help/qhelpgenerator.cpp
@@ -369,9 +369,7 @@
d->query->exec(QLatin1String("INSERT INTO MetaDataTable VALUES('qchVersion', '1.0')"));
- d->query->prepare(QLatin1String("INSERT INTO MetaDataTable VALUES('CreationDate', ?)"));
- d->query->bindValue(0, QDateTime::currentDateTime().toString(Qt::ISODate));
- d->query->exec();
+ d->query->exec(QLatin1String("INSERT INTO MetaDataTable VALUES('CreationDate', '2012-12-20T12:00:00')"));
return true;
}

View File

@ -1,8 +1,21 @@
-------------------------------------------------------------------
Fri Feb 20 19:07:14 UTC 2015 - buschmann23@opensuse.org
- added libQt5Sql5-sqlite to the Requires for libqt5-qttools, because
qhelpgenerator needs it to work, what is not automatically recognized by rpm
-------------------------------------------------------------------
Thu Feb 19 03:32:04 UTC 2015 - hrvoje.senjan@gmail.com
- Add qdbusviewer-restore-the-window-size-and-state-on-startup.patch
and change-creation-date-to-a-fixed-date.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jan 12 03:49:34 UTC 2015 - liujianfeng1994@gmail.com Mon Jan 12 03:49:34 UTC 2015 - liujianfeng1994@gmail.com
- Add fix-for-opensuse-qmake-qt5.patch - Add fix-for-opensuse-qmake-qt5.patch
* Fix lupdate can't find qmake configuration file default (rh#1009893) * Fix lupdate can't find qmake configuration file default (rh#1009893)
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Dec 10 11:00:12 UTC 2014 - hrvoje.senjan@gmail.com Wed Dec 10 11:00:12 UTC 2014 - hrvoje.senjan@gmail.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package libqt5-qttools # spec file for package libqt5-qttools
# #
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -35,10 +35,12 @@ Source11: designer5.desktop
Source12: linguist5.desktop Source12: linguist5.desktop
Source13: assistant5.desktop Source13: assistant5.desktop
Source14: qdbusviewer5.desktop Source14: qdbusviewer5.desktop
# PATCH-FIX-OPENSUSE fix-for-opensuse-qmake-qt5.patch [rh#1009893] liujianfeng1994@gmail.com # PATCH-FIX-OPENSUSE fix-for-opensuse-qmake-qt5.patch [rh#1009893] liujianfeng1994@gmail.com
Patch1: fix-for-opensuse-qmake-qt5.patch Patch0: fix-for-opensuse-qmake-qt5.patch
# PATCH-FIX-UPSTREAM qdbusviewer-restore-the-window-size-and-state-on-startup.patch -- qdbusviewer: Restore the window size and state on startup
Patch1: qdbusviewer-restore-the-window-size-and-state-on-startup.patch
# PATCH-FIX-UPSTREAM change-creation-date-to-a-fixed-date.patch
Patch2: change-creation-date-to-a-fixed-date.patch
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: libQt5WebKitWidgets-devel >= %{version} BuildRequires: libQt5WebKitWidgets-devel >= %{version}
BuildRequires: libqt5-qtbase-devel >= %{version} BuildRequires: libqt5-qtbase-devel >= %{version}
@ -46,6 +48,7 @@ BuildRequires: libqt5-qtbase-private-headers-devel >= %{version}
BuildRequires: libqt5-qtdeclarative-private-headers-devel >= %{version} BuildRequires: libqt5-qtdeclarative-private-headers-devel >= %{version}
BuildRequires: libxslt-devel BuildRequires: libxslt-devel
BuildRequires: update-desktop-files BuildRequires: update-desktop-files
Requires: libQt5Sql5-sqlite
Recommends: libqt5-linguist Recommends: libqt5-linguist
%if %qt5_snapshot %if %qt5_snapshot
#to create the forwarding headers #to create the forwarding headers
@ -62,8 +65,9 @@ This package contains base tools, like string, xml, and network handling.
%prep %prep
%setup -q -n qttools-opensource-src-%{real_version} %setup -q -n qttools-opensource-src-%{real_version}
%patch0 -p0
%patch1 -p0 %patch1 -p1
%patch2 -p1
%package devel %package devel
Summary: Qt Development Kit Summary: Qt Development Kit

View File

@ -0,0 +1,207 @@
From: Alexander Volkov <a.volkov@rusbitech.ru>
Date: Mon, 22 Sep 2014 12:12:45 +0000
Subject: qdbusviewer: Restore the window size and state on startup
---
qdbusviewer: Restore the window size and state on startup
Save the window size, maximization state and state of splitters
on exit and restore these settings on startup.
Change-Id: Ibe26b09cc97ffc2fef17e6e8e2b804324dae7002
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
---
--- a/src/qdbus/qdbusviewer/main.cpp
+++ b/src/qdbus/qdbusviewer/main.cpp
@@ -40,6 +40,10 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+
+ QCoreApplication::setOrganizationName(QStringLiteral("QtProject"));
+ QCoreApplication::setApplicationName(QStringLiteral("QDBusViewer"));
+
MainWindow mw;
#ifndef Q_OS_MAC
app.setWindowIcon(QIcon(QLatin1String(":/qt-project.org/qdbusviewer/images/qdbusviewer.png")));
--- a/src/qdbus/qdbusviewer/mainwindow.cpp
+++ b/src/qdbus/qdbusviewer/mainwindow.cpp
@@ -51,6 +51,7 @@
#include <QtWidgets/QMessageBox>
#include <QtDBus/QDBusConnection>
+#include <QtCore/QSettings>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
@@ -72,10 +73,17 @@ MainWindow::MainWindow(QWidget *parent)
tabWidget = new QTabWidget;
setCentralWidget(tabWidget);
- QDBusViewer *sessionBusViewer = new QDBusViewer(QDBusConnection::sessionBus());
- QDBusViewer *systemBusViewer = new QDBusViewer(QDBusConnection::systemBus());
+ sessionBusViewer = new QDBusViewer(QDBusConnection::sessionBus());
+ systemBusViewer = new QDBusViewer(QDBusConnection::systemBus());
tabWidget->addTab(sessionBusViewer, tr("Session Bus"));
tabWidget->addTab(systemBusViewer, tr("System Bus"));
+
+ restoreSettings();
+}
+
+MainWindow::~MainWindow()
+{
+ saveSettings();
}
void MainWindow::addCustomBusTab(const QString &busAddress)
@@ -99,3 +107,37 @@ void MainWindow::about()
box.setWindowTitle(tr("D-Bus Viewer"));
box.exec();
}
+
+static inline QString windowGeometryKey() { return QStringLiteral("WindowGeometry"); }
+static inline QString sessionTabGroup() { return QStringLiteral("SessionTab"); }
+static inline QString systemTabGroup() { return QStringLiteral("SystemTab"); }
+
+void MainWindow::saveSettings()
+{
+ QSettings settings;
+
+ settings.setValue(windowGeometryKey(), saveGeometry());
+
+ settings.beginGroup(sessionTabGroup());
+ sessionBusViewer->saveState(&settings);
+ settings.endGroup();
+
+ settings.beginGroup(systemTabGroup());
+ systemBusViewer->saveState(&settings);
+ settings.endGroup();
+}
+
+void MainWindow::restoreSettings()
+{
+ QSettings settings;
+
+ restoreGeometry(settings.value(windowGeometryKey()).toByteArray());
+
+ settings.beginGroup(sessionTabGroup());
+ sessionBusViewer->restoreState(&settings);
+ settings.endGroup();
+
+ settings.beginGroup(systemTabGroup());
+ systemBusViewer->restoreState(&settings);
+ settings.endGroup();
+}
--- a/src/qdbus/qdbusviewer/mainwindow.h
+++ b/src/qdbus/qdbusviewer/mainwindow.h
@@ -46,11 +46,14 @@
QT_FORWARD_DECLARE_CLASS(QTabWidget)
+class QDBusViewer;
+
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
+ ~MainWindow();
void addCustomBusTab(const QString &bus);
@@ -58,7 +61,12 @@
void about();
private:
+ void saveSettings();
+ void restoreSettings();
+
QTabWidget *tabWidget;
+ QDBusViewer *sessionBusViewer;
+ QDBusViewer *systemBusViewer;
};
#endif // MAINWINDOW_H
--- a/src/qdbus/qdbusviewer/qdbusviewer.cpp
+++ b/src/qdbus/qdbusviewer/qdbusviewer.cpp
@@ -40,6 +40,7 @@
#include <QtCore/QStringListModel>
#include <QtCore/QSortFilterProxyModel>
#include <QtCore/QMetaProperty>
+#include <QtCore/QSettings>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QListView>
#include <QtWidgets/QAction>
@@ -103,13 +104,13 @@
connect(refreshShortcut, SIGNAL(activated()), this, SLOT(refreshChildren()));
QVBoxLayout *layout = new QVBoxLayout(this);
- QSplitter *topSplitter = new QSplitter(Qt::Vertical, this);
+ topSplitter = new QSplitter(Qt::Vertical, this);
layout->addWidget(topSplitter);
log = new LogViewer;
connect(log, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl)));
- QSplitter *splitter = new QSplitter(topSplitter);
+ splitter = new QSplitter(topSplitter);
splitter->addWidget(servicesView);
QWidget *servicesWidget = new QWidget;
@@ -144,6 +145,21 @@
objectPathRegExp.setMinimal(true);
+}
+
+static inline QString topSplitterStateKey() { return QStringLiteral("topSplitterState"); }
+static inline QString splitterStateKey() { return QStringLiteral("splitterState"); }
+
+void QDBusViewer::saveState(QSettings *settings) const
+{
+ settings->setValue(topSplitterStateKey(), topSplitter->saveState());
+ settings->setValue(splitterStateKey(), splitter->saveState());
+}
+
+void QDBusViewer::restoreState(const QSettings *settings)
+{
+ topSplitter->restoreState(settings->value(topSplitterStateKey()).toByteArray());
+ splitter->restoreState(settings->value(splitterStateKey()).toByteArray());
}
void QDBusViewer::logMessage(const QString &msg)
--- a/src/qdbus/qdbusviewer/qdbusviewer.h
+++ b/src/qdbus/qdbusviewer/qdbusviewer.h
@@ -46,6 +46,8 @@
QT_FORWARD_DECLARE_CLASS(QTextBrowser)
QT_FORWARD_DECLARE_CLASS(QDomDocument)
QT_FORWARD_DECLARE_CLASS(QDomElement)
+QT_FORWARD_DECLARE_CLASS(QSplitter)
+QT_FORWARD_DECLARE_CLASS(QSettings)
struct BusSignature
{
@@ -58,6 +60,9 @@
Q_OBJECT
public:
QDBusViewer(const QDBusConnection &connection, QWidget *parent = 0);
+
+ void saveState(QSettings *settings) const;
+ void restoreState(const QSettings *settings);
public slots:
void refresh();
@@ -94,6 +99,8 @@
QLineEdit *serviceFilterLine;
QListView *servicesView;
QTextBrowser *log;
+ QSplitter *topSplitter;
+ QSplitter *splitter;
QRegExp objectPathRegExp;
};