KDocTools

xslt_kde.cpp
1#include "docbookxslt.h"
2#ifndef MEINPROC_NO_KARCHIVE
3#include <KCompressionDevice>
4#else
5#include "loggingcategory.h"
6#endif
7
8bool KDocTools::saveToCache(const QString &contents, const QString &filename)
9{
10#ifndef MEINPROC_NO_KARCHIVE
11 KCompressionDevice fd(filename);
12
13 if (!fd.open(QIODevice::WriteOnly)) {
14 return false;
15 }
16
17 fd.write(contents.toUtf8());
18 fd.close();
19#else
20 qCWarning(KDocToolsLog) << "This function is dummy because KArchive support has been disabled. "
21 "This mode should be enabled only for specific usage on KDE infrastructure.";
22 Q_UNUSED(contents)
23 Q_UNUSED(filename)
24#endif
25 return true;
26}
void close() override
bool open(QIODevice::OpenMode mode) override
KDOCTOOLS_EXPORT bool saveToCache(const QString &contents, const QString &filename)
Save the content (compressed) in the specified filename.
Definition xslt_kde.cpp:8
qint64 write(const QByteArray &data)
QByteArray toUtf8() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.