MCPcopy Create free account
hub / github.com/KDE/okular / Document

Method Document

generators/txt/document.cpp:19–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17using namespace Txt;
18
19Document::Document(const QString &fileName)
20{
21#ifdef TXT_DEBUG
22 qCDebug(OkularTxtDebug) << "Opening file" << fileName;
23#endif
24
25 QFile plainFile(fileName);
26 if (!plainFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
27 qCDebug(OkularTxtDebug) << "Can't open file" << plainFile.fileName();
28 return;
29 }
30
31 const QByteArray buffer = plainFile.readAll();
32 setPlainText(toUnicode(buffer));
33}
34
35Document::~Document()
36{

Callers

nothing calls this directly

Calls 2

openMethod · 0.45
fileNameMethod · 0.45

Tested by

no test coverage detected