Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
.kdev4/
.project
.pydevproject
.qtcreator
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated change (and duplicate of line 33)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

.venv
.vscode
.qtcreator
Expand Down
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
5 changes: 2 additions & 3 deletions src/core/browser/qgsdataitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void QgsDataItem::populate( bool foreground )
// The watcher must not be created with item (in constructor) because the item may be created in thread and the watcher created in thread does not work correctly.
if ( !mFutureWatcher )
{
mFutureWatcher = std::make_unique<QFutureWatcher<QVector<QgsDataItem *> >>( this );
mFutureWatcher = std::make_unique<QFutureWatcher<QVector<QgsDataItem *> >> ( this );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert the unrelated formatting changes to this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson done... after a fight with the cat!

}

connect( mFutureWatcher.get(), &QFutureWatcherBase::finished, this, &QgsDataItem::childrenCreated );
Expand Down Expand Up @@ -308,7 +308,7 @@ void QgsDataItem::refresh()
setState( Qgis::BrowserItemState::Populating );
if ( !mFutureWatcher )
{
mFutureWatcher = std::make_unique<QFutureWatcher<QVector<QgsDataItem *> >>( this );
mFutureWatcher = std::make_unique<QFutureWatcher<QVector<QgsDataItem *> >> ( this );
}
connect( mFutureWatcher.get(), &QFutureWatcherBase::finished, this, &QgsDataItem::childrenCreated );
mFutureWatcher->setFuture( QtConcurrent::run( runCreateChildren, this ) );
Expand Down Expand Up @@ -599,4 +599,3 @@ QgsErrorItem::QgsErrorItem( QgsDataItem *parent, const QString &error, const QSt

setState( Qgis::BrowserItemState::Populated ); // no more children
}

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 @@ -97,6 +97,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