mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-28 00:27:21 -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->start(mount_prog, mount_args);
|
||||||
mount_proc->waitForFinished();
|
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
|
// Copying book specified in the function call
|
||||||
QFile::copy(book, "/inkbox/book/book.txt");
|
QFile::copy(book, "/inkbox/book/book.txt");
|
||||||
|
|
||||||
|
@ -187,6 +196,18 @@ public:
|
||||||
}
|
}
|
||||||
config.close();
|
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) {
|
void string_writeconfig(string file, string config_option) {
|
||||||
ofstream fhandler;
|
ofstream fhandler;
|
||||||
fhandler.open(file);
|
fhandler.open(file);
|
||||||
|
|
14
reader.ui
14
reader.ui
|
@ -16,7 +16,7 @@
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="10" column="0">
|
<item row="9" column="0">
|
||||||
<spacer name="verticalSpacer_2">
|
<spacer name="verticalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
<widget class="QWidget" name="page_5"/>
|
<widget class="QWidget" name="page_5"/>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="17" column="0">
|
<item row="16" column="0">
|
||||||
<widget class="Line" name="line_2">
|
<widget class="Line" name="line_2">
|
||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Plain</enum>
|
<enum>QFrame::Plain</enum>
|
||||||
|
@ -156,7 +156,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="13" column="0">
|
<item row="12" column="0">
|
||||||
<widget class="QStackedWidget" name="wordWidget">
|
<widget class="QStackedWidget" name="wordWidget">
|
||||||
<widget class="QWidget" name="page_8">
|
<widget class="QWidget" name="page_8">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
@ -521,7 +521,7 @@
|
||||||
<widget class="QWidget" name="page_13"/>
|
<widget class="QWidget" name="page_13"/>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="0">
|
<item row="10" column="0">
|
||||||
<widget class="QLabel" name="text">
|
<widget class="QLabel" name="text">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
|
@ -540,7 +540,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="18" column="0">
|
<item row="17" column="0">
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="0" column="4">
|
<item row="0" column="4">
|
||||||
<widget class="Line" name="line_3">
|
<widget class="Line" name="line_3">
|
||||||
|
@ -616,7 +616,7 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="0">
|
<item row="11" column="0">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -662,7 +662,7 @@
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="4" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="Line" name="line_4">
|
<widget class="Line" name="line_4">
|
||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Plain</enum>
|
<enum>QFrame::Plain</enum>
|
||||||
|
|
Loading…
Reference in a new issue