-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a completer for the file widget when creating a new GPKG #35072
Conversation
3nids
commented
Mar 13, 2020
@@ -129,6 +130,17 @@ QgsNewGeoPackageLayerDialog::QgsNewGeoPackageLayerDialog( QWidget *parent, Qt::W | |||
} | |||
checkOk(); | |||
} ); | |||
|
|||
settings.beginGroup( "ogr/GPKG/connections", QgsSettings::Providers ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use the connections API instead of raw setting traversal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have a pointer to the API? which class is it? cheers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually - you could probably just create the completer directly using QgsProviderConnectionModel.
Nice move. Would be great to see the same applied to the new spatialite layer dialog. |
I am just not sure if this needs filtering to gpkg. |
@@ -129,6 +131,15 @@ QgsNewGeoPackageLayerDialog::QgsNewGeoPackageLayerDialog( QWidget *parent, Qt::W | |||
} | |||
checkOk(); | |||
} ); | |||
|
|||
QgsProviderConnectionModel *ogrProviderModel = new QgsProviderConnectionModel( "ogr" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QStringLiteral
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parent to "this", same with completer
I think yes.
For spatialite? No, you can use both For GPKGs we always use OGR provider. |
@elpaso , -1 to drop spatialite driver prior to going through cost of doing so. A little over a year ago, that cost included a speed drop that would arguably not be acceptable. We'd never consider dropping postgresql provider in favor of ogr either :) |
Interesting, is there any metric available?
That's not a fair comparison :) BTW look at who's maintaining it: I'm not dropping anything (even if I'd like to). |
@elpaso , yeah , I know you've given your fair share of sweat on this provider. The comparison to postgresql isn't fair but the basic argument remains: we have those providers for reasons and advantages that needs to be weighed seriously prior to taking decisions :) No fresh metrics but easy enough to come up with using large datasets. |
What really bothers me is that we are not running spatialite tests in travis. |
@elpaso how can I filter using QgsProviderConnectionModel? I need to create the provider or is there a way to find out (without looking at the filename extension)? |
@3nids I don't know, Nyall wrote it, but I see there is a provider (key) in the constructor. |
Could also be applied to |
Use a QSortFilterProxyModel |
@nyalldawson you wrote that ogr will strictly be gpgk, so no need to filter more, correct? if yes, ok to merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge away!
@3nids , just to avoid benevolent coding overlap, I'm handling the new spatialite dialog now. |