Changeset View
Changeset View
Standalone View
Standalone View
src/writer.cpp
Show All 22 Lines | |||||
23 | 23 | | |||
24 | #include "writer.h" | 24 | #include "writer.h" | ||
25 | #include "writer_p.h" | 25 | #include "writer_p.h" | ||
26 | #include "writerplugin.h" | 26 | #include "writerplugin.h" | ||
27 | 27 | | |||
28 | using namespace KFileMetaData; | 28 | using namespace KFileMetaData; | ||
29 | 29 | | |||
30 | Writer::Writer() | 30 | Writer::Writer() | ||
31 | : d_ptr(new WriterPrivate) | 31 | : d(new WriterPrivate) | ||
32 | { | 32 | { | ||
33 | } | 33 | } | ||
34 | 34 | | |||
35 | Writer::~Writer() | 35 | Writer::~Writer() | ||
36 | { | 36 | { | ||
37 | Q_D(Writer); | 37 | delete d; | ||
38 | delete d->m_plugin; | | |||
39 | delete d_ptr; | | |||
40 | } | 38 | } | ||
41 | 39 | | |||
40 | Writer::Writer(Writer&& other) | ||||
41 | { | ||||
42 | d = other.d; | ||||
43 | other.d = nullptr; | ||||
44 | } | ||||
45 | | ||||
46 | | ||||
42 | void Writer::write(const WriteData& data) | 47 | void Writer::write(const WriteData& data) | ||
43 | { | 48 | { | ||
44 | Q_D(Writer); | | |||
45 | d->m_plugin->write(data); | 49 | d->m_plugin->write(data); | ||
46 | } | 50 | } | ||
47 | 51 | | |||
48 | QStringList Writer::mimetypes() const | 52 | QStringList Writer::mimetypes() const | ||
49 | { | 53 | { | ||
50 | Q_D(const Writer); | | |||
51 | return d->m_plugin->writeMimetypes(); | 54 | return d->m_plugin->writeMimetypes(); | ||
52 | } | 55 | } | ||
56 | | ||||
57 | void Writer::setAutoDeletePlugin(WriterPluginOwnership autoDelete) | ||||
58 | { | ||||
59 | d->m_autoDeletePlugin = autoDelete; | ||||
60 | } |