diff --git a/src/defaultprovider.cpp b/src/defaultprovider.cpp index de88106f..c932ec31 100644 --- a/src/defaultprovider.cpp +++ b/src/defaultprovider.cpp @@ -51,7 +51,6 @@ QString polishedBaseDir() return QString(); } QDir dir(base); - qDebug() << "Found Base Path in config file" << dir.path(); if (dir.cd("current")) { qDebug() << "Found Base Path in config file (with current)" << dir.path(); @@ -394,7 +393,6 @@ QString DefaultProvider::createV2BaseDir(const QString& base) currV2Dir.cd(fragment); currV2Dir.mkdir("numbercycles"); currV2Dir.mkdir("xmldoc"); - currV2Dir.mkdir("pdf"); } cnt++; } while(!(ok && cnt < 5)); diff --git a/src/models/documentmodel.cpp b/src/models/documentmodel.cpp index 2c674d8a..ef15e0f5 100644 --- a/src/models/documentmodel.cpp +++ b/src/models/documentmodel.cpp @@ -54,7 +54,7 @@ void DocumentModel::removeAllData() void DocumentModel::appendNewDoc(const DocDigest& digest) { - int r = rowCount(QModelIndex())-1; + int r = rowCount(QModelIndex()); beginInsertRows(QModelIndex(), r, r); addData(digest); endInsertRows(); diff --git a/src/portal.cpp b/src/portal.cpp index 9a051354..1d94a1c4 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -453,27 +453,20 @@ void Portal::slotStartupChecks() // Database is up and runing! // Check the document storage and see if the docs are converted already. - const QString v2BaseDir = KraftSettings::self()->kraftV2BaseDir(); - if (v2BaseDir.isEmpty()) { - // not yet converted! - } else { - QFileInfo fi(QDir(v2BaseDir), "current"); - if (fi.isSymLink()) { - qDebug() << "Kraft Version 2 document dir:" << fi.symLinkTarget(); - } else { - qDebug() << "V2 path malformed"; - } + QString basePath = DefaultProvider::self()->kraftV2Dir(); + if (basePath.isEmpty()) { + // conversion has not yet happened + basePath = slotConvertToXML(); } - // Initialize DocIndex - const QString basePath = DefaultProvider::self()->kraftV2Dir(); if (basePath.isEmpty()) { - // conversion has not yet happened - slotConvertToXML(); + qCritical() << "BasePath is still empty after conversion - XML conversion failed."; + return; // FIXME Error handling. } else { XmlDocIndex indx; indx.setBasePath(basePath); } + m_portalView->slotBuildView(); m_portalView->fillCatalogDetails(); m_portalView->fillSystemDetails();