<file>icons/bookmark.png</file>
<file>icons/bookmarks.png</file>
<file>icons/mac/bookmarks.png</file>
- <file>books/2 B R 0 2 B.epub</file>
<file>styles/day.js</file>
<file>styles/default.js</file>
<file>styles/night.js</file>
<file>icons/info.png</file>
<file>icons/mac/info.png</file>
<file>icons/mac/library.png</file>
+ <file>books/2BR02B.epub</file>
</qresource>
</RCC>
}
else {
if (!library->rowCount()) {
- library->add(":/books/2 B R 0 2 B.epub");
+ library->add(":/books/2BR02B.epub");
}
library->setNowReading(library->index(0));
}
QString Book::tmpDir() const
{
QString tmpName = QFileInfo(mTempFile.fileName()).fileName();
- return QDir::tempPath() + "/dorian/" + tmpName;
+ return QDir(QDir::temp().absoluteFilePath("dorian")).
+ absoluteFilePath(tmpName);
}
bool Book::extract()
qCritical() << "Book::extract: Failed to remove" << tmp;
return false;
}
- QDir d;
- if (!d.mkpath(tmp)) {
- qCritical() << "Book::extract: Could not create" << tmp;
- return false;
+ QDir d(tmp);
+ if (!d.exists()) {
+ if (!d.mkpath(tmp)) {
+ qCritical() << "Book::extract: Could not create" << tmp;
+ return false;
+ }
}
// If book comes from resource, copy it to the temporary directory first
QString bookPath = path();
if (bookPath.startsWith(":/books/")) {
QFile src(bookPath);
- QString dst(tmp + "/book.epub");
+ QString dst(QDir(tmp).absoluteFilePath("book.epub"));
if (!src.copy(dst)) {
- qCritical() << "Book::extract: Failed to copy built-in book to"
- << dst;
+ qCritical() << "Book::extract: Failed to copy built-in book"
+ << bookPath << "to" << dst;
return false;
}
bookPath = dst;