Skip to content

Commit

Permalink
[attrtable] Fix column synchronization
Browse files Browse the repository at this point in the history
Columns have been missing, after removing all columns and readding them
  • Loading branch information
m-kuhn committed May 18, 2013
1 parent 34c85c8 commit a98ffed
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/gui/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -13,6 +13,7 @@
* *
***************************************************************************/

#include "qgsapplication.h"
#include "qgsattributetablemodel.h"
#include "qgsattributetablefiltermodel.h"

Expand Down Expand Up @@ -262,15 +263,15 @@ void QgsAttributeTableModel::loadAttributes()
attributes << idx;
}

if ( columnCount() < attributes.size() )
if ( mFieldCount < attributes.size() )
{
ins = true;
beginInsertColumns( QModelIndex(), columnCount(), attributes.size() - 1 );
beginInsertColumns( QModelIndex(), mFieldCount, attributes.size() - 1 );
}
else if ( attributes.size() < columnCount() )
else if ( attributes.size() < mFieldCount )
{
rm = true;
beginRemoveColumns( QModelIndex(), attributes.size(), columnCount() - 1 );
beginRemoveColumns( QModelIndex(), attributes.size(), mFieldCount - 1 );
}

mFieldCount = attributes.size();
Expand Down

0 comments on commit a98ffed

Please sign in to comment.