Move attachment temporary file handling from Incidence to Attachment
AbandonedPublic

Authored by vkrause on Jun 30 2019, 8:25 AM.

Details

Reviewers
None
Summary

This is another refactoring step towards making Attachment an implicitly
shared value type too. The now deprecated methods will be removed as part
of that switch.

Diff Detail

Repository
R172 KCalendar Core
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 13417
Build 13435: arc lint + arc unit
vkrause created this revision.Jun 30 2019, 8:25 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptJun 30 2019, 8:25 AM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
vkrause requested review of this revision.Jun 30 2019, 8:25 AM
pino added a subscriber: pino.Jun 30 2019, 8:46 AM

What about instead not add any temporary file handling to Attachment?

After all, writeAttachmentToTempFile() seems to be used only in two places (both in calendarsupport):

  1. src/incidenceattachmentmodel.cpp
  2. src/utils.cpp

At least (2) looks easy enough to port away: in non-uri attachments, create the destination file, and write data() directly to it (without KIO).

vkrause abandoned this revision.Jun 30 2019, 1:02 PM
In D22161#488303, @pino wrote:

What about instead not add any temporary file handling to Attachment?

After all, writeAttachmentToTempFile() seems to be used only in two places (both in calendarsupport):

  1. src/incidenceattachmentmodel.cpp
  2. src/utils.cpp At least (2) looks easy enough to port away: in non-uri attachments, create the destination file, and write data() directly to it (without KIO).

It's actually even easier, none of the code using this actually seems to be used... Thanks for noticing, I'll remove this altogether then.