Skip to content

Commit 250e2a5

Browse files
committed
Merge branch 'master' of https://github.com/qgis/Quantum-GIS
2 parents 20e4ec5 + a9a289e commit 250e2a5

File tree

261 files changed

+13100
-10189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+13100
-10189
lines changed

doc/TRANSLATORS

+34-34
Large diffs are not rendered by default.

doc/osx.t2t

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
= Building on MacOS X =
32

43
In this approach I will try to avoid as much as possible building dependencies
@@ -77,6 +76,9 @@ of Xcode, regardless of using a separate DMG installer for just the tools.
7776

7877
Xcode 4.4+ also introduces the clang frontend to the LLVM compiler as default.
7978

79+
**Note:** In XCODE 4.5 installed from teh app store, you need to install the
80+
command line tools from XCode -> Preferences -> Downloads and choose command line tools.
81+
8082
http://clang.llvm.org/
8183

8284
The supplied clang version 4 can compile QGIS, but presents many warnings

i18n/qgis_de.ts

+2,374-1,885
Large diffs are not rendered by default.

python/core/conversions.sip

+78-55
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ which are not wrapped by PyQt:
1414
- QMap<TYPE1, TYPE2*>
1515
- QMap<double, TYPE>
1616
- QMultiMap<double, TYPE2>
17-
- QMap<qint64, QgsGeometry>
17+
- QMap<qint64, TYPE>
1818
- QMap<qint64, QgsOverlayObject*>
1919
- QList< QPair< QString, QList<QString> > >
2020
- QVector<TYPE*>
@@ -661,94 +661,117 @@ template<TYPE>
661661
};
662662

663663

664+
//
665+
// copied from PyQt4 QMap<int, TYPE> and adapted to qint64
666+
//
664667

665-
%MappedType QMap<qint64, QgsGeometry>
668+
// QMap<qint64, TYPE> is implemented as a Python dictionary.
669+
template<TYPE>
670+
%MappedType QMap<qint64, TYPE> /DocType="dict-of-qint64-TYPE"/
666671
{
667672
%TypeHeaderCode
668-
#include <QMap>
673+
#include <qmap.h>
669674
%End
670675

671676
%ConvertFromTypeCode
672-
// Create the list.
673-
PyObject *d;
677+
// Create the dictionary.
678+
PyObject *d = PyDict_New();
674679

675-
if ((d = PyDict_New()) == NULL)
676-
return NULL;
680+
if (!d)
681+
return NULL;
677682

678-
// Set the list elements.
679-
for (QMap<qint64, QgsGeometry>::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it)
680-
{
681-
PyObject *kobj = PyLong_FromLongLong(it.key());
682-
PyObject *tobj = sipConvertFromInstance( &it.value(), sipClass_QgsGeometry, sipTransferObj);
683+
// Set the dictionary elements.
684+
QMap<qint64, TYPE>::const_iterator i = sipCpp->constBegin();
683685

684-
if (kobj == NULL || tobj == NULL || PyDict_SetItem(d, kobj, tobj) < 0)
686+
while (i != sipCpp->constEnd())
685687
{
686-
Py_DECREF(d);
688+
TYPE *t = new TYPE(i.value());
687689

688-
if (kobj)
689-
{
690-
Py_DECREF(kobj);
691-
}
690+
PyObject *kobj = PyLong_FromLongLong(i.key());
691+
//PyObject *kobj = SIPLong_FromLong(i.key());
692+
PyObject *tobj = sipConvertFromNewType(t, sipType_TYPE, sipTransferObj);
692693

693-
if (tobj)
694-
{
694+
if (kobj == NULL || tobj == NULL || PyDict_SetItem(d, kobj, tobj) < 0)
695+
{
696+
Py_DECREF(d);
697+
698+
if (kobj)
699+
{
700+
Py_DECREF(kobj);
701+
}
702+
703+
if (tobj)
704+
{
705+
Py_DECREF(tobj);
706+
}
707+
else
708+
{
709+
delete t;
710+
}
711+
712+
return NULL;
713+
}
714+
715+
Py_DECREF(kobj);
695716
Py_DECREF(tobj);
696-
}
697717

698-
return NULL;
718+
++i;
699719
}
700720

701-
Py_DECREF(tobj);
702-
}
703-
704-
return d;
721+
return d;
705722
%End
706723

707724
%ConvertToTypeCode
708-
PyObject *kobj, *tobj;
725+
PyObject *kobj, *tobj;
726+
SIP_SSIZE_T i = 0;
709727

710-
// Check the type if that is all that is required.
711-
if (sipIsErr == NULL)
712-
{
713-
if (!PyDict_Check(sipPy))
714-
return 0;
728+
// Check the type if that is all that is required.
729+
if (sipIsErr == NULL)
730+
{
731+
if (!PyDict_Check(sipPy))
732+
return 0;
733+
734+
while (PyDict_Next(sipPy, &i, &kobj, &tobj))
735+
if (!sipCanConvertToType(tobj, sipType_TYPE, SIP_NOT_NONE))
736+
return 0;
737+
738+
return 1;
739+
}
740+
741+
QMap<qint64, TYPE> *qm = new QMap<qint64, TYPE>;
715742

716-
Py_ssize_t i = 0;
717743
while (PyDict_Next(sipPy, &i, &kobj, &tobj))
718744
{
719-
if (!sipCanConvertToInstance(tobj, sipClass_QgsGeometry, SIP_NOT_NONE))
720-
return 0;
721-
}
722-
return 1;
723-
}
745+
int state;
746+
//, k = SIPLong_AsLong(kobj);
747+
qint64 k = PyLong_AsLongLong(kobj);
748+
TYPE *t = reinterpret_cast<TYPE *>(sipConvertToType(tobj, sipType_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
724749

725-
QMap<qint64, QgsGeometry> *qm = new QMap<qint64, QgsGeometry>;
750+
if (*sipIsErr)
751+
{
752+
sipReleaseType(t, sipType_TYPE, state);
726753

727-
Py_ssize_t i = 0;
728-
while (PyDict_Next(sipPy, &i, &kobj, &tobj))
729-
{
730-
int state;
731-
qint64 k = PyLong_AsLongLong(kobj);
732-
QgsGeometry * t = reinterpret_cast<QgsGeometry*>(sipConvertToInstance(tobj, sipClass_QgsGeometry, sipTransferObj,SIP_NOT_NONE,&state,sipIsErr));
754+
delete qm;
755+
return 0;
756+
}
733757

734-
if (*sipIsErr)
735-
{
736-
sipReleaseInstance(t, sipClass_QgsGeometry, state);
737-
delete qm;
738-
return 0;
758+
qm->insert(k, *t);
759+
760+
sipReleaseType(t, sipType_TYPE, state);
739761
}
740762

741-
qm->insert(k, *t);
742-
sipReleaseInstance(t, sipClass_QgsGeometry, state);
743-
}
763+
*sipCppPtr = qm;
744764

745-
*sipCppPtr = qm;
746-
return sipGetState(sipTransferObj);
765+
return sipGetState(sipTransferObj);
747766
%End
748767
};
749768

750769

751770

771+
772+
773+
774+
752775
%MappedType QMap<QString, QVariant::Type>
753776
{
754777
%TypeHeaderCode

python/core/core.sip

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
%Include qgsdistancearea.sip
2727
%Include qgsexpression.sip
2828
%Include qgsfeature.sip
29+
%Include qgsfeatureiterator.sip
30+
%Include qgsfeaturerequest.sip
2931
%Include qgsfield.sip
3032
%Include qgsgeometry.sip
3133
%Include qgsgeometryvalidator.sip
@@ -72,6 +74,7 @@
7274
%Include qgsvectordataprovider.sip
7375
%Include qgsvectorfilewriter.sip
7476
%Include qgsvectorlayer.sip
77+
%Include qgsvectorlayereditbuffer.sip
7578
%Include qgsvectorlayerimport.sip
7679
%Include qgsvectorlayerjoinbuffer.sip
7780
%Include qgsvectorlayerundocommand.sip

python/core/diagram/qgsdiagram.sip

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ class QgsDiagram
66
public:
77
virtual ~QgsDiagram();
88
/**Draws the diagram at the given position (in pixel coordinates)*/
9-
virtual void renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ) = 0;
9+
virtual void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ) = 0;
1010
virtual QString diagramName() const = 0;
1111
/**Returns the size in map units the diagram will use to render.*/
12-
virtual QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s ) = 0;
12+
virtual QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s ) = 0;
1313
/**Returns the size in map units the diagram will use to render. Interpolate size*/
14-
virtual QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is ) = 0;
14+
virtual QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is ) = 0;
1515

1616
protected:
1717
/** Changes the pen width to match the current settings and rendering context

python/core/diagram/qgshistogramdiagram.sip

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class QgsHistogramDiagram: QgsDiagram
77
QgsHistogramDiagram();
88
~QgsHistogramDiagram();
99

10-
void renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position );
11-
QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s );
12-
QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is );
10+
void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position );
11+
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s );
12+
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is );
1313
QString diagramName() const;
1414
};

python/core/diagram/qgspiediagram.sip

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class QgsPieDiagram: QgsDiagram
77
QgsPieDiagram();
88
~QgsPieDiagram();
99

10-
void renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position );
11-
QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s );
12-
QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is );
10+
void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position );
11+
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s );
12+
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is );
1313
QString diagramName() const;
1414
};

python/core/diagram/qgstextdiagram.sip

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class QgsTextDiagram: QgsDiagram
2020

2121
QgsTextDiagram();
2222
~QgsTextDiagram();
23-
void renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position );
24-
QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s );
25-
QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is );
23+
void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position );
24+
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s );
25+
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is );
2626

2727
QString diagramName() const;
2828
};

python/core/qgsdiagramrendererv2.sip

+8-8
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ class QgsDiagramRendererV2
119119
virtual ~QgsDiagramRendererV2();
120120

121121
/**Returns size of the diagram for feature f in map units. Returns an invalid QSizeF in case of error*/
122-
virtual QSizeF sizeMapUnits( const QgsAttributeMap& attributes, const QgsRenderContext& c );
122+
virtual QSizeF sizeMapUnits( const QgsAttributes& attributes, const QgsRenderContext& c );
123123

124124
virtual QString rendererName() const = 0;
125125

126126
/**Returns attribute indices needed for diagram rendering*/
127127
virtual QList<int> diagramAttributes() const = 0;
128128

129-
void renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QPointF& pos );
129+
void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, const QPointF& pos );
130130

131131
void setDiagram( QgsDiagram* d );
132132
const QgsDiagram* diagram() const;
@@ -144,10 +144,10 @@ class QgsDiagramRendererV2
144144
* @param c render context
145145
* @param s out: diagram settings for the feature
146146
*/
147-
virtual bool diagramSettings( const QgsAttributeMap& att, const QgsRenderContext& c, QgsDiagramSettings& s ) = 0;
147+
virtual bool diagramSettings( const QgsAttributes& att, const QgsRenderContext& c, QgsDiagramSettings& s ) = 0;
148148

149149
/**Returns size of the diagram (in painter units) or an invalid size in case of error*/
150-
virtual QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c ) = 0;
150+
virtual QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c ) = 0;
151151

152152
/**Converts size from mm to map units*/
153153
void convertSizeToMapUnits( QSizeF& size, const QgsRenderContext& context ) const;
@@ -183,9 +183,9 @@ class QgsSingleCategoryDiagramRenderer : QgsDiagramRendererV2
183183
void writeXML( QDomElement& layerElem, QDomDocument& doc ) const;
184184

185185
protected:
186-
bool diagramSettings( const QgsAttributeMap&, const QgsRenderContext& c, QgsDiagramSettings& s );
186+
bool diagramSettings( const QgsAttributes&, const QgsRenderContext& c, QgsDiagramSettings& s );
187187

188-
QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c );
188+
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c );
189189
};
190190

191191
class QgsLinearlyInterpolatedDiagramRenderer : QgsDiagramRendererV2
@@ -226,7 +226,7 @@ class QgsLinearlyInterpolatedDiagramRenderer : QgsDiagramRendererV2
226226
void writeXML( QDomElement& layerElem, QDomDocument& doc ) const;
227227

228228
protected:
229-
bool diagramSettings( const QgsAttributeMap&, const QgsRenderContext& c, QgsDiagramSettings& s );
229+
bool diagramSettings( const QgsAttributes&, const QgsRenderContext& c, QgsDiagramSettings& s );
230230

231-
QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c );
231+
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c );
232232
};

0 commit comments

Comments
 (0)