Skip to content
Permalink
Browse files
fix crash on close (fixes #12822)
  • Loading branch information
jef-n committed May 26, 2015
1 parent 9a5e8d9 commit 598563c05a7da95426e122d0d18dd9a05949ad18
Showing with 12 additions and 9 deletions.
  1. +10 −7 src/providers/grass/qgsgrassprovidermodule.cpp
  2. +2 −2 src/providers/grass/qgsgrassprovidermodule.h
@@ -710,8 +710,8 @@ QIcon QgsGrassGroupItem::icon()
}

//----------------------- QgsGrassImportItem ------------------------------
QgsGrassImportItemIcon::QgsGrassImportItemIcon()
: QObject()
QgsGrassImportItemIcon::QgsGrassImportItemIcon( QObject *parent )
: QObject( parent )
, mCount( 0 )
, mMovie( 0 )
{
@@ -741,7 +741,7 @@ void QgsGrassImportItemIcon::removeListener()

//----------------------- QgsGrassImportItem ------------------------------

QgsGrassImportItemIcon QgsGrassImportItem::mImportIcon;
QgsGrassImportItemIcon *QgsGrassImportItem::mImportIcon = 0;

QgsGrassImportItem::QgsGrassImportItem( QgsDataItem* parent, const QString& name, const QString& path, QgsGrassImport* import )
: QgsDataItem( QgsDataItem::Layer, parent, name, path )
@@ -751,13 +751,16 @@ QgsGrassImportItem::QgsGrassImportItem( QgsDataItem* parent, const QString& name
setCapabilities( QgsDataItem::NoCapabilities ); // disable fertility
setState( Populating );

connect( &mImportIcon, SIGNAL( frameChanged( int ) ), SLOT( emitDataChanged() ) );
mImportIcon.addListener();
if ( !mImportIcon )
mImportIcon = new QgsGrassImportItemIcon( import );

connect( mImportIcon, SIGNAL( frameChanged( int ) ), SLOT( emitDataChanged() ) );
mImportIcon->addListener();
}

QgsGrassImportItem::~QgsGrassImportItem()
{
mImportIcon.removeListener();
mImportIcon->removeListener();
}

QList<QAction*> QgsGrassImportItem::actions()
@@ -783,7 +786,7 @@ void QgsGrassImportItem::cancel()

QIcon QgsGrassImportItem::icon()
{
return mImportIcon.icon();
return mImportIcon->icon();
}

//-------------------------------------------------------------------------
@@ -174,7 +174,7 @@ class QgsGrassImportItemIcon : public QObject
{
Q_OBJECT
public:
QgsGrassImportItemIcon();
QgsGrassImportItemIcon( QObject *parent );

QIcon icon() { return mIcon; }
void addListener();
@@ -217,7 +217,7 @@ class QgsGrassImportItem : public QgsDataItem, public QgsGrassObjectItemBase
QgsGrassImport* mImport;

private:
static QgsGrassImportItemIcon mImportIcon;
static QgsGrassImportItemIcon *mImportIcon;
};

#endif // QGSGRASSPROVIDERMODULE_H

1 comment on commit 598563c

@blazek

This comment has been minimized.

Copy link
Member

@blazek blazek commented on 598563c May 27, 2015

Thanks and sorry.

Please sign in to comment.