Created an auxiliary function 'KFilePlacesModel::movePlace'
ClosedPublic

Authored by renatoo on Nov 22 2017, 2:18 PM.

Details

Summary

with 'KFilePlacesModel::movePlace' the external APIs can easily move
items in the model without replicate the code.

Depends on D8947

Test Plan

Unit test created

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
renatoo created this revision.Nov 22 2017, 2:18 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 22 2017, 2:18 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
renatoo planned changes to this revision.Nov 22 2017, 2:26 PM
renatoo edited the summary of this revision. (Show Details)
renatoo added a reviewer: dfaure.

Implement unit test

dfaure added inline comments.Nov 22 2017, 2:56 PM
src/filewidgets/kfileplacesmodel.h
80

this doesn't match the names of the parameters, and use @p rather than single quotes.

renatoo updated this revision to Diff 22762.Nov 22 2017, 5:44 PM
renatoo marked an inline comment as done.

Implemented unit test
Fixed documentation

renatoo updated this revision to Diff 22771.Nov 22 2017, 5:58 PM

Updated parent branch

renatoo updated this revision to Diff 22783.Nov 22 2017, 7:16 PM

Updated from master

dfaure requested changes to this revision.Nov 22 2017, 10:33 PM
dfaure added inline comments.
autotests/kfileplacesmodeltest.cpp
1039

typo: position

1041

It was 0 already, so the TRY_ is unnecessary, if it's 0 it's ok right away, and if it's 1 then waiting more won't change it back to 0 ;)

1045

remove TRY_

src/filewidgets/kfileplacesmodel.cpp
635

why not just if (target > source) ? You're not using direction anywhere else.

636

Urgh, this shadows newTarget from the outer scope!
That's hard to read and feels like a bug.
Rename one of the variables.

637

missing space after while (repeats)

649

typo: beginning

This revision now requires changes to proceed.Nov 22 2017, 10:33 PM
renatoo updated this revision to Diff 22809.Nov 23 2017, 11:47 AM
renatoo marked 7 inline comments as done.

Fixed typos
Fixed code style

renatoo updated this revision to Diff 22818.Nov 23 2017, 11:54 AM

Parent branch updated

dfaure accepted this revision.Nov 23 2017, 11:54 AM
This revision is now accepted and ready to land.Nov 23 2017, 11:54 AM
renatoo updated this revision to Diff 22956.Nov 26 2017, 1:27 PM

Updated parent branch

renatoo updated this revision to Diff 22967.Nov 26 2017, 3:25 PM

Updated parent branch

renatoo updated this revision to Diff 23014.Nov 27 2017, 1:23 PM

Updated parent branch

Closed by commit R241:c8bd7ad4b296: Created an auxiliary function 'KFilePlacesModel::movePlace' (authored by Renato Araujo Oliveira Filho <renato.araujo@kdab.com>). · Explain WhyNov 27 2017, 1:57 PM
This revision was automatically updated to reflect the committed changes.