-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 highlight features when "follow map theme" is selected in map layout #36007
Add highlight features when "follow map theme" is selected in map layout #36007
Conversation
…ut maps" This reverts commit a96b568.
…that follows map themes
Hello @jgrocha, Just to be sure I cloned your branch and added these outputs in // Add the theme and set it
newPresetName = presetName + QStringLiteral( "__highlight" );
std::cout << "newPresetName: " << newPresetName.toStdString() << std::endl;
for ( const QString &theme : c->project()->mapThemeCollection()->mapThemes() )
std::cout << "Existing map theme: " << theme.toStdString() << std::endl; Then I manually throw an exception just before calling the throw QgsException( QStringLiteral( "Fake exception." ) );
unConfigurePrintLayout( layout.get() ); After the first WMS GetPrint request I have: newPresetName: World__highlight
Existing map theme: World
15:13:33 CRITICAL Server[416879]: Fake exception. After the second request: newPresetName: World__highlight
Existing map theme: World
Existing map theme: World__highlight
15:13:33 CRITICAL Server[416879]: Fake exception. In this case we see that the map theme collection is not correctly cleaned if the What do you think @jgrocha? So if I'm not wrong, we should think about using something like the |
Hi @pblottiere I've tested the code again. I've comment out
|
ebb6427
to
c77bfd1
Compare
Indeed, results of the requests will be the same with or without the So, in order to be perfectly robust and avoid strange side effects, I think we have to keep the shared
The So I think that we're in the same situation here. @jgrocha let me know if I'm missing something. |
Hi @pblottiere I'm learning slow, but you are being very helpful in your comments. As far as I understand, my challenge is to improve |
Hi @jgrocha,
Good, I'm not totally useless then :).
Yes. However, even if the mechanism would be the same as the And considering that the
This way we'd replace the usual: std::unique_ptr<QgsLayerRestorer> restorer;
restorer.reset( new QgsLayerRestorer( mContext.layers() ) ); by: std::unique_ptr<QgsContextRestorer> restorer;
restorer.reset( new QgsContextRestorer( mContext ) ); (the context has access to layers, project, ...). I think it's robust and the mechanism can easily evolve in time to support more restoration actions. @jgrocha what do you think? If you're not comfortable enough, I can work on that part by modifying your branch. Let me know what you prefer. And do not hesitate to share if you think I'm missing something. |
Fully agree with your comments. We need something with a boarder scope than the current If you don't mind - if you can afford the time and dedication - I would prefer that you introduce such important design decision into the code. If you think my branch is good enough to start, please use it. I can handle this (maybe!) if necessary, but it would be awesome if your can take this into your own hands @pblottiere. Please feel free to close this PR as soon as you submit yours. |
@jgrocha The new restorer mechanism has been merged so I think you can smoothly add a project restorer now. |
c77bfd1
to
b3f2881
Compare
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
…-top-of-locked-layers-mc merge updated upstream qgis repo into my dev branch
Hi @jgrocha, Do you plan to take a look to this PR for the 3.14 release? If not, I think I can dedicate some time to work on it. |
I would love to, but right now I'm quite limited on time. If you can work on this, it would be great. Thank you! |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist. |
Description
This is exactly the same as #34271. I closed the previous one, because I pushed my local repo with a rebase (instead of merge).
All the previous discussion is there.
Fix #34178