Commit bb85d284 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Merge remote-tracking branch 'origin/release/19.12'

parents f05a46d9 a21b31c0
......@@ -128,4 +128,8 @@
<provides>
<binary>kwordquiz</binary>
</provides>
<releases>
<release version="19.12.1" date="2020-01-09"/>
<release version="19.12.0" date="2019-12-12"/>
</releases>
</component>
......@@ -615,13 +615,14 @@ void KWordQuizApp::openDocumentFile(const QUrl &url)
{
slotStatusMsg(i18n("Opening file..."));
if (!url.isEmpty()) {
m_tableModel->beginResetModel();
int result = m_doc->open(url);
if (result == KEduVocDocument::NoError) {
while (m_doc->identifierCount() < 2) { //if we opened a TAB-less CSV, there
m_doc->appendIdentifier(); //may be 0 or 1 identifiers, we need at least 2
}
m_tableModel->endResetModel();
//m_tableModel->reset();
m_dirWatch->addFile(url.path());
setWindowTitle(m_doc->url().fileName() + "[*]");
setWindowModified(false);
......@@ -643,8 +644,10 @@ void KWordQuizApp::openDocumentFile(const QUrl &url)
break;
}
}
else
else {
KMessageBox::error(this, KEduVocDocument::errorDescription(result));
m_tableModel->endResetModel();
}
}
slotStatusMsg(i18nc("@info:status ready", "Ready"));
}
......
......@@ -38,13 +38,15 @@ KWQTableModel::~KWQTableModel()
int KWQTableModel::rowCount(const QModelIndex & parent) const
{
Q_UNUSED(parent);
if (parent.isValid())
return 0;
return m_doc->lesson()->entryCount(KEduVocLesson::Recursive);
}
int KWQTableModel::columnCount(const QModelIndex & parent) const
{
Q_UNUSED(parent);
if (parent.isValid())
return 0;
return 2;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment