Skip to content

Commit

Permalink
Fix minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
dragotin committed Jun 16, 2024
1 parent be00b6d commit bf33008
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
2 changes: 0 additions & 2 deletions src/defaultprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion src/models/documentmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
21 changes: 7 additions & 14 deletions src/portal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit bf33008

Please sign in to comment.