@@ -57,7 +57,7 @@ QgsBrowserModel::QgsBrowserModel(QObject *parent) :
5757 QgsDataItem * item = dataItem ( " " , NULL ); // empty path -> top level
5858 if ( item )
5959 {
60- QgsDebugMsg ( " Add new top level item : " + item->mName );
60+ QgsDebugMsg ( " Add new top level item : " + item->name () );
6161 connectItem (item);
6262 mRootItems << item;
6363 }
@@ -88,7 +88,7 @@ QVariant QgsBrowserModel::data( const QModelIndex & index, int role ) const
8888
8989 if (role == Qt::DisplayRole)
9090 {
91- return QVariant (ptr->mName );
91+ return QVariant (ptr->name () );
9292 }
9393 else if (role == Qt::DecorationRole && index.column () == 0 )
9494 {
@@ -162,13 +162,13 @@ QModelIndex QgsBrowserModel::index( int row, int column, const QModelIndex & par
162162 {
163163 // this is ordinary item: return a valid index if the requested child exists
164164 QgsDataItem* ptr = (QgsDataItem*) parent.internalPointer ();
165- if (ptr->mType == QgsDataItem::Directory || ptr->mType == QgsDataItem::Collection)
165+ if (ptr->type () == QgsDataItem::Directory || ptr->type () == QgsDataItem::Collection)
166166 {
167167 // this is a directory: get index of its subdir!
168168 QgsDirectoryItem* di = (QgsDirectoryItem*) ptr;
169- return createIndex (row, column, di->mChildren .at (row));
169+ return createIndex (row, column, di->children () .at (row));
170170 }
171- if (ptr->mType == QgsDataItem::Layer)
171+ if (ptr->type () == QgsDataItem::Layer)
172172 {
173173 return QModelIndex (); // has no children
174174 }
@@ -184,7 +184,7 @@ QModelIndex QgsBrowserModel::index( QgsDataItem *item )
184184 // Item index
185185 QModelIndex index = QModelIndex ();
186186
187- const QVector<QgsDataItem*>& children = item->mParent ? item->mParent -> mChildren : mRootItems ;
187+ const QVector<QgsDataItem*>& children = item->parent () ? item->parent ()-> children () : mRootItems ;
188188
189189 Q_ASSERT ( children.size () > 0 );
190190 int row = -1 ;
@@ -213,7 +213,7 @@ QModelIndex QgsBrowserModel::parent( const QModelIndex & index ) const
213213 // qDebug("parent of: %d %d", index.row(), index.column());
214214
215215 QgsDataItem* ptr = (QgsDataItem*) index.internalPointer ();
216- QgsDataItem* parentItem = ptr->mParent ;
216+ QgsDataItem* parentItem = ptr->parent () ;
217217
218218 if (parentItem == NULL )
219219 {
@@ -222,7 +222,7 @@ QModelIndex QgsBrowserModel::parent( const QModelIndex & index ) const
222222 }
223223
224224 const QVector<QgsDataItem*>& children =
225- parentItem->mParent ? ((QgsDirectoryItem*)parentItem->mParent )-> mChildren : mRootItems ;
225+ parentItem->parent () ? ((QgsDirectoryItem*)parentItem->parent ())-> children () : mRootItems ;
226226 Q_ASSERT (children.count () > 0 );
227227
228228 for (int i = 0 ; i < children.count (); i++)
@@ -243,13 +243,13 @@ void QgsBrowserModel::refresh( QString path, const QModelIndex& theIndex )
243243 {
244244 QModelIndex idx = index (i, 0 , theIndex);
245245 QgsDataItem* ptr = (QgsDataItem*) idx.internalPointer ();
246- if ( ptr->mPath == path )
246+ if ( ptr->path () == path )
247247 {
248- QgsDebugMsg ( " Arrived " + ptr->mPath );
248+ QgsDebugMsg ( " Arrived " + ptr->path () );
249249 ptr->refresh ();
250250 return ;
251251 }
252- if ( path.indexOf ( ptr->mPath ) == 0 )
252+ if ( path.indexOf ( ptr->path () ) == 0 )
253253 {
254254 refresh ( path, idx );
255255 break ;
@@ -267,14 +267,14 @@ void QgsBrowserModel::refresh( const QModelIndex& theIndex )
267267 else
268268 {
269269 QgsDataItem* ptr = (QgsDataItem*) theIndex.internalPointer ();
270- QgsDebugMsg ( " Refresh " + ptr->mPath );
270+ QgsDebugMsg ( " Refresh " + ptr->path () );
271271 ptr->refresh ();
272272 }
273273}
274274
275275void QgsBrowserModel::beginInsertItems ( QgsDataItem* parent, int first, int last )
276276{
277- QgsDebugMsg ( " parent mPath = " + parent->mPath );
277+ QgsDebugMsg ( " parent mPath = " + parent->path () );
278278 QModelIndex idx = index ( parent );
279279 if ( !idx.isValid () ) return ;
280280 QgsDebugMsg ( " valid" );
@@ -288,7 +288,7 @@ void QgsBrowserModel::endInsertItems()
288288}
289289void QgsBrowserModel::beginRemoveItems ( QgsDataItem* parent, int first, int last )
290290{
291- QgsDebugMsg ( " parent mPath = " + parent->mPath );
291+ QgsDebugMsg ( " parent mPath = " + parent->path () );
292292 QModelIndex idx = index ( parent );
293293 if ( !idx.isValid () ) return ;
294294 beginRemoveRows ( idx, first, last );
0 commit comments