Pluginize XML Storage
ClosedPublic

Authored by wojnilowicz on Jun 2 2018, 6:33 AM.

Details

Summary

The goal of this patch is to open supported files in alike ways i.e. through KMyMoneyPlugin::StoragePlugin. This is the first step to make Qt5::Xml dependency optional by encapsulating saving as XML file in a plugin.
The patch is transient as "opening", "saving" and "saving as" could be made consistent in kmymoney.cpp. GNC reader could also be made consistent with XML and SQL storage. KMyMoneyPlugin::StoragePlugin could also be extended by identification of its own file formats.
With this patch I want to know if all works well.

Test Plan

Used save, save as and open XML and GNC file.

Diff Detail

Repository
R261 KMyMoney
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
wojnilowicz requested review of this revision.Jun 2 2018, 6:33 AM
wojnilowicz created this revision.
tbaumgart requested changes to this revision.Jun 2 2018, 1:15 PM

In general looks OK to me. Did some casual testing (saving/loading).

kmymoney/kmymoney.cpp
2405

Why don't you use QLatin1String here?

This revision now requires changes to proceed.Jun 2 2018, 1:15 PM
wojnilowicz added inline comments.Jun 2 2018, 1:38 PM
kmymoney/kmymoney.cpp
2405

Hmm... it's not the best.
According to this source it should be QStringLiteral. I'll fix it.

This revision was not accepted when it landed; it landed in state Needs Revision.Jun 2 2018, 2:19 PM
This revision was automatically updated to reflect the committed changes.
ocoole added a subscriber: ocoole.Jun 3 2018, 1:25 PM
  1. Open kmm (xml) file
  2. Disable xml storage plugin and close kmm
  3. Start kmm again

[kmm tries to load last used (xml) file (and xml storage plugin disabled)]

  1. "Couldn't find suitable plugin to read your storage." Press "OK"
  2. Crash
  1. Open kmm (xml) file
  2. Disable xml storage plugin and close kmm
  3. Start kmm again [kmm tries to load last used (xml) file (and xml storage plugin disabled)]
  4. "Couldn't find suitable plugin to read your storage." Press "OK"
  5. Crash

I know about this. It was present before with SQL storage. I'm working on making opening, saving and closing files reliable and more transparent. Please be patient.