View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017136 | Scribus | Internal | public | 2024-01-20 20:21 | 2024-02-12 21:10 |
Reporter | ale | Assigned To | jghali | ||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Product Version | 1.7.0.svn | ||||
Fixed in Version | 1.7.0.svn | ||||
Summary | 0017136: multiLine should start with a capital M and probably does not need the operator != | ||||
Description | https://gitlab.com/scribus/scribus/-/blob/master/scribus/scribusstructs.h?ref_type=heads#L179 class multiLine : public QList<SingleLine> { public: QString shortcut; bool operator!=(const multiLine& other) const { return !(this->operator ==(other)); } }; should probably simply be: struct MultiLine : public QList<SingleLine> { QString shortcut; }; since QList already has != (https://doc.qt.io/qt-6/qlist.html#operator-not-eq) and there is no specific logic implemented. | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
Given the only difference between a class and a struct is the default accessibility, there is no advantage in changing multiLine to a struct. However I agree that the renaming to MultiLine is long overdue, so I did it in r26001 (1.6.x) and r26002 (trunk). |
|
well, i would not have reported any of the three issues alone... but seeing the three together, made me report all of them. and the lowercase m was indeed the most disturbing to me. thanks for fixing that. later, i thought that since it extends a QList, it's also ok if it's a class... i guess that the real fix here would be to make it a struct (with no inheritance) that has a QList field. i'm not that sure that Qt recommends the extensions of its data structures to add a "shortcut" field... but it's probably too late to do that. remains the operator !=. i just did a short test (with a std::vector...) and it seems to be just as useless as it looks. i would be glad, if it could be removed or a comment added with the reasons why it's being kept. |
|
The operator != was added (by me) in commit r9403 which had following message: "fix 0005654 : copy of a frame with line style trigger crash". Honestly I don't remember why it was added. Maybe a build issue at that time... |
|
I removed that operator!= from MultiLine, but only in trunk, and left a comment. |
|
ok, thanks |
Date Modified | Username | Field | Change |
---|---|---|---|
2024-01-20 20:21 | ale | New Issue | |
2024-01-20 20:28 | jghali | Category | General => Internal |
2024-01-20 23:21 | jghali | Summary | multiLine: should be a struct, start with a capital M and probably does not need the operator != => multiLine should start with a capital M and probably does not need the operator != |
2024-01-20 23:25 | jghali | Note Added: 0050921 | |
2024-01-21 08:02 | ale | Note Added: 0050922 | |
2024-01-22 22:20 | jghali | Note Added: 0050930 | |
2024-01-23 19:21 | jghali | Note Added: 0050931 | |
2024-01-23 19:21 | jghali | Assigned To | => jghali |
2024-01-23 19:21 | jghali | Status | new => resolved |
2024-01-23 19:21 | jghali | Resolution | open => fixed |
2024-01-23 19:21 | jghali | Fixed in Version | => 1.7.0.svn |
2024-01-24 12:41 | ale | Note Added: 0050932 | |
2024-02-12 21:10 | cbradney | Status | resolved => closed |