-
Notifications
You must be signed in to change notification settings - Fork 98
Add option to force reset config on start of application #5223
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 option to force reset config on start of application #5223
Conversation
| cfg.reset( appName ); | ||
| if ( reset ) | ||
| { | ||
| cfg.setFullConfig( Json::Value() ); | ||
| cfg.reset( appName ); | ||
| } |
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.
| cfg.reset( appName ); | |
| if ( reset ) | |
| { | |
| cfg.setFullConfig( Json::Value() ); | |
| cfg.reset( appName ); | |
| } | |
| if ( reset ) | |
| cfg.setFullConfig( Json::Value() ); | |
| cfg.reset( appName ); |
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.
will not work this way, let me add comment
source/MRViewer/MRSetupViewer.h
Outdated
| /// Sets custom viewer settings manager to viewer | ||
| MRVIEWER_API virtual void setupSettingsManager( Viewer* viewer, const std::string& appName ) const; | ||
| /// reset - flags indicates that user launched application with request for reseting config file | ||
| MRVIEWER_API virtual void setupSettingsManager( Viewer* viewer, const std::string& appName, bool reset ) const; |
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.
| MRVIEWER_API virtual void setupSettingsManager( Viewer* viewer, const std::string& appName, bool reset ) const; | |
| MRVIEWER_API virtual void setupSettingsManager( Viewer* viewer, const std::string& appName, bool reset = false ) const; |
source/MRMesh/MRConfig.h
Outdated
| MRMESH_API void setJsonValue( const std::string& key, const Json::Value& keyValue ); | ||
|
|
||
| /// returns json with content of this config | ||
| Json::Value getFullConfig() const { return config_; } |
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.
toJson?
source/MRMesh/MRConfig.h
Outdated
| Json::Value getFullConfig() const { return config_; } | ||
|
|
||
| /// replace current config content with given one | ||
| void setFullConfig( const Json::Value& config ) { config_ = config; } |
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.
setFromJson?
| cfg.reset( appName ); | ||
| if ( reset ) | ||
| { | ||
| cfg.setFullConfig( Json::Value() ); | ||
| cfg.reset( appName ); | ||
| } |
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 we need to call setFullConfig between two resets rather than before one?
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.
unfortunately
source/MRViewer/MRSetupViewer.h
Outdated
| /// Sets custom viewer settings manager to viewer | ||
| MRVIEWER_API virtual void setupSettingsManager( Viewer* viewer, const std::string& appName ) const; | ||
| /// reset - flags indicates that user launched application with request for reseting config file | ||
| MRVIEWER_API virtual void setupSettingsManager( Viewer* viewer, const std::string& appName, bool reset ) const; |
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.
bool reset = false by default?
source/MRViewer/MRSetupViewer.h
Outdated
|
|
||
| /// Sets custom viewer settings manager to viewer | ||
| MRVIEWER_API virtual void setupSettingsManager( Viewer* viewer, const std::string& appName ) const; | ||
| /// reset - flags indicates that user launched application with request for reseting config file |
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.
\param reset
No description provided.