mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-26 23:57:22 -08:00
Laying down a path for ePUB support
This commit is contained in:
parent
61e83d2596
commit
69327c5363
2 changed files with 28 additions and 7 deletions
21
reader.h
21
reader.h
|
@ -79,6 +79,15 @@ public:
|
|||
mount_proc->start(mount_prog, mount_args);
|
||||
mount_proc->waitForFinished();
|
||||
|
||||
if(epub_file_match(book) == true) {
|
||||
// Parsing ePUB with epub2txt, thanks to GitHub:kevinboone
|
||||
|
||||
}
|
||||
else {
|
||||
// This is likely not an ePUB.
|
||||
;
|
||||
}
|
||||
|
||||
// Copying book specified in the function call
|
||||
QFile::copy(book, "/inkbox/book/book.txt");
|
||||
|
||||
|
@ -187,6 +196,18 @@ public:
|
|||
}
|
||||
config.close();
|
||||
};
|
||||
bool epub_file_match(QString file) {
|
||||
QString fileExt = file.right(4);
|
||||
|
||||
if(fileExt == "epub" or fileExt=="EPUB") {
|
||||
qDebug() << "True.";
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
qDebug() << "False.";
|
||||
return false;
|
||||
}
|
||||
};
|
||||
void string_writeconfig(string file, string config_option) {
|
||||
ofstream fhandler;
|
||||
fhandler.open(file);
|
||||
|
|
14
reader.ui
14
reader.ui
|
@ -16,7 +16,7 @@
|
|||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="10" column="0">
|
||||
<item row="9" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -143,7 +143,7 @@
|
|||
<widget class="QWidget" name="page_5"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="0">
|
||||
<item row="16" column="0">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
|
@ -156,7 +156,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<item row="12" column="0">
|
||||
<widget class="QStackedWidget" name="wordWidget">
|
||||
<widget class="QWidget" name="page_8">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
|
@ -521,7 +521,7 @@
|
|||
<widget class="QWidget" name="page_13"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="text">
|
||||
<property name="font">
|
||||
<font>
|
||||
|
@ -540,7 +540,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="0">
|
||||
<item row="17" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="4">
|
||||
<widget class="Line" name="line_3">
|
||||
|
@ -616,7 +616,7 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<item row="11" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -662,7 +662,7 @@
|
|||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
|
|
Loading…
Reference in a new issue