-
-
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
Fix QSocketNotifier error on startup #5102
Conversation
src/core/qgsuserprofilemanager.h
Outdated
* | ||
* If \a watchProfileFolder is true, then the specified \a rootLocation will be watched and any newly added | ||
* profiles will cause profilesChanged() to be emitted. If \a watchProfileFolder is false, then the this will | ||
* not occur. |
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 add a very brief explanation of why you would (not) want the folder to be watched?
When did you get a socket error? |
You get one immediately on startup: "src/app/main.cpp: 450: (main) [0ms] Starting qgis main It's because the watcher is created before QgsApplication. |
I'm going to tweak this PR - I don't like the extra argument in the constructor. |
And avoid unnecessary creation of unused QFileSystemWatchers
10180f4
to
64489be
Compare
Ok, done. This is a much cleaner approach which makes the new profile watcher (and its notifications) explicitly opt-in.
Short lived instances of the manager are sometimes created just to handle resolving paths for profiles. In this case the profile addition notification signals aren't being used/wanted, so it's just extra overhead. I think the new approach is more self-explanatory, so let me know if you think the documentation is sufficient. |
Thanks. That looks good. |
Looks good to me now. |
%Docstring | ||
Emitted when the list of profiles is changed. | ||
|
||
This signal will only be emitted when isNewProfileNotificationEnabled() is true. | ||
By default By default new profile notification is disabled. |
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.
By default By default
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.
No sorry, as a native English speaker "by default by default" reads much better than "by default"....
... ok, I lie.
[ci skip]
And avoid unnecessary creation of unused QFileSystemWatchers