Skip to content

Commit

Permalink
Support for index.html in Contents/Resources/Documents
Browse files Browse the repository at this point in the history
  • Loading branch information
jkozera committed Mar 17, 2013
1 parent 386c768 commit 1bc00d0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion zeal/zeallistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@ QModelIndex ZealListModel::index(int row, int column, const QModelIndex &parent)
if(column == 0) {
return createIndex(row, column, (void*)getString(docsets->names().at(row)));
} else if(column == 1) {
return createIndex(row, column, (void*)getString(docsets->dir(docsets->names().at(row)).absoluteFilePath("index.html")));
QDir dir(docsets->dir(docsets->names().at(row)));
if(QFile(dir.absoluteFilePath("index.html")).exists()) {
return createIndex(row, column, (void*)getString(dir.absoluteFilePath("index.html")));
} else {
dir.cd("Contents"); dir.cd("Resources"); dir.cd("Documents");
return createIndex(row, column, (void*)getString(dir.absoluteFilePath("index.html")));
}
}
return QModelIndex();
} else {
Expand Down

0 comments on commit 1bc00d0

Please sign in to comment.