-
-
Notifications
You must be signed in to change notification settings - Fork 216
Try to make MD generation robust #5884
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
base: development
Are you sure you want to change the base?
Conversation
QMLComponents/controls/jaspcontrol.h
Outdated
typedef struct MDItem | ||
{ | ||
bool isSection = false; | ||
QString label, | ||
info; | ||
std::vector<struct MDItem> children; | ||
|
||
MDItem() {} | ||
MDItem(const QString& _label) : label{_label} {} | ||
|
||
bool isEmpty() { return label.isEmpty() && info.isEmpty() && children.size() == 0; } | ||
bool hasHeader() { return !label.isEmpty() || !info.isEmpty(); } | ||
|
||
QString print(int depth = 0) const; | ||
|
||
|
||
} MDItem; |
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.
Why? Please why?
5d7e1cb
to
d4a7a4a
Compare
I have removed the MDItems structure. |
9e16efa
to
9a61545
Compare
|
||
void JASPControl::setMDSubItems() | ||
{ | ||
_MDSubItems.clear(); |
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.
I dont like this at all...
Why do we need this function?
You can just do this determination in the generateMDHelp function...
Or let this return a list of JASPControl*
But why store it?
Then we need to think about when to update it...
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.
_MDSubItems
should not exist.
The function that determines this should just return std::vector<JASPControl*>
and not store anything.
Sub items that do not have labels or info, should be set at the same level as their parents. For this, the hierarchy of the items should be kept, before generating the MD string.
9a61545
to
2d769b3
Compare
Sub items that do not have labels or info, should be set at the same level as their parents. For this, the hierarchy of the items should be kept, before generating the MD string.