Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/libebook/ebook_epub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <QByteArray>
#include <QChar>
#include <QIODevice>
#include <QFileInfo>
#include <QList>
#include <QMessageBox>
#include <QString>
Expand Down Expand Up @@ -224,8 +225,8 @@ bool EBook_EPUB::parseBookinfo()
if ( !parseXML( container_parser.contentPath, &content_parser ) )
return false;

// At least title and the TOC must be present
if ( !content_parser.metadata.contains( "title" ) || content_parser.tocname.isEmpty() )
// At least the TOC must be present
if ( content_parser.tocname.isEmpty() )
return false;

// All the files, including TOC, are relative to the container_parser.contentPath
Expand All @@ -242,7 +243,10 @@ bool EBook_EPUB::parseBookinfo()
return false;

// Get the data
m_title = content_parser.metadata[ "title" ];
if ( content_parser.metadata.contains( "title" ) )
m_title = content_parser.metadata[ "title" ];
else
m_title = QFileInfo( m_epubFile ).fileName();

// Move the manifest entries into the list
Q_FOREACH ( QString f, content_parser.manifest.values() )
Expand Down
4 changes: 2 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ bool MainWindow::loadFile( const QString& loadFileName, bool call_open_page )
else
{
QMessageBox mbox(
i18n( "%1 - failed to load the chm file" ) . arg( QCoreApplication::applicationName() ),
i18n( "Unable to load the chm file %1" ) . arg( fileName ),
i18n( "%1 - failed to load file" ) . arg( QCoreApplication::applicationName() ),
i18n( "Unable to load file %1" ) . arg( fileName ),
QMessageBox::Critical,
QMessageBox::Ok,
Qt::NoButton,
Expand Down