Skip to content

Commit

Permalink
use directory path and not item path (fixes #11871)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 16, 2015
1 parent d11cc82 commit ba4948e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsbrowsermodel.cpp
Expand Up @@ -29,7 +29,7 @@

#include <QSettings>

QgsBrowserWatcher::QgsBrowserWatcher( QgsDataItem * item )
QgsBrowserWatcher::QgsBrowserWatcher( QgsDataItem *item )
: mItem( item )
{
}
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsdataitem.cpp
Expand Up @@ -768,7 +768,7 @@ QVector<QgsDataItem*> QgsDirectoryItem::createChildren()
QString subdirPath = dir.absoluteFilePath( subdir );
QgsDebugMsgLevel( QString( "creating subdir: %1" ).arg( subdirPath ), 2 );

QString path = mPath + "/" + subdir; // may differ from subdirPath
QString path = mDirPath + "/" + subdir; // may differ from subdirPath

This comment has been minimized.

Copy link
@blazek

blazek Jan 20, 2015

Member

This is not correct, child must get path created from mPath not from mDirPath. Reverted in 74e2abd. Unfortunately I could not reproduce the crash reported in the issue 11871 and fix that.

QgsDirectoryItem *item = new QgsDirectoryItem( this, subdir, subdirPath, path );
// propagate signals up to top

Expand Down Expand Up @@ -1443,7 +1443,7 @@ QgsDataItem* QgsZipItem::itemFromPath( QgsDataItem* parent, QString dirPath, QSt
return 0;
}

const QStringList & QgsZipItem::getZipFileList()
const QStringList &QgsZipItem::getZipFileList()
{
if ( ! mZipFileList.isEmpty() )
return mZipFileList;
Expand All @@ -1452,7 +1452,7 @@ const QStringList & QgsZipItem::getZipFileList()
QSettings settings;
QString scanZipSetting = settings.value( "/qgis/scanZipInBrowser2", "basic" ).toString();

QgsDebugMsgLevel( QString( "mFIlePath = %1 name= %2 scanZipSetting= %3 vsiPrefix= %4" ).arg( mFilePath ).arg( name() ).arg( scanZipSetting ).arg( mVsiPrefix ), 3 );
QgsDebugMsgLevel( QString( "mFilePath = %1 name= %2 scanZipSetting= %3 vsiPrefix= %4" ).arg( mFilePath ).arg( name() ).arg( scanZipSetting ).arg( mVsiPrefix ), 3 );

// if scanZipBrowser == no: skip to the next file
if ( scanZipSetting == "no" )
Expand All @@ -1461,7 +1461,7 @@ const QStringList & QgsZipItem::getZipFileList()
}

// get list of files inside zip file
QgsDebugMsgLevel( QString( "Open file %1 with gdal vsi" ).arg( mVsiPrefix + path() ), 3 );
QgsDebugMsgLevel( QString( "Open file %1 with gdal vsi" ).arg( mVsiPrefix + mFilePath ), 3 );
char **papszSiblingFiles = VSIReadDirRecursive1( QString( mVsiPrefix + mFilePath ).toLocal8Bit().constData() );
if ( papszSiblingFiles )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdataitem.h
Expand Up @@ -431,7 +431,7 @@ class CORE_EXPORT QgsZipItem : public QgsDataCollectionItem

public:
QgsZipItem( QgsDataItem* parent, QString name, QString path );
QgsZipItem( QgsDataItem* parent, QString name, QString dirPath, QString path );
QgsZipItem( QgsDataItem* parent, QString name, QString filePath, QString path );
~QgsZipItem();

QVector<QgsDataItem*> createChildren() override;
Expand Down

0 comments on commit ba4948e

Please sign in to comment.