Column observer
ClosedPublic

Authored by Murmele on Jul 1 2019, 8:10 PM.

Details

Summary

If a column is deleted the combobox in the curve dock shows again the name of the column, but is marked red. So the user knows the column has removed, but if a column with the same name is created/imported it will connected to the curve.

Diff Detail

Repository
R262 LabPlot
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Murmele created this revision.Jul 1 2019, 8:10 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptJul 1 2019, 8:10 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
Murmele requested review of this revision.Jul 1 2019, 8:10 PM
asemke added inline comments.Jul 7 2019, 3:24 PM
src/CMakeLists.txt
185 ↗(On Diff #60963)

indentation.

src/backend/core/AspectTreeModel.cpp
197 ↗(On Diff #60963)

what is the advantage of moving this code to Column? I don't think the code is more compact now because of this change and you also need to implement the function in AbstractSimpleFilter.

src/backend/core/ColumnObserver.cpp
25 ↗(On Diff #60963)

if we don't need this function now, let's remove it. We can add it once we really need it.

src/backend/core/Project.cpp
208

no brackets here.

220

no brackets here.

225

doesn't have any affect. Can be also removed I guess.

227

no brackets for one-liners.

src/kdefrontend/dockwidgets/XYCurveDock.cpp
507

i18n("The column %1 is not available anymore. It will be automatically used once it is created again", m_curve->xColumnPath())

Murmele updated this revision to Diff 61290.Jul 7 2019, 5:09 PM
Murmele marked an inline comment as done.Jul 7 2019, 6:56 PM
Murmele added inline comments.
src/backend/core/AspectTreeModel.cpp
197 ↗(On Diff #60963)

Because I need it two times.

src/backend/core/Project.cpp
208

? which brackets?

Murmele updated this revision to Diff 61293.Jul 7 2019, 7:00 PM
Murmele marked 4 inline comments as done.
Murmele updated this revision to Diff 61295.Jul 7 2019, 7:29 PM
Murmele updated this revision to Diff 61454.Jul 9 2019, 8:23 PM
asemke added inline comments.Jul 10 2019, 6:49 AM
src/backend/core/Project.cpp
202

move this comment inside the function definition. This is the comment for the handling of columns only and not for the whole function which does a bit more.

221

in this for loop we call several set-functions which will produce a new entry on the undo/redo-stack. Do we want to have these entries if we change the name of a column? I'd say no. Le's work with curve->setUndoAware(false);
curve->set*Column(column);
curve->setUndoAware(true);

276

same here. Let's use setUndoAware(false) prior to setting the columns.

src/backend/core/Project.h
37

can be removed.

src/kdefrontend/dockwidgets/XYCurveDock.cpp
556

wouldn't it be easier here to provide the column and the column path directly to this function like

checkCurveAvailability(cbXColumn,  curve->xColumn(), curve->xColumnPath());

With this you'd avoid this cumbersome if-else logic in XYCurveDock::checkCurveAvailability().

Murmele updated this revision to Diff 61539.Jul 10 2019, 7:20 PM
Murmele updated this revision to Diff 61542.Jul 10 2019, 7:36 PM
Murmele marked 5 inline comments as done.
Murmele updated this revision to Diff 61602.Jul 11 2019, 3:23 PM
asemke accepted this revision.Jul 11 2019, 6:46 PM
This revision is now accepted and ready to land.Jul 11 2019, 6:46 PM
This revision was automatically updated to reflect the committed changes.