Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app/browser/qgsinbuiltdataitemproviders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,8 @@ void QgsDatabaseItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *
}
else if ( context.messageBar() )
{
if ( item->parent() )
item->parent()->refresh();
context.messageBar()->pushMessage( tr( "Edited comment on %1" ).arg( fullName ), Qgis::MessageLevel::Success );
}
} );
Expand Down
11 changes: 11 additions & 0 deletions src/providers/postgres/qgspostgresdataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ QString QgsPGLayerItem::comments() const
return mLayerProperty.tableComment;
}

bool QgsPGLayerItem::equal( const QgsDataItem *other )
{
// Call parent class first
if ( !QgsLayerItem::equal( other ) )
return false;

// Also compare tooltips (which contain table comments)
const QgsPGLayerItem *o = qobject_cast<const QgsPGLayerItem *>( other );
return o && toolTip() == o->toolTip();
}

QString QgsPGLayerItem::createUri()
{
QgsPGConnectionItem *connItem = qobject_cast<QgsPGConnectionItem *>( parent() ? parent()->parent() : nullptr );
Expand Down
2 changes: 2 additions & 0 deletions src/providers/postgres/qgspostgresdataitems.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class QgsPGLayerItem : public QgsLayerItem

QString comments() const override;

bool equal( const QgsDataItem *other ) override;

const QgsPostgresLayerProperty &layerInfo() const { return mLayerProperty; }

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