mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Move QgsHistoryEntry to separate file
This commit is contained in:
parent
d5cd4c99fc
commit
e84ce19706
69
python/gui/auto_generated/history/qgshistoryentry.sip.in
Normal file
69
python/gui/auto_generated/history/qgshistoryentry.sip.in
Normal file
@ -0,0 +1,69 @@
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/gui/history/qgshistoryentry.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
|
||||
class QgsHistoryEntry
|
||||
{
|
||||
%Docstring(signature="appended")
|
||||
Encapsulates a history entry.
|
||||
|
||||
.. versionadded:: 3.24
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "qgshistoryentry.h"
|
||||
%End
|
||||
public:
|
||||
|
||||
QgsHistoryEntry();
|
||||
%Docstring
|
||||
Constructor for an invalid entry.
|
||||
%End
|
||||
|
||||
QgsHistoryEntry( const QString &providerId, const QDateTime ×tamp, const QVariantMap &entry );
|
||||
%Docstring
|
||||
Constructor for QgsHistoryEntry ``entry``, with the specified ``providerId`` and ``timestamp``.
|
||||
%End
|
||||
|
||||
QgsHistoryEntry( const QVariantMap &entry );
|
||||
%Docstring
|
||||
Constructor for QgsHistoryEntry ``entry``.
|
||||
|
||||
The entry timestamp will be automatically set to the current date/time.
|
||||
%End
|
||||
|
||||
bool isValid() const;
|
||||
%Docstring
|
||||
Returns ``True`` if the entry is valid.
|
||||
|
||||
.. versionadded:: 3.32
|
||||
%End
|
||||
|
||||
QDateTime timestamp;
|
||||
|
||||
QString providerId;
|
||||
|
||||
QVariantMap entry;
|
||||
|
||||
SIP_PYOBJECT __repr__();
|
||||
%MethodCode
|
||||
const QString str = QStringLiteral( "<QgsHistoryEntry: %1 %2>" ).arg( sipCpp->providerId, sipCpp->timestamp.toString( Qt::ISODate ) );
|
||||
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
|
||||
%End
|
||||
|
||||
};
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/gui/history/qgshistoryentry.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
@ -10,58 +10,6 @@
|
||||
|
||||
|
||||
|
||||
class QgsHistoryEntry
|
||||
{
|
||||
%Docstring(signature="appended")
|
||||
Encapsulates a history entry.
|
||||
|
||||
.. versionadded:: 3.24
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "qgshistoryproviderregistry.h"
|
||||
%End
|
||||
public:
|
||||
|
||||
QgsHistoryEntry();
|
||||
%Docstring
|
||||
Constructor for an invalid entry.
|
||||
%End
|
||||
|
||||
QgsHistoryEntry( const QString &providerId, const QDateTime ×tamp, const QVariantMap &entry );
|
||||
%Docstring
|
||||
Constructor for QgsHistoryEntry ``entry``, with the specified ``providerId`` and ``timestamp``.
|
||||
%End
|
||||
|
||||
QgsHistoryEntry( const QVariantMap &entry );
|
||||
%Docstring
|
||||
Constructor for QgsHistoryEntry ``entry``.
|
||||
|
||||
The entry timestamp will be automatically set to the current date/time.
|
||||
%End
|
||||
|
||||
bool isValid() const;
|
||||
%Docstring
|
||||
Returns ``True`` if the entry is valid.
|
||||
|
||||
.. versionadded:: 3.32
|
||||
%End
|
||||
|
||||
QDateTime timestamp;
|
||||
|
||||
QString providerId;
|
||||
|
||||
QVariantMap entry;
|
||||
|
||||
SIP_PYOBJECT __repr__();
|
||||
%MethodCode
|
||||
const QString str = QStringLiteral( "<QgsHistoryEntry: %1 %2>" ).arg( sipCpp->providerId, sipCpp->timestamp.toString( Qt::ISODate ) );
|
||||
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
|
||||
%End
|
||||
|
||||
};
|
||||
|
||||
|
||||
class QgsHistoryProviderRegistry : QObject
|
||||
{
|
||||
%Docstring(signature="appended")
|
||||
|
@ -341,6 +341,7 @@
|
||||
%Include auto_generated/effects/qgspainteffectpropertieswidget.sip
|
||||
%Include auto_generated/effects/qgspainteffectwidget.sip
|
||||
%Include auto_generated/elevation/qgselevationprofilecanvas.sip
|
||||
%Include auto_generated/history/qgshistoryentry.sip
|
||||
%Include auto_generated/history/qgshistoryprovider.sip
|
||||
%Include auto_generated/history/qgshistoryproviderregistry.sip
|
||||
%Include auto_generated/labeling/qgslabellineanchorwidget.sip
|
||||
|
@ -236,6 +236,7 @@ set(QGIS_GUI_SRCS
|
||||
elevation/qgselevationprofilecanvas.cpp
|
||||
elevation/qgselevationprofilelayertreeview.cpp
|
||||
|
||||
history/qgshistoryentry.cpp
|
||||
history/qgshistoryprovider.cpp
|
||||
history/qgshistoryproviderregistry.cpp
|
||||
|
||||
@ -1142,6 +1143,7 @@ set(QGIS_GUI_HDRS
|
||||
elevation/qgselevationprofilecanvas.h
|
||||
elevation/qgselevationprofilelayertreeview.h
|
||||
|
||||
history/qgshistoryentry.h
|
||||
history/qgshistoryprovider.h
|
||||
history/qgshistoryproviderregistry.h
|
||||
|
||||
|
37
src/gui/history/qgshistoryentry.cpp
Normal file
37
src/gui/history/qgshistoryentry.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
/***************************************************************************
|
||||
qgshistoryentry.cpp
|
||||
-------------------------
|
||||
begin : April 2019
|
||||
copyright : (C) 2019 by Nyall Dawson
|
||||
email : nyall dot dawson at gmail dot com
|
||||
***************************************************************************/
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgshistoryentry.h"
|
||||
|
||||
QgsHistoryEntry::QgsHistoryEntry( const QString &providerId, const QDateTime ×tamp, const QVariantMap &entry )
|
||||
: timestamp( timestamp )
|
||||
, providerId( providerId )
|
||||
, entry( entry )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QgsHistoryEntry::QgsHistoryEntry( const QVariantMap &entry )
|
||||
: timestamp( QDateTime::currentDateTime() )
|
||||
, entry( entry )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool QgsHistoryEntry::isValid() const
|
||||
{
|
||||
return !providerId.isEmpty();
|
||||
}
|
88
src/gui/history/qgshistoryentry.h
Normal file
88
src/gui/history/qgshistoryentry.h
Normal file
@ -0,0 +1,88 @@
|
||||
/***************************************************************************
|
||||
qgshistoryentry.h
|
||||
--------------------------
|
||||
begin : April 2019
|
||||
copyright : (C) 2019 by Nyall Dawson
|
||||
email : nyall dot dawson at gmail dot com
|
||||
***************************************************************************/
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
#ifndef QGSHISTORYENTRY_H
|
||||
#define QGSHISTORYENTRY_H
|
||||
|
||||
#include "qgis_gui.h"
|
||||
#include "qgis_sip.h"
|
||||
#include "qgis.h"
|
||||
|
||||
#include <QMap>
|
||||
#include <QString>
|
||||
#include <QDateTime>
|
||||
#include <QVariant>
|
||||
|
||||
/**
|
||||
* Encapsulates a history entry.
|
||||
*
|
||||
* \ingroup gui
|
||||
* \since QGIS 3.24
|
||||
*/
|
||||
class GUI_EXPORT QgsHistoryEntry
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor for an invalid entry.
|
||||
*/
|
||||
QgsHistoryEntry() = default;
|
||||
|
||||
/**
|
||||
* Constructor for QgsHistoryEntry \a entry, with the specified \a providerId and \a timestamp.
|
||||
*/
|
||||
QgsHistoryEntry( const QString &providerId, const QDateTime ×tamp, const QVariantMap &entry );
|
||||
|
||||
/**
|
||||
* Constructor for QgsHistoryEntry \a entry.
|
||||
*
|
||||
* The entry timestamp will be automatically set to the current date/time.
|
||||
*/
|
||||
QgsHistoryEntry( const QVariantMap &entry );
|
||||
|
||||
/**
|
||||
* Returns TRUE if the entry is valid.
|
||||
*
|
||||
* \since QGIS 3.32
|
||||
*/
|
||||
bool isValid() const;
|
||||
|
||||
//! Entry timestamp
|
||||
QDateTime timestamp;
|
||||
|
||||
//! Associated history provider ID
|
||||
QString providerId;
|
||||
|
||||
/**
|
||||
* Entry details.
|
||||
*
|
||||
* Entries details are stored as a free-form map. Interpretation of this map is the responsibility of the
|
||||
* associated history provider.
|
||||
*/
|
||||
QVariantMap entry;
|
||||
|
||||
#ifdef SIP_RUN
|
||||
SIP_PYOBJECT __repr__();
|
||||
% MethodCode
|
||||
const QString str = QStringLiteral( "<QgsHistoryEntry: %1 %2>" ).arg( sipCpp->providerId, sipCpp->timestamp.toString( Qt::ISODate ) );
|
||||
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
|
||||
% End
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE( QgsHistoryEntry );
|
||||
|
||||
#endif // QGSHISTORYENTRY
|
@ -15,44 +15,17 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgshistoryproviderregistry.h"
|
||||
#include "history/qgshistoryprovider.h"
|
||||
#include "qgshistoryprovider.h"
|
||||
#include "qgsapplication.h"
|
||||
#include "qgsruntimeprofiler.h"
|
||||
#include "qgslogger.h"
|
||||
#include "qgsxmlutils.h"
|
||||
#include "qgsprocessinghistoryprovider.h"
|
||||
#include "qgshistoryentry.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <sqlite3.h>
|
||||
|
||||
//
|
||||
// QgsHistoryEntry
|
||||
//
|
||||
|
||||
QgsHistoryEntry::QgsHistoryEntry( const QString &providerId, const QDateTime ×tamp, const QVariantMap &entry )
|
||||
: timestamp( timestamp )
|
||||
, providerId( providerId )
|
||||
, entry( entry )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QgsHistoryEntry::QgsHistoryEntry( const QVariantMap &entry )
|
||||
: timestamp( QDateTime::currentDateTime() )
|
||||
, entry( entry )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool QgsHistoryEntry::isValid() const
|
||||
{
|
||||
return !providerId.isEmpty();
|
||||
}
|
||||
|
||||
//
|
||||
// QgsHistoryProviderRegistry
|
||||
//
|
||||
|
||||
QgsHistoryProviderRegistry::QgsHistoryProviderRegistry( QObject *parent, bool useMemoryDatabase )
|
||||
: QObject( parent )
|
||||
{
|
||||
|
@ -30,66 +30,7 @@
|
||||
#include "qgssqliteutils.h"
|
||||
|
||||
class QgsAbstractHistoryProvider;
|
||||
|
||||
/**
|
||||
* Encapsulates a history entry.
|
||||
*
|
||||
* \ingroup gui
|
||||
* \since QGIS 3.24
|
||||
*/
|
||||
class GUI_EXPORT QgsHistoryEntry
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor for an invalid entry.
|
||||
*/
|
||||
QgsHistoryEntry() = default;
|
||||
|
||||
/**
|
||||
* Constructor for QgsHistoryEntry \a entry, with the specified \a providerId and \a timestamp.
|
||||
*/
|
||||
QgsHistoryEntry( const QString &providerId, const QDateTime ×tamp, const QVariantMap &entry );
|
||||
|
||||
/**
|
||||
* Constructor for QgsHistoryEntry \a entry.
|
||||
*
|
||||
* The entry timestamp will be automatically set to the current date/time.
|
||||
*/
|
||||
QgsHistoryEntry( const QVariantMap &entry );
|
||||
|
||||
/**
|
||||
* Returns TRUE if the entry is valid.
|
||||
*
|
||||
* \since QGIS 3.32
|
||||
*/
|
||||
bool isValid() const;
|
||||
|
||||
//! Entry timestamp
|
||||
QDateTime timestamp;
|
||||
|
||||
//! Associated history provider ID
|
||||
QString providerId;
|
||||
|
||||
/**
|
||||
* Entry details.
|
||||
*
|
||||
* Entries details are stored as a free-form map. Interpretation of this map is the responsibility of the
|
||||
* associated history provider.
|
||||
*/
|
||||
QVariantMap entry;
|
||||
|
||||
#ifdef SIP_RUN
|
||||
SIP_PYOBJECT __repr__();
|
||||
% MethodCode
|
||||
const QString str = QStringLiteral( "<QgsHistoryEntry: %1 %2>" ).arg( sipCpp->providerId, sipCpp->timestamp.toString( Qt::ISODate ) );
|
||||
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
|
||||
% End
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE( QgsHistoryEntry );
|
||||
class QgsHistoryEntry;
|
||||
|
||||
/**
|
||||
* The QgsHistoryProviderRegistry is a registry for objects which track user history (i.e. operations performed through the GUI).
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "qgsapplication.h"
|
||||
#include "qgsgui.h"
|
||||
#include "qgshistoryproviderregistry.h"
|
||||
#include "qgssettings.h"
|
||||
#include "qgshistoryentry.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
|
@ -61,6 +61,7 @@
|
||||
#include "qgshistoryproviderregistry.h"
|
||||
#include "qgslayermetadatasourceselectprovider.h"
|
||||
#include "qgssensorguiregistry.h"
|
||||
#include "qgshistoryentry.h"
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QToolButton>
|
||||
|
Loading…
x
Reference in New Issue
Block a user