Skip to content
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

repair of definition files #162

Merged
merged 3 commits into from
May 6, 2019
Merged

Conversation

EtlamGit
Copy link
Collaborator

@EtlamGit EtlamGit commented May 5, 2019

This also closes #161

Added an new private method to DefinitionManager to hold all maintenance code regarding definition files. This contains for the moment:

  • force delete old hashed names (before Qt5.12 compatibility)
  • delete orphaned definitions in settings (matching files were deleted)
  • refresh old definitions on disk with build-in definitions (from newer releases)

@@ -264,6 +265,7 @@ void BlockIdentifier::parseDefinition(JSONObject *b, BlockInfo *parent,
name,
QMessageBox::Cancel, QMessageBox::Cancel);
}
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that rather than making this debug-only, the error message should be a bit more descriptive, while keeping it in the release version as well (so that it checks other authors' definition files as well).

How about Failed to add block %1 definition from file %2, because it is already present in the loaded definitions. ? I know it's not exactly what's happening, but it's still of much more help than the old message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File name is not available at that code position.

As the old text was only for me, it is obviously not descriptive. I tried a rephrase...

"Error hashing Block",
name,
"Error loading Block definition: " + name,
"Failed to add Block from definition file, as it might be a duplicate\nor generates the same hash than an already existing Block." ,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

than -> as and I'm happy :)

@mrkite mrkite merged commit 93ac26c into mrkite:master May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error hashing block (each blocktype)
3 participants