Skip to content

Commit

Permalink
Deprecate unrequired methods
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed May 17, 2018
1 parent b0ccafe commit 2325fe5
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 23 deletions.
Expand Up @@ -133,10 +133,34 @@ Sort this model by its display expression.
%End

public slots:
void onBeginRemoveRows( const QModelIndex &parent, int first, int last );
void onEndRemoveRows( const QModelIndex &parent, int first, int last );
void onBeginInsertRows( const QModelIndex &parent, int first, int last );
void onEndInsertRows( const QModelIndex &parent, int first, int last );

void onBeginRemoveRows( const QModelIndex &parent, int first, int last );
%Docstring
Does nothing except for calling beginRemoveRows()

\deprecated
%End

void onEndRemoveRows( const QModelIndex &parent, int first, int last );
%Docstring
Does nothing except for calling endRemoveRows()

\deprecated
%End

void onBeginInsertRows( const QModelIndex &parent, int first, int last );
%Docstring
Does nothing except for calling beginInsertRows()

\deprecated
%End

void onEndInsertRows( const QModelIndex &parent, int first, int last );
%Docstring
Does nothing except for calling endInsertRows()

\deprecated
%End

};

Expand Down
15 changes: 0 additions & 15 deletions src/gui/attributetable/qgsfeaturelistmodel.cpp
Expand Up @@ -34,21 +34,6 @@ void QgsFeatureListModel::setSourceModel( QgsAttributeTableFilterModel *sourceMo
mExpressionContext = sourceModel->layer()->createExpressionContext();
mFilterModel = sourceModel;

if ( mFilterModel )
{
#if 0
// rewire (filter-)change events in the source model so this proxy reflects the changes
connect( mFilterModel, &QAbstractItemModel::rowsAboutToBeRemoved, this, &QgsFeatureListModel::onBeginRemoveRows );
connect( mFilterModel, &QAbstractItemModel::rowsRemoved, this, &QgsFeatureListModel::onEndRemoveRows );
connect( mFilterModel, &QAbstractItemModel::rowsAboutToBeInserted, this, &QgsFeatureListModel::onBeginInsertRows );
connect( mFilterModel, &QAbstractItemModel::rowsInserted, this, &QgsFeatureListModel::onEndInsertRows );
// propagate sort order changes from source model to views connected to this model
connect( mFilterModel, &QAbstractItemModel::layoutAboutToBeChanged, this, &QAbstractItemModel::layoutAboutToBeChanged );
connect( mFilterModel, &QAbstractItemModel::layoutChanged, this, &QAbstractItemModel::layoutChanged );
connect( mFilterModel, &QAbstractItemModel::modelAboutToBeReset, this, &QAbstractItemModel::modelAboutToBeReset );
connect( mFilterModel, &QAbstractItemModel::modelReset, this, &QAbstractItemModel::modelReset );
#endif
}
}

QgsVectorLayerCache *QgsFeatureListModel::layerCache()
Expand Down
32 changes: 28 additions & 4 deletions src/gui/attributetable/qgsfeaturelistmodel.h
Expand Up @@ -139,10 +139,34 @@ class GUI_EXPORT QgsFeatureListModel : public QSortFilterProxyModel, public QgsF
void setSortByDisplayExpression( bool sortByDisplayExpression );

public slots:
void onBeginRemoveRows( const QModelIndex &parent, int first, int last );
void onEndRemoveRows( const QModelIndex &parent, int first, int last );
void onBeginInsertRows( const QModelIndex &parent, int first, int last );
void onEndInsertRows( const QModelIndex &parent, int first, int last );

/**
* Does nothing except for calling beginRemoveRows()
*
* \deprecated
*/
Q_DECL_DEPRECATED void onBeginRemoveRows( const QModelIndex &parent, int first, int last );

/**
* Does nothing except for calling endRemoveRows()
*
* \deprecated
*/
Q_DECL_DEPRECATED void onEndRemoveRows( const QModelIndex &parent, int first, int last );

/**
* Does nothing except for calling beginInsertRows()
*
* \deprecated
*/
Q_DECL_DEPRECATED void onBeginInsertRows( const QModelIndex &parent, int first, int last );

/**
* Does nothing except for calling endInsertRows()
*
* \deprecated
*/
Q_DECL_DEPRECATED void onEndInsertRows( const QModelIndex &parent, int first, int last );

private:
mutable QgsExpression mDisplayExpression;
Expand Down

0 comments on commit 2325fe5

Please sign in to comment.