-
-
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
Some fixes for table join #452
Conversation
@minorua thanks for the fixes. Regarding the implementation, I think that updateFields() method should not become a part of public interface of QgsVectorLayer, instead it should be called only internally when the update is necessary. This function is really just an implementation detail that other classes should not need to care about. The refresh of field names should be done in a different way (again to avoid calling updateFields() from outside). I would suggest adding a "fieldsChanged" signal to QgsVectorDataProvider. It would be emitted when the encoding has been changed and later could be used also for other occasions where the provider needs to tell layer that its fields have been changed. QgsVectorLayer should have a private slot that would trigger the update of fields (maybe directly updateFields() could become a private slot). Could you please update your pull request? |
@wonder-sk Thank you for your advice. I realized that my idea was a bit shortsighted. |
Updated commits with new ones (old ones were moved to here). |
@minorua , @wonder-sk , I've filed http://hub.qgis.org/issues/7271 yesterday before seeing work done here. It might be that your work will fix the underlying issue(s) raised in issue 7271. Might be good for you to test out patched build for the problems raised in 7271. |
@nirvn Additional fix seems to be necessary for 7271. |
@minorua , oh :/ was hoping it wouldn't require additional efforts. the two problems raised there - namely column index shift when sorting and when doing symbology classification - are pretty big. The classification one is especially problematic as a user might not be aware he/she is classifying with data from the wrong column. |
The issues should be fixed together with 7271 (part of sort), since they are related. @nirvn Thanks for your advice! |
Modified commits so that correct indexOffset is calculated even if SubsetOfAttributes is specified in feature request (fix for 7271). |
@minorua , no problem, I'm the one who needs to thank you for all of your hard work! |
@wonder-sk While reviewing commits, I thought that a way of calling updateFields() from QgsVectorLayer::setProviderEncoding() is more simple. |
Maybe stupid question: but when this bug correction will be part of master? I need this fix, not only to master but also 1.8. |
Sorry, I've realized that the above commits do not completely fix the issue 7068-2. |
I see. I do hope you can fix those sooner than later. Sorry, but I can't really help. Unless testing is helping ;-) |
Added a commit to keep the backward compatibility of table join in project file. Please consider these commits. |
@wonder-sk , would be great to merge this when you have some free time. A QGIS 2.0 release with fixed table joins would be fantastic :) |
Some fixes for table join. Merged for wider testing.
I briefly tested this. Still some odd features:
I hope I can give you sample data and better report tomorrow. |
Well, It seems that you fix code before I can test ;-) I made some tests with shapefile and csv file: no problems. Then I made thest with Spatialite and csv-file: I can join csv to spatialite layer/view. I can see value in "Attribute table", but when I try to make thematic maps: Qgis will crash. I found log-message: "FAILURE: Field 4 not found". Field 4 seems to be first joined field: I have 4 field in my Spatialite view. QGIS code revision 9b83d1a If you need test data or other debug files, please ask. P |
@minorua Great, I just wait when it has been merged |
Fix
Also fix