MCPcopy Create free account
hub / github.com/KDE/labplot / loadDocument

Method loadDocument

src/frontend/datasources/JsonOptionsWidget.cpp:99–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void JsonOptionsWidget::loadDocument(const QString& filename) {
100 PERFTRACE(QStringLiteral("JsonOptionsWidget::loadDocument"));
101 if (m_filename == filename)
102 return;
103 else
104 m_filename = filename;
105
106 KCompressionDevice device(m_filename);
107 m_model->clear();
108 if (!device.open(QIODevice::ReadOnly) || (device.atEnd() && !device.isSequential()) || // empty file
109 !m_model->loadJson(device.readAll()))
110 clearModel();
111}
112
113QAbstractItemModel* JsonOptionsWidget::model() {
114 return m_model;

Callers 1

updateContentMethod · 0.80

Calls 5

atEndMethod · 0.80
isSequentialMethod · 0.80
loadJsonMethod · 0.80
clearMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected