Skip to content
Permalink
Browse files

Rename QgsFieldKit to QgsFieldFormatter

  • Loading branch information
m-kuhn committed Dec 20, 2016
1 parent f294201 commit 22c492e6e585b814565470829c5c708a031d34ab
Showing with 341 additions and 341 deletions.
  1. +4 −4 doc/api_break.dox
  2. +1 −1 python/CMakeLists.txt
  3. +9 −9 python/core/core.sip
  4. +4 −4 python/core/{fieldkit/qgsdatetimefieldkit.sip → fieldformatter/qgsdatetimefieldformatter.sip}
  5. +9 −0 python/core/fieldformatter/qgsfallbackfieldformatter.sip
  6. +4 −4 python/core/{fieldkit/qgskeyvaluefieldkit.sip → fieldformatter/qgskeyvaluefieldformatter.sip}
  7. +4 −4 python/core/{fieldkit/qgslistfieldkit.sip → fieldformatter/qgslistfieldformatter.sip}
  8. +3 −3 ...ieldkit/qgsrelationreferencefieldkit.sip → fieldformatter/qgsrelationreferencefieldformatter.sip}
  9. +4 −4 python/core/{fieldkit/qgsvaluemapfieldkit.sip → fieldformatter/qgsvaluemapfieldformatter.sip}
  10. +6 −6 .../core/{fieldkit/qgsvaluerelationfieldkit.sip → fieldformatter/qgsvaluerelationfieldformatter.sip}
  11. +0 −9 python/core/fieldkit/qgsfallbackfieldkit.sip
  12. +2 −2 python/core/qgsapplication.sip
  13. +5 −5 python/core/{qgsfieldkit.sip → qgsfieldformatter.sip}
  14. +10 −10 python/core/{qgsfieldkitregistry.sip → qgsfieldformatterregistry.sip}
  15. +3 −3 src/app/qgisapp.cpp
  16. +3 −3 src/app/qgsattributetypedialog.cpp
  17. +3 −3 src/app/qgsidentifyresultsdialog.cpp
  18. +19 −19 src/core/CMakeLists.txt
  19. +6 −6 src/core/{fieldkit/qgsdatetimefieldkit.cpp → fieldformatter/qgsdatetimefieldformatter.cpp}
  20. +4 −4 src/core/{fieldkit/qgsdatetimefieldkit.h → fieldformatter/qgsdatetimefieldformatter.h}
  21. +4 −4 src/core/{fieldkit/qgsfallbackfieldkit.cpp → fieldformatter/qgsfallbackfieldformatter.cpp}
  22. +4 −4 src/core/{fieldkit/qgsfallbackfieldkit.h → fieldformatter/qgsfallbackfieldformatter.h}
  23. +5 −5 src/core/{fieldkit/qgskeyvaluefieldkit.cpp → fieldformatter/qgskeyvaluefieldformatter.cpp}
  24. +4 −4 src/core/{fieldkit/qgskeyvaluefieldkit.h → fieldformatter/qgskeyvaluefieldformatter.h}
  25. +5 −5 src/core/{fieldkit/qgslistfieldkit.cpp → fieldformatter/qgslistfieldformatter.cpp}
  26. +4 −4 src/core/{fieldkit/qgslistfieldkit.h → fieldformatter/qgslistfieldformatter.h}
  27. +6 −6 ...ieldkit/qgsrelationreferencefieldkit.cpp → fieldformatter/qgsrelationreferencefieldformatter.cpp}
  28. +4 −4 ...e/{fieldkit/qgsrelationreferencefieldkit.h → fieldformatter/qgsrelationreferencefieldformatter.h}
  29. +6 −6 src/core/{fieldkit/qgsvaluemapfieldkit.cpp → fieldformatter/qgsvaluemapfieldformatter.cpp}
  30. +4 −4 src/core/{fieldkit/qgsvaluemapfieldkit.h → fieldformatter/qgsvaluemapfieldformatter.h}
  31. +16 −16 src/core/{fieldkit/qgsvaluerelationfieldkit.cpp → fieldformatter/qgsvaluerelationfieldformatter.cpp}
  32. +5 −5 src/core/{fieldkit/qgsvaluerelationfieldkit.h → fieldformatter/qgsvaluerelationfieldformatter.h}
  33. +5 −5 src/core/qgsapplication.cpp
  34. +4 −4 src/core/qgsapplication.h
  35. +2 −2 src/core/qgseditformconfig.h
  36. +8 −8 src/core/{qgsfieldkit.cpp → qgsfieldformatter.cpp}
  37. +9 −9 src/core/{qgsfieldkit.h → qgsfieldformatter.h}
  38. +65 −0 src/core/qgsfieldformatterregistry.cpp
  39. +21 −21 src/core/{qgsfieldkitregistry.h → qgsfieldformatterregistry.h}
  40. +0 −65 src/core/qgsfieldkitregistry.cpp
  41. +1 −1 src/gui/CMakeLists.txt
  42. +11 −11 src/gui/attributetable/qgsattributetablemodel.cpp
  43. +2 −2 src/gui/attributetable/qgsattributetablemodel.h
  44. +3 −3 src/gui/editorwidgets/qgsdatetimeeditconfig.cpp
  45. +5 −5 src/gui/editorwidgets/qgsdatetimeeditwrapper.cpp
  46. +3 −3 src/gui/editorwidgets/qgsdatetimesearchwidgetwrapper.cpp
  47. +1 −1 src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp
  48. +1 −1 src/gui/editorwidgets/qgsvaluemapsearchwidgetwrapper.cpp
  49. +1 −1 src/gui/editorwidgets/qgsvaluemapwidgetwrapper.cpp
  50. +5 −5 src/gui/editorwidgets/qgsvaluerelationsearchwidgetwrapper.cpp
  51. +2 −2 src/gui/editorwidgets/qgsvaluerelationsearchwidgetwrapper.h
  52. +7 −7 src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp
  53. +2 −2 src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.h
  54. +3 −3 src/server/qgswmsserver.cpp
  55. +1 −1 tests/src/python/CMakeLists.txt
  56. +9 −9 tests/src/python/{test_qgsfieldkits.py → test_qgsfieldformatters.py}
@@ -980,10 +980,10 @@ QgsEditorWidgetFactory {#qgis_api_break_3_0_QgsEditorWidgetFactory}
from and to a QVariantMap automatically.
- `writeConfig` has been removed. The configuration is read and written
from and to a QVariantMap automatically.
- `representValue` has been removed. Use QgsFieldKit::representValue() instead
- `sortValue` has been removed. Use QgsFieldKit::representValue() instead
- `alignmentFlag` has been removed. Use QgsFieldKit::representValue() instead
- `createCache` has been removed. Use QgsFieldKit::representValue() instead
- `representValue` has been removed. Use QgsFieldFormatter::representValue() instead
- `sortValue` has been removed. Use QgsFieldFormatter::representValue() instead
- `alignmentFlag` has been removed. Use QgsFieldFormatter::representValue() instead
- `createCache` has been removed. Use QgsFieldFormatter::representValue() instead


QgsGraduatedRenderer {#qgis_api_break_3_0_QgsGraduatedRenderer}
@@ -101,7 +101,7 @@ INCLUDE_DIRECTORIES(
../src/core/composer
../src/core/diagram
../src/core/effects
../src/core/fieldkit
../src/core/fieldformatter
../src/core/dxf
../src/core/geometry
../src/core/gps
@@ -60,8 +60,8 @@
%Include qgsfield.sip
%Include qgsfieldconstraints.sip
%Include qgsfields.sip
%Include qgsfieldkitregistry.sip
%Include qgsfieldkit.sip
%Include qgsfieldformatterregistry.sip
%Include qgsfieldformatter.sip
%Include qgsgeometrysimplifier.sip
%Include qgsgeometryvalidator.sip
%Include qgsgml.sip
@@ -243,13 +243,13 @@
%Include gps/qgsnmeaconnection.sip
%Include gps/qgsqtlocationconnection.sip

%Include fieldkit/qgsdatetimefieldkit.sip
%Include fieldkit/qgsfallbackfieldkit.sip
%Include fieldkit/qgskeyvaluefieldkit.sip
%Include fieldkit/qgslistfieldkit.sip
%Include fieldkit/qgsrelationreferencefieldkit.sip
%Include fieldkit/qgsvaluemapfieldkit.sip
%Include fieldkit/qgsvaluerelationfieldkit.sip
%Include fieldformatter/qgsdatetimefieldformatter.sip
%Include fieldformatter/qgsfallbackfieldformatter.sip
%Include fieldformatter/qgskeyvaluefieldformatter.sip
%Include fieldformatter/qgslistfieldformatter.sip
%Include fieldformatter/qgsrelationreferencefieldformatter.sip
%Include fieldformatter/qgsvaluemapfieldformatter.sip
%Include fieldformatter/qgsvaluerelationfieldformatter.sip

%Include layertree/qgslayertree.sip
%Include layertree/qgslayertreegroup.sip
@@ -1,5 +1,5 @@
/***************************************************************************
qgsdatetimefieldkit.sip - QgsDateTimeFieldKit
qgsdatetimefieldformatter.sip - QgsDateTimeFieldFormatter

---------------------
begin : 2.12.2016
@@ -13,13 +13,13 @@
* (at your option) any later version. *
* *
***************************************************************************/
class QgsDateTimeFieldKit : QgsFieldKit
class QgsDateTimeFieldFormatter : QgsFieldFormatter
{
%TypeHeaderCode
#include "qgsdatetimefieldkit.h"
#include "qgsdatetimefieldformatter.h"
%End
public:
QgsDateTimeFieldKit();
QgsDateTimeFieldFormatter();

QString id() const;

@@ -0,0 +1,9 @@
class QgsFallbackFieldFormatter : QgsFieldFormatter
{
%TypeHeaderCode
#include "qgsfallbackfieldformatter.h"
%End
public:
QgsFallbackFieldFormatter();
QString id() const;
};
@@ -1,5 +1,5 @@
/***************************************************************************
qgskeyvaluefieldkit.sip - QgsKeyValueFieldKit
qgskeyvaluefieldformatter.sip - QgsKeyValueFieldFormatter

---------------------
begin : 3.12.2016
@@ -13,13 +13,13 @@
* (at your option) any later version. *
* *
***************************************************************************/
class QgsKeyValueFieldKit : QgsFieldKit
class QgsKeyValueFieldFormatter : QgsFieldFormatter
{
%TypeHeaderCode
#include "qgskeyvaluefieldkit.h"
#include "qgskeyvaluefieldformatter.h"
%End
public:
QgsKeyValueFieldKit();
QgsKeyValueFieldFormatter();
QString id() const;
QString representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const;
};
@@ -1,5 +1,5 @@
/***************************************************************************
qgslistfieldkit.sip - QgsListFieldKit
qgslistfieldformatter.sip - QgsListFieldFormatter

---------------------
begin : 3.12.2016
@@ -13,14 +13,14 @@
* (at your option) any later version. *
* *
***************************************************************************/
class QgsListFieldKit : QgsFieldKit
class QgsListFieldFormatter : QgsFieldFormatter
{
%TypeHeaderCode
#include "qgslistfieldkit.h"
#include "qgslistfieldformatter.h"
%End

public:
QgsListFieldKit();
QgsListFieldFormatter();

QString id() const;

@@ -1,10 +1,10 @@
class QgsRelationReferenceFieldKit : QgsFieldKit
class QgsRelationReferenceFieldFormatter : QgsFieldFormatter
{
%TypeHeaderCode
#include "qgsrelationreferencefieldkit.h"
#include "qgsrelationreferencefieldformatter.h"
%End
public:
QgsRelationReferenceFieldKit();
QgsRelationReferenceFieldFormatter();

QString id() const;
virtual QString representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const;
@@ -1,5 +1,5 @@
/***************************************************************************
qgsvaluemapfieldkit.sip - QgsValueMapFieldKit
qgsvaluemapfieldformatter.sip - QgsValueMapFieldFormatter

---------------------
begin : 3.12.2016
@@ -13,13 +13,13 @@
* (at your option) any later version. *
* *
***************************************************************************/
class QgsValueMapFieldKit : QgsFieldKit
class QgsValueMapFieldFormatter : QgsFieldFormatter
{
%TypeHeaderCode
#include "qgsvaluemapfieldkit.h"
#include "qgsvaluemapfieldformatter.h"
%End
public:
QgsValueMapFieldKit();
QgsValueMapFieldFormatter();

QString id() const;

@@ -1,5 +1,5 @@
/***************************************************************************
qgsvaluerelationfieldkit.sip - QgsValueRelationFieldKit
qgsvaluerelationfieldformatter.sip - QgsValueRelationFieldFormatter

---------------------
begin : 3.12.2016
@@ -13,10 +13,10 @@
* (at your option) any later version. *
* *
***************************************************************************/
class QgsValueRelationFieldKit : QgsFieldKit
class QgsValueRelationFieldFormatter : QgsFieldFormatter
{
%TypeHeaderCode
#include "qgsvaluerelationfieldkit.h"
#include "qgsvaluerelationfieldformatter.h"
%End

public:
@@ -30,9 +30,9 @@ class QgsValueRelationFieldKit : QgsFieldKit
QString value;
};

typedef QVector < QgsValueRelationFieldKit::ValueRelationItem > ValueRelationCache;
typedef QVector < QgsValueRelationFieldFormatter::ValueRelationItem > ValueRelationCache;

QgsValueRelationFieldKit();
QgsValueRelationFieldFormatter();

QString id() const;
QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
@@ -41,5 +41,5 @@ class QgsValueRelationFieldKit : QgsFieldKit

QVariant createCache( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config ) const;

static QgsValueRelationFieldKit::ValueRelationCache createCache( const QVariantMap& config );
static QgsValueRelationFieldFormatter::ValueRelationCache createCache( const QVariantMap& config );
};

This file was deleted.

@@ -399,11 +399,11 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
static QgsRuntimeProfiler* profiler();

/**
* Provides access to the field kit registry.
* Provides access to the field formatter registry.
*
* @note Added in QGIS 3.0
*/
static QgsFieldKitRegistry* fieldKitRegistry();
static QgsFieldFormatterRegistry* fieldKitRegistry();
public slots:

/** Causes the application instance to emit the settingsChanged() signal. This should
@@ -1,5 +1,5 @@
/***************************************************************************
qgsfieldkit.sip - QgsFieldKit
qgsfieldformatter.sip - QgsFieldFormatter

---------------------
begin : 2.12.2016
@@ -13,15 +13,15 @@
* (at your option) any later version. *
* *
***************************************************************************/
class QgsFieldKit
class QgsFieldFormatter
{
%TypeHeaderCode
#include "qgsfieldkit.h"
#include "qgsfieldformatter.h"
%End
public:
QgsFieldKit();
QgsFieldFormatter();

virtual ~QgsFieldKit();
virtual ~QgsFieldFormatter();

virtual QString id() const = 0;

@@ -1,5 +1,5 @@
/***************************************************************************
qgsfieldkitregistry.sip - QgsFieldKitRegistry
qgsfieldformatterregistry.sip - QgsFieldFormatterRegistry

---------------------
begin : 2.12.2016
@@ -13,24 +13,24 @@
* (at your option) any later version. *
* *
***************************************************************************/
class QgsFieldKitRegistry : QObject
class QgsFieldFormatterRegistry : QObject
{
%TypeHeaderCode
#include "qgsfieldkitregistry.h"
#include "qgsfieldformatterregistry.h"
%End
public:

QgsFieldKitRegistry();
~QgsFieldKitRegistry();
QgsFieldFormatterRegistry();
~QgsFieldFormatterRegistry();

void addFieldKit( QgsFieldKit* kit /Transfer/ );
void addFieldFormatter( QgsFieldFormatter* kit /Transfer/ );

void removeFieldKit( QgsFieldKit* kit );
void removeFieldFormatter( QgsFieldFormatter* kit );

QgsFieldKit* fieldKit( const QString& id ) const;
QgsFieldFormatter* fieldKit( const QString& id ) const;

signals:
void fieldKitAdded( QgsFieldKit* kit );
void fieldKitAdded( QgsFieldFormatter* kit );

void fieldKitRemoved( QgsFieldKit* kit );
void fieldKitRemoved( QgsFieldFormatter* kit );
};
@@ -149,8 +149,8 @@
#include "qgsfeature.h"
#include "qgsformannotationitem.h"
#include "qgsfieldcalculator.h"
#include "qgsfieldkit.h"
#include "qgsfieldkitregistry.h"
#include "qgsfieldformatter.h"
#include "qgsfieldformatterregistry.h"
#include "qgshtmlannotationitem.h"
#include "qgsgenericprojectionselector.h"
#include "qgsgpsinformationwidget.h"
@@ -6399,7 +6399,7 @@ QVariant QgisAppFieldValueConverter::convert( int idx, const QVariant& value )
return value;
}
const QgsEditorWidgetSetup setup = QgsEditorWidgetRegistry::instance()->findBest( mLayer, mLayer->fields().field( idx ).name() );
QgsFieldKit* fieldKit = QgsApplication::fieldKitRegistry()->fieldKit( setup.type() );
QgsFieldFormatter* fieldKit = QgsApplication::fieldKitRegistry()->fieldKit( setup.type() );
return fieldKit->representValue( mLayer, idx, setup.config(), QVariant(), value );
}

@@ -23,8 +23,8 @@
#include "qgisapp.h"
#include "qgsproject.h"
#include "qgslogger.h"
#include "qgsfieldkitregistry.h"
#include "qgsfieldkit.h"
#include "qgsfieldformatterregistry.h"
#include "qgsfieldformatter.h"
#include "qgseditorwidgetfactory.h"
#include "qgseditorwidgetregistry.h"

@@ -350,7 +350,7 @@ void QgsAttributeTypeDialog::defaultExpressionChanged()
return;
}

QgsFieldKit* fieldKit = QgsApplication::fieldKitRegistry()->fieldKit( editorWidgetType() );
QgsFieldFormatter* fieldKit = QgsApplication::fieldKitRegistry()->fieldKit( editorWidgetType() );

QString previewText = fieldKit->representValue( mLayer, mFieldIdx, editorWidgetConfig(), QVariant(), val );

@@ -43,8 +43,8 @@
#include "qgsstringutils.h"
#include "qgstreewidgetitem.h"
#include "qgsfiledownloader.h"
#include "qgsfieldkitregistry.h"
#include "qgsfieldkit.h"
#include "qgsfieldformatterregistry.h"
#include "qgsfieldformatter.h"

#include <QCloseEvent>
#include <QLabel>
@@ -734,7 +734,7 @@ QString QgsIdentifyResultsDialog::representValue( QgsVectorLayer* vlayer, const
QMap<QString, QVariant>& layerCaches = mWidgetCaches[vlayer->id()];

QgsEditorWidgetFactory* factory = QgsEditorWidgetRegistry::instance()->factory( setup.type() );
QgsFieldKit* fieldKit = QgsApplication::fieldKitRegistry()->fieldKit( setup.type() );
QgsFieldFormatter* fieldKit = QgsApplication::fieldKitRegistry()->fieldKit( setup.type() );

int idx = vlayer->fields().lookupField( fieldName );

0 comments on commit 22c492e

Please sign in to comment.
You can’t perform that action at this time.