Showing with 16 additions and 4 deletions.
  1. +1 −1 src/app/qgsbrowserdockwidget.cpp
  2. +9 −1 src/core/qgsdataitem.cpp
  3. +4 −0 src/core/qgsvectorlayereditbuffer.cpp
  4. +2 −2 src/providers/postgres/qgspostgresprovider.cpp
2 changes: 1 addition & 1 deletion src/app/qgsbrowserdockwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void QgsBrowserDockWidget::showContextMenu( const QPoint & pt )
QStringList favDirs = settings.value( "/browser/favourites" ).toStringList();
bool inFavDirs = favDirs.contains( item->path() );

if ( item->parent() != NULL && !inFavDirs )
if ( item->parent() && !inFavDirs )
{
// only non-root directories can be added as favourites
menu->addAction( tr( "Add as a favourite" ), this, SLOT( addFavourite() ) );
Expand Down
10 changes: 9 additions & 1 deletion src/core/qgsdataitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ void QgsDataItem::deleteChildItem( QgsDataItem * child )

QgsDataItem * QgsDataItem::removeChildItem( QgsDataItem * child )
{
deleteChildItem( child );
QgsDebugMsgLevel( "mName = " + child->mName, 2 );
int i = mChildren.indexOf( child );
Q_ASSERT( i >= 0 );
Expand Down Expand Up @@ -731,7 +732,14 @@ void QgsFavouritesItem::removeDirectory( QgsDirectoryItem *item )
favDirs.removeAll( item->path() );
settings.setValue( "/browser/favourites", favDirs );

deleteChildItem( item );
int idx = findItem( mChildren, item );
if ( idx < 0 )
{
QgsDebugMsg( QString( "favourites item %1 not found" ).arg( item->path() ) );
return;
}

deleteChildItem( mChildren[idx] );
}

//-----------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions src/core/qgsvectorlayereditbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ bool QgsVectorLayerEditBuffer::commitChanges( QStringList& commitErrors )
}
}
}
else
{
success = false;
}

//
// update geometries
Expand Down
4 changes: 2 additions & 2 deletions src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (decimal)" ), "decimal", QVariant::Double, 1, 20, 0, 20 )

// floating point
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (real)" ), "real", QVariant::Double )
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (double)" ), "double precision", QVariant::Double )
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (real)" ), "real", QVariant::Double, -1, -1, -1, -1 )
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (double)" ), "double precision", QVariant::Double, -1, -1, -1, -1 )

// string types
<< QgsVectorDataProvider::NativeType( tr( "Text, fixed length (char)" ), "char", QVariant::String, 1, 255 )
Expand Down