mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-06 23:57:39 +03:00
remove unsused functions
This commit is contained in:
parent
f5a7a56aac
commit
33b59ac56f
@ -72,50 +72,6 @@ std::unique_ptr<Txt> ReaderActivity::loadTxt(const std::string& path) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReaderActivity::onSelectBookFile(const std::string& path) {
|
|
||||||
currentBookPath = path; // Track current book path
|
|
||||||
exitActivity();
|
|
||||||
enterNewActivity(new FullScreenMessageActivity(renderer, mappedInput, "Loading..."));
|
|
||||||
|
|
||||||
if (isXtcFile(path)) {
|
|
||||||
// Load XTC file
|
|
||||||
auto xtc = loadXtc(path);
|
|
||||||
if (xtc) {
|
|
||||||
onGoToXtcReader(std::move(xtc));
|
|
||||||
} else {
|
|
||||||
exitActivity();
|
|
||||||
enterNewActivity(new FullScreenMessageActivity(renderer, mappedInput, "Failed to load XTC",
|
|
||||||
EpdFontFamily::REGULAR, EInkDisplay::HALF_REFRESH));
|
|
||||||
delay(2000);
|
|
||||||
goToLibrary();
|
|
||||||
}
|
|
||||||
} else if (isTxtFile(path)) {
|
|
||||||
// Load TXT file
|
|
||||||
auto txt = loadTxt(path);
|
|
||||||
if (txt) {
|
|
||||||
onGoToTxtReader(std::move(txt));
|
|
||||||
} else {
|
|
||||||
exitActivity();
|
|
||||||
enterNewActivity(new FullScreenMessageActivity(renderer, mappedInput, "Failed to load TXT",
|
|
||||||
EpdFontFamily::REGULAR, EInkDisplay::HALF_REFRESH));
|
|
||||||
delay(2000);
|
|
||||||
goToLibrary();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Load EPUB file
|
|
||||||
auto epub = loadEpub(path);
|
|
||||||
if (epub) {
|
|
||||||
onGoToEpubReader(std::move(epub));
|
|
||||||
} else {
|
|
||||||
exitActivity();
|
|
||||||
enterNewActivity(new FullScreenMessageActivity(renderer, mappedInput, "Failed to load epub",
|
|
||||||
EpdFontFamily::REGULAR, EInkDisplay::HALF_REFRESH));
|
|
||||||
delay(2000);
|
|
||||||
goToLibrary();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReaderActivity::goToLibrary(const std::string& fromBookPath) {
|
void ReaderActivity::goToLibrary(const std::string& fromBookPath) {
|
||||||
// If coming from a book, start in that book's folder; otherwise start from root
|
// If coming from a book, start in that book's folder; otherwise start from root
|
||||||
const auto initialPath = fromBookPath.empty() ? "/" : extractFolderPath(fromBookPath);
|
const auto initialPath = fromBookPath.empty() ? "/" : extractFolderPath(fromBookPath);
|
||||||
|
|||||||
@ -21,7 +21,6 @@ class ReaderActivity final : public ActivityWithSubactivity {
|
|||||||
static bool isTxtFile(const std::string& path);
|
static bool isTxtFile(const std::string& path);
|
||||||
|
|
||||||
static std::string extractFolderPath(const std::string& filePath);
|
static std::string extractFolderPath(const std::string& filePath);
|
||||||
void onSelectBookFile(const std::string& path);
|
|
||||||
void goToLibrary(const std::string& fromBookPath = "");
|
void goToLibrary(const std::string& fromBookPath = "");
|
||||||
void onGoToEpubReader(std::unique_ptr<Epub> epub);
|
void onGoToEpubReader(std::unique_ptr<Epub> epub);
|
||||||
void onGoToXtcReader(std::unique_ptr<Xtc> xtc);
|
void onGoToXtcReader(std::unique_ptr<Xtc> xtc);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user