Skip to content

Commit 8f9b89d

Browse files
committed
Clean up code related to old overlay object system
1 parent 17b09c2 commit 8f9b89d

33 files changed

+25
-1634
lines changed

python/core/conversions.sip

-89
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ which are not wrapped by PyQt:
1515
- QMap<double, TYPE>
1616
- QMultiMap<double, TYPE2>
1717
- QMap<qint64, TYPE>
18-
- QMap<qint64, QgsOverlayObject*>
1918
- QList< QPair< QString, QList<QString> > >
2019
- QVector<TYPE*>
2120
- QMap<qint64, QgsFeature*>
@@ -1323,94 +1322,6 @@ template<double, TYPE2>
13231322
%End
13241323
};
13251324

1326-
1327-
1328-
%MappedType QMap<qint64, QgsOverlayObject*>
1329-
{
1330-
%TypeHeaderCode
1331-
#include <QMap>
1332-
#if (SIP_VERSION >= 0x040900)
1333-
#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
1334-
#endif
1335-
#if (SIP_VERSION >= 0x040900 && SIP_VERSION < 0x040c01)
1336-
#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
1337-
#endif
1338-
%End
1339-
1340-
%ConvertFromTypeCode
1341-
1342-
//convert map to a python dictionary
1343-
PyObject *d;
1344-
1345-
if ((d = PyDict_New()) == NULL)
1346-
return NULL;
1347-
1348-
for (QMap<qint64, QgsOverlayObject*>::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it)
1349-
{
1350-
QgsOverlayObject* oobj = new QgsOverlayObject(*it.value());
1351-
1352-
PyObject* keyobj = PyInt_FromLong(it.key());
1353-
PyObject* pyOobj = sipConvertFromInstance(oobj, sipClass_QgsOverlayObject, sipTransferObj);
1354-
PyDict_SetItem(d, keyobj, pyOobj);
1355-
1356-
if(pyOobj == NULL || keyobj == NULL || PyDict_SetItem(d, keyobj, pyOobj) < 0)
1357-
{
1358-
Py_DECREF(d);
1359-
1360-
if (pyOobj)
1361-
{
1362-
Py_DECREF(pyOobj);
1363-
}
1364-
1365-
if (keyobj)
1366-
{
1367-
Py_DECREF(keyobj);
1368-
}
1369-
return NULL;
1370-
}
1371-
Py_DECREF(pyOobj);
1372-
Py_DECREF(keyobj);
1373-
}
1374-
return d;
1375-
1376-
%End
1377-
%ConvertToTypeCode
1378-
PyObject *t1obj, *t2obj;
1379-
#if PY_VERSION_HEX >= 0x02050000
1380-
Py_ssize_t i = 0;
1381-
#else
1382-
int i = 0;
1383-
#endif
1384-
1385-
QMap<qint64, QgsOverlayObject*> *qm = new QMap<qint64, QgsOverlayObject*>;
1386-
1387-
while (PyDict_Next(sipPy, &i, &t1obj, &t2obj))
1388-
{
1389-
int state;
1390-
//int t1 = (int)(PyFloat_AsDouble(t1obj));
1391-
qint64 t1 = PyLong_AsLongLong(t1obj);
1392-
QgsOverlayObject* t2 = reinterpret_cast<QgsOverlayObject*>(sipConvertToInstance(t2obj, sipClass_QgsOverlayObject, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
1393-
1394-
if (*sipIsErr)
1395-
{
1396-
sipReleaseInstance(t2, sipClass_QgsOverlayObject, state);
1397-
delete qm;
1398-
return 0;
1399-
}
1400-
1401-
qm->insert(t1, t2);
1402-
1403-
sipReleaseInstance(t2, sipClass_QgsOverlayObject, state);
1404-
}
1405-
1406-
*sipCppPtr = qm;
1407-
1408-
return sipGetState(sipTransferObj);
1409-
%End
1410-
};
1411-
1412-
1413-
14141325
%MappedType QList < QPair< QString, QList<QString> > >
14151326
{
14161327
%TypeHeaderCode

python/core/core.sip

-6
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,8 @@
5252
%Include qgsnetworkaccessmanager.sip
5353
%Include qgsofflineediting.sip
5454
%Include qgsogcutils.sip
55-
%Include qgsoverlayobject.sip
5655
%Include qgsowsconnection.sip
5756
%Include qgspaintenginehack.sip
58-
%Include qgsoverlayobjectpositionmanager.sip
59-
%Include qgspalgeometry.sip
6057
%Include qgspallabeling.sip
6158
%Include qgspluginlayer.sip
6259
%Include qgspluginlayerregistry.sip
@@ -86,16 +83,13 @@
8683
%Include qgsvectorlayerimport.sip
8784
%Include qgsvectorlayerjoinbuffer.sip
8885
%Include qgsvectorlayerundocommand.sip
89-
%Include qgsvectoroverlay.sip
9086
%Include qgsfontutils.sip
9187

9288
%Include qgscachedfeatureiterator.sip
9389
%Include qgscacheindex.sip
9490
%Include qgscacheindexfeatureid.sip
95-
%Include qgscentralpointpositionmanager.sip
9691
%Include qgsfeaturestore.sip
9792
%Include qgsgeometrycache.sip
98-
%Include qgspalobjectpositionmanager.sip
9993
%Include qgsprojectfiletransform.sip
10094
%Include qgsvectorlayereditutils.sip
10195
%Include qgsvectorlayerfeatureiterator.sip

python/core/qgscentralpointpositionmanager.sip

-13
This file was deleted.

python/core/qgsmaprenderer.sip

-4
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,4 @@ class QgsMapRenderer : QObject
277277
* also sets the contents of the r2 parameter
278278
*/
279279
bool splitLayersExtent( QgsMapLayer* layer, QgsRectangle& extent, QgsRectangle& r2 );
280-
281-
/**Creates an overlay object position manager subclass according to the current settings
282-
@note this method was added in version 1.1*/
283-
QgsOverlayObjectPositionManager* overlayManagerFromSettings() /Factory/;
284280
};

python/core/qgsoverlayobject.sip

-30
This file was deleted.

python/core/qgsoverlayobjectpositionmanager.sip

-22
This file was deleted.

python/core/qgspalgeometry.sip

-18
This file was deleted.

python/core/qgspalobjectpositionmanager.sip

-16
This file was deleted.

python/core/qgsvectorlayer.sip

-20
Original file line numberDiff line numberDiff line change
@@ -827,26 +827,6 @@ class QgsVectorLayer : QgsMapLayer
827827
**/
828828
void setLabelOnTop( int idx, bool onTop );
829829

830-
/**Adds a new overlay to this class. QgsVectorLayer takes ownership of the object
831-
@note this method was added in version 1.1
832-
*/
833-
void addOverlay( QgsVectorOverlay* overlay /Transfer/ );
834-
835-
/**Removes all overlays of a given type
836-
@note this method was added in version 1.1
837-
*/
838-
void removeOverlay( const QString& typeName );
839-
840-
/**Returns pointers to the overlays of this layer
841-
@note this method was added in version 1.1
842-
*/
843-
void vectorOverlays( QList<QgsVectorOverlay*>& overlayList /Out/ );
844-
845-
/**Returns the (first) overlay of a type, e.g. diagram or label
846-
@note this method was added in version 1.1
847-
*/
848-
QgsVectorOverlay* findOverlayByType( const QString& typeName );
849-
850830
//! Buffer with uncommitted editing operations. Only valid after editing has been turned on.
851831
QgsVectorLayerEditBuffer* editBuffer();
852832

python/core/qgsvectoroverlay.sip

-42
This file was deleted.

src/app/qgsoptions.cpp

-52
Original file line numberDiff line numberDiff line change
@@ -714,35 +714,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
714714
groupBox_5->setEnabled( false );
715715
#endif //Q_WS_MAC
716716

717-
//overlay placement algorithm
718-
mOverlayAlgorithmComboBox->insertItem( 0, tr( "Central point (fastest)" ) );
719-
mOverlayAlgorithmComboBox->insertItem( 1, tr( "Chain (fast)" ) );
720-
mOverlayAlgorithmComboBox->insertItem( 2, tr( "Popmusic tabu chain (slow)" ) );
721-
mOverlayAlgorithmComboBox->insertItem( 3, tr( "Popmusic tabu (slow)" ) );
722-
mOverlayAlgorithmComboBox->insertItem( 4, tr( "Popmusic chain (very slow)" ) );
723-
724-
QString overlayAlgorithmString = settings.value( "qgis/overlayPlacementAlgorithm", "Central point" ).toString();
725-
if ( overlayAlgorithmString == "Chain" )
726-
{
727-
mOverlayAlgorithmComboBox->setCurrentIndex( 1 );
728-
}
729-
else if ( overlayAlgorithmString == "Popmusic tabu chain" )
730-
{
731-
mOverlayAlgorithmComboBox->setCurrentIndex( 2 );
732-
}
733-
else if ( overlayAlgorithmString == "Popmusic tabu" )
734-
{
735-
mOverlayAlgorithmComboBox->setCurrentIndex( 3 );
736-
}
737-
else if ( overlayAlgorithmString == "Popmusic chain" )
738-
{
739-
mOverlayAlgorithmComboBox->setCurrentIndex( 4 );
740-
}
741-
else
742-
{
743-
mOverlayAlgorithmComboBox->setCurrentIndex( 0 );
744-
} //default is central point
745-
746717
// load gdal driver list only when gdal tab is first opened
747718
mLoadedGdalDriverList = false;
748719

@@ -997,29 +968,6 @@ void QgsOptions::saveOptions()
997968
settings.setValue( "/qgis/nullValue", leNullValue->text() );
998969
settings.setValue( "/qgis/style", cmbStyle->currentText() );
999970

1000-
//overlay placement method
1001-
int overlayIndex = mOverlayAlgorithmComboBox->currentIndex();
1002-
if ( overlayIndex == 1 )
1003-
{
1004-
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Chain" );
1005-
}
1006-
else if ( overlayIndex == 2 )
1007-
{
1008-
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Popmusic tabu chain" );
1009-
}
1010-
else if ( overlayIndex == 3 )
1011-
{
1012-
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Popmusic tabu" );
1013-
}
1014-
else if ( overlayIndex == 4 )
1015-
{
1016-
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Popmusic chain" );
1017-
}
1018-
else
1019-
{
1020-
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Central point" );
1021-
}
1022-
1023971
if ( cmbTheme->currentText().length() == 0 )
1024972
{
1025973
settings.setValue( "/Themes", "default" );

src/app/qgspluginregistry.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ void QgsPluginRegistry::loadCppPlugin( QString theFullPathName )
339339
{
340340
case QgisPlugin::RENDERER:
341341
case QgisPlugin::UI:
342-
case QgisPlugin::VECTOR_OVERLAY:
343342
{
344343
// UI only -- doesn't use mapcanvas
345344
create_ui *cf = ( create_ui * ) cast_to_fptr( myLib.resolve( "classFactory" ) );

0 commit comments

Comments
 (0)