@@ -156,7 +156,7 @@ QgsDataItem::QgsDataItem( QgsDataItem::Type type, QgsDataItem* parent, QString n
156
156
157
157
QgsDataItem::~QgsDataItem ()
158
158
{
159
- QgsDebugMsg ( " mName = " + mName + " mPath = " + mPath );
159
+ QgsDebugMsgLevel ( " mName = " + mName + " mPath = " + mPath , 2 );
160
160
}
161
161
162
162
void QgsDataItem::emitBeginInsertItems ( QgsDataItem* parent, int first, int last )
@@ -215,7 +215,7 @@ bool QgsDataItem::hasChildren()
215
215
216
216
void QgsDataItem::addChildItem ( QgsDataItem * child, bool refresh )
217
217
{
218
- QgsDebugMsg ( QString ( " add child #%1 - %2 - %3 " ).arg ( mChildren .size () ).arg ( child->mName ).arg ( child->mType ) );
218
+ QgsDebugMsg ( QString ( " path = %1 add child #%2 - %3 - %4 " ). arg ( mPath ).arg ( mChildren .size () ).arg ( child->mName ).arg ( child->mType ) );
219
219
220
220
int i;
221
221
if ( type () == Directory )
@@ -256,7 +256,7 @@ void QgsDataItem::addChildItem( QgsDataItem * child, bool refresh )
256
256
}
257
257
void QgsDataItem::deleteChildItem ( QgsDataItem * child )
258
258
{
259
- QgsDebugMsg ( " mName = " + child->mName );
259
+ QgsDebugMsgLevel ( " mName = " + child->mName , 2 );
260
260
int i = mChildren .indexOf ( child );
261
261
Q_ASSERT ( i >= 0 );
262
262
emit beginRemoveItems ( this , i, i );
@@ -267,7 +267,7 @@ void QgsDataItem::deleteChildItem( QgsDataItem * child )
267
267
268
268
QgsDataItem * QgsDataItem::removeChildItem ( QgsDataItem * child )
269
269
{
270
- QgsDebugMsg ( " mName = " + child->mName );
270
+ QgsDebugMsgLevel ( " mName = " + child->mName , 2 );
271
271
int i = mChildren .indexOf ( child );
272
272
Q_ASSERT ( i >= 0 );
273
273
emit beginRemoveItems ( this , i, i );
@@ -289,7 +289,7 @@ int QgsDataItem::findItem( QVector<QgsDataItem*> items, QgsDataItem * item )
289
289
{
290
290
for ( int i = 0 ; i < items.size (); i++ )
291
291
{
292
- QgsDebugMsg ( QString::number ( i ) + " : " + items[i]->mPath + " x " + item->mPath );
292
+ QgsDebugMsgLevel ( QString::number ( i ) + " : " + items[i]->mPath + " x " + item->mPath , 2 );
293
293
if ( items[i]->equal ( item ) )
294
294
return i;
295
295
}
@@ -298,7 +298,7 @@ int QgsDataItem::findItem( QVector<QgsDataItem*> items, QgsDataItem * item )
298
298
299
299
void QgsDataItem::refresh ()
300
300
{
301
- QgsDebugMsg ( " mPath = " + mPath );
301
+ QgsDebugMsgLevel ( " mPath = " + mPath , 2 );
302
302
303
303
QApplication::setOverrideCursor ( Qt::WaitCursor );
304
304
@@ -391,10 +391,10 @@ QgsDataCollectionItem::QgsDataCollectionItem( QgsDataItem* parent, QString name,
391
391
392
392
QgsDataCollectionItem::~QgsDataCollectionItem ()
393
393
{
394
- QgsDebugMsg ( " Entered" );
394
+ QgsDebugMsgLevel ( " Entered" , 2 );
395
395
foreach ( QgsDataItem* i, mChildren )
396
396
{
397
- QgsDebugMsg ( QString ( " delete child = 0x%0" ).arg (( qlonglong )i, 8 , 16 , QLatin1Char ( ' 0' ) ) );
397
+ QgsDebugMsgLevel ( QString ( " delete child = 0x%0" ).arg (( qlonglong )i, 8 , 16 , QLatin1Char ( ' 0' ) ), 2 );
398
398
delete i;
399
399
}
400
400
}
@@ -459,7 +459,7 @@ QVector<QgsDataItem*> QgsDirectoryItem::createChildren( )
459
459
foreach ( QString subdir, entries )
460
460
{
461
461
QString subdirPath = dir.absoluteFilePath ( subdir );
462
- QgsDebugMsg ( QString ( " creating subdir: %1" ).arg ( subdirPath ) );
462
+ QgsDebugMsgLevel ( QString ( " creating subdir: %1" ).arg ( subdirPath ), 2 );
463
463
464
464
QgsDirectoryItem *item = new QgsDirectoryItem ( this , subdir, subdirPath );
465
465
// propagate signals up to top
@@ -862,7 +862,7 @@ QVector<QgsDataItem*> QgsZipItem::createChildren( )
862
862
863
863
mZipFileList .clear ();
864
864
865
- QgsDebugMsg ( QString ( " path = %1 name= %2 scanZipSetting= %3 vsiPrefix= %4" ).arg ( path () ).arg ( name () ).arg ( scanZipSetting ).arg ( mVsiPrefix ) );
865
+ QgsDebugMsgLevel ( QString ( " path = %1 name= %2 scanZipSetting= %3 vsiPrefix= %4" ).arg ( path () ).arg ( name () ).arg ( scanZipSetting ).arg ( mVsiPrefix ), 2 );
866
866
867
867
// if scanZipBrowser == no: skip to the next file
868
868
if ( scanZipSetting == " no" )
@@ -886,7 +886,7 @@ QVector<QgsDataItem*> QgsZipItem::createChildren( )
886
886
{
887
887
QFileInfo info ( fileName );
888
888
tmpPath = mVsiPrefix + path () + " /" + fileName;
889
- QgsDebugMsg ( " tmpPath = " + tmpPath );
889
+ QgsDebugMsgLevel ( " tmpPath = " + tmpPath, 3 );
890
890
891
891
// foreach( dataItem_t *dataItem, mDataItemPtr )
892
892
for ( int i = 0 ; i < mProviderNames .size (); i++ )
@@ -909,18 +909,18 @@ QVector<QgsDataItem*> QgsZipItem::createChildren( )
909
909
dataItem_t *dataItem = mDataItemPtr [i];
910
910
if ( dataItem )
911
911
{
912
- QgsDebugMsg ( QString ( " trying to load item %1 with %2" ).arg ( tmpPath ).arg ( mProviderNames [i] ) );
912
+ QgsDebugMsgLevel ( QString ( " trying to load item %1 with %2" ).arg ( tmpPath ).arg ( mProviderNames [i] ), 3 );
913
913
QgsDataItem * item = dataItem ( tmpPath, this );
914
914
if ( item )
915
915
{
916
- QgsDebugMsg ( " loaded item" );
916
+ QgsDebugMsgLevel ( " loaded item" , 3 );
917
917
childPath = tmpPath;
918
918
children.append ( item );
919
919
break ;
920
920
}
921
921
else
922
922
{
923
- QgsDebugMsg ( " not loaded item" );
923
+ QgsDebugMsgLevel ( " not loaded item" , 3 );
924
924
}
925
925
}
926
926
}
@@ -965,7 +965,7 @@ QgsDataItem* QgsZipItem::itemFromPath( QgsDataItem* parent, QString path, QStrin
965
965
QgsZipItem * zipItem = 0 ;
966
966
bool populated = false ;
967
967
968
- QgsDebugMsg ( QString ( " path = %1 name= %2 scanZipSetting= %3 vsiPrefix= %4" ).arg ( path ).arg ( name ).arg ( scanZipSetting ).arg ( vsiPrefix ) );
968
+ QgsDebugMsgLevel ( QString ( " path = %1 name= %2 scanZipSetting= %3 vsiPrefix= %4" ).arg ( path ).arg ( name ).arg ( scanZipSetting ).arg ( vsiPrefix ), 3 );
969
969
970
970
// if scanZipBrowser == no: don't read the zip file
971
971
if ( scanZipSetting == " no" )
@@ -1001,18 +1001,18 @@ QgsDataItem* QgsZipItem::itemFromPath( QgsDataItem* parent, QString path, QStrin
1001
1001
{
1002
1002
zipItem->populate ();
1003
1003
populated = true ; // there is no QgsDataItem::isPopulated() function
1004
- QgsDebugMsg ( QString ( " Got zipItem with %1 children, path=%2, name=%3" ).arg ( zipItem->rowCount () ).arg ( zipItem->path () ).arg ( zipItem->name () ) );
1004
+ QgsDebugMsgLevel ( QString ( " Got zipItem with %1 children, path=%2, name=%3" ).arg ( zipItem->rowCount () ).arg ( zipItem->path () ).arg ( zipItem->name () ), 3 );
1005
1005
}
1006
1006
else
1007
1007
{
1008
- QgsDebugMsg ( QString ( " Delaying populating zipItem with path=%1, name=%2" ).arg ( zipItem->path () ).arg ( zipItem->name () ) );
1008
+ QgsDebugMsgLevel ( QString ( " Delaying populating zipItem with path=%1, name=%2" ).arg ( zipItem->path () ).arg ( zipItem->name () ), 3 );
1009
1009
}
1010
1010
}
1011
1011
1012
1012
// only display if has children or if is not populated
1013
1013
if ( zipItem && ( !populated || zipItem->rowCount () > 1 ) )
1014
1014
{
1015
- QgsDebugMsg ( " returning zipItem" );
1015
+ QgsDebugMsgLevel ( " returning zipItem" , 3 );
1016
1016
return zipItem;
1017
1017
}
1018
1018
// if 1 or 0 child found, create a single data item using the normal path or the full path given by QgsZipItem
@@ -1025,7 +1025,7 @@ QgsDataItem* QgsZipItem::itemFromPath( QgsDataItem* parent, QString path, QStrin
1025
1025
delete zipItem;
1026
1026
}
1027
1027
1028
- QgsDebugMsg ( QString ( " will try to create a normal dataItem from path= %2 or %3" ).arg ( path ).arg ( vsiPath ) );
1028
+ QgsDebugMsgLevel ( QString ( " will try to create a normal dataItem from path= %2 or %3" ).arg ( path ).arg ( vsiPath ), 3 );
1029
1029
1030
1030
// try to open using registered providers (gdal and ogr)
1031
1031
for ( int i = 0 ; i < mProviderNames .size (); i++ )
@@ -1062,7 +1062,7 @@ const QStringList & QgsZipItem::getZipFileList()
1062
1062
QSettings settings;
1063
1063
QString scanZipSetting = settings.value ( " /qgis/scanZipInBrowser" , " basic" ).toString ();
1064
1064
1065
- QgsDebugMsg ( QString ( " path = %1 name= %2 scanZipSetting= %3 vsiPrefix= %4" ).arg ( path () ).arg ( name () ).arg ( scanZipSetting ).arg ( mVsiPrefix ) );
1065
+ QgsDebugMsgLevel ( QString ( " path = %1 name= %2 scanZipSetting= %3 vsiPrefix= %4" ).arg ( path () ).arg ( name () ).arg ( scanZipSetting ).arg ( mVsiPrefix ), 3 );
1066
1066
1067
1067
// if scanZipBrowser == no: skip to the next file
1068
1068
if ( scanZipSetting == " no" )
@@ -1071,14 +1071,14 @@ const QStringList & QgsZipItem::getZipFileList()
1071
1071
}
1072
1072
1073
1073
// get list of files inside zip file
1074
- QgsDebugMsg ( QString ( " Open file %1 with gdal vsi" ).arg ( mVsiPrefix + path () ) );
1074
+ QgsDebugMsgLevel ( QString ( " Open file %1 with gdal vsi" ).arg ( mVsiPrefix + path () ), 3 );
1075
1075
char **papszSiblingFiles = VSIReadDirRecursive1 ( QString ( mVsiPrefix + path () ).toLocal8Bit ().constData () );
1076
1076
if ( papszSiblingFiles )
1077
1077
{
1078
1078
for ( int i = 0 ; i < CSLCount ( papszSiblingFiles ); i++ )
1079
1079
{
1080
1080
tmpPath = papszSiblingFiles[i];
1081
- QgsDebugMsg ( QString ( " Read file %1" ).arg ( tmpPath ) );
1081
+ QgsDebugMsgLevel ( QString ( " Read file %1" ).arg ( tmpPath ), 3 );
1082
1082
// skip directories (files ending with /)
1083
1083
if ( tmpPath.right ( 1 ) != " /" )
1084
1084
mZipFileList << tmpPath;
0 commit comments