Port NetAccess to KF5
ClosedPublic

Authored by ochurlaud on Dec 3 2017, 4:58 PM.

Details

Summary

I didn't test remote file download/upload, but all tests are green.

The exist() replacement code is duplicated : it would be better to refactor in a namespace that can be used everywhere, but IMO this can be done later.

Please test further and tell me if i can merge this.

Diff Detail

Repository
R261 KMyMoney
Lint
Lint Skipped
Unit
Unit Tests Skipped
ochurlaud requested review of this revision.Dec 3 2017, 4:58 PM
ochurlaud created this revision.
ochurlaud added a reviewer: tbaumgart.
ochurlaud updated this revision to Diff 23379.Dec 3 2017, 5:27 PM

Fix a QTemporaryFile problem in my porting

ochurlaud updated this revision to Diff 23380.Dec 3 2017, 5:29 PM

Remove debugs

ochurlaud updated this revision to Diff 23383.Dec 3 2017, 5:31 PM
ochurlaud updated this revision to Diff 23387.Dec 3 2017, 5:53 PM

Fix upload permissions and bug

ochurlaud updated this revision to Diff 23394.Dec 3 2017, 6:26 PM

Fix upload issue

Hi Olivier,

why do you download and save the data into a file and then read it again? In my opinion it is easier to simply use the QByteArray returned by StoredTransferJob::data() directly.

Best
Chris

kmymoney/plugins/qif/import/kimportdlg.cpp
145

Q_CONSTEXPR short int detailLevel = 0; // "it's a file or a directory or a symlink, or it doesn't exist"

kmymoney/views/kmymoneyview.cpp
1337

Is this line intended?

Hi Olivier,

why do you download and save the data into a file and then read it again? In my opinion it is easier to simply use the QByteArray returned by StoredTransferJob::data() directly.

Best
Chris

Where? The code must work for a local file as well and loads /save files. So usong directly the data will imply more changes i think.

tbaumgart requested changes to this revision.Dec 4 2017, 7:10 AM
tbaumgart added inline comments.
kmymoney/kmymoney.cpp
1471

Could that function be made part of KMyMoneyUtils as a static? That way, you are able to reuse it other places as well.

kmymoney/views/kmymoneyview.cpp
1458

Q_CONSTEXPR int permission = -1;

This revision now requires changes to proceed.Dec 4 2017, 7:10 AM
ochurlaud updated this revision to Diff 23533.Dec 5 2017, 8:03 PM

Answer to Thomas requests

ochurlaud updated this revision to Diff 23534.Dec 5 2017, 8:05 PM
ochurlaud marked an inline comment as done.

Fix Christian's observation in kmymoney/plugins/qif/import/kimportdlg.cpp that I forgot

ochurlaud marked 3 inline comments as done.Dec 5 2017, 8:07 PM
tbaumgart added inline comments.Dec 6 2017, 10:31 AM
kmymoney/plugins/csvexport/csvexporterplugin.cpp
15

Can't you use KMyMoneyUtils::fileExists() here as well? What am I missing, if not?

I can't because kmymoneyutils is in a separate library and not exposed/exported.

If we want to change this, we need more changes, that can happen in another patch, doesn't it?

Isn't KMyMoneyUtils relatively big dependency? If yes, then I would refrain to use it in plugins at all, as it would add significantly to the size of simple plugin.

Isn't KMyMoneyUtils relatively big dependency? If yes, then I would refrain to use it in plugins at all, as it would add significantly to the size of simple plugin.

I would rather agree. Also, what i've done is rather simple: i might have put overkill checks :)

Anyway: good to go?

tbaumgart accepted this revision as: tbaumgart.Dec 8 2017, 9:51 AM
This revision was automatically updated to reflect the committed changes.