mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-26 23:57:22 -08:00
I was running on an old commit and messed it arround, nevermind, repaired
This commit is contained in:
parent
bb8b7aa278
commit
7a15ad3600
1 changed files with 21 additions and 21 deletions
|
@ -319,7 +319,7 @@ void localLibraryWidget::openBook(int bookID) {
|
||||||
|
|
||||||
void localLibraryWidget::btnOpenBook(int buttonNumber) {
|
void localLibraryWidget::btnOpenBook(int buttonNumber) {
|
||||||
log("Book/directory button clicked, buttonNumber is " + QString::number(buttonNumber), className);
|
log("Book/directory button clicked, buttonNumber is " + QString::number(buttonNumber), className);
|
||||||
if(mainPathAndItsEmpty == true) {
|
if(mainPathIsEmpty == true) {
|
||||||
return void();
|
return void();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ void localLibraryWidget::btnOpenBook(int buttonNumber) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void localLibraryWidget::openGoToPageDialog() {
|
void localLibraryWidget::openGoToPageDialog() {
|
||||||
if(mainPathAndItsEmpty == true) {
|
if(mainPathIsEmpty == true) {
|
||||||
return void();
|
return void();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,8 +351,8 @@ void localLibraryWidget::openGoToPageDialog() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void localLibraryWidget::goToPage(int page) {
|
void localLibraryWidget::goToPage(int page) {
|
||||||
checkIfMainPathEmpty();
|
checkIfMainPathIsEmpty();
|
||||||
if(mainPathAndItsEmpty == true) {
|
if(mainPathIsEmpty == true) {
|
||||||
return void();
|
return void();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,7 +406,7 @@ void localLibraryWidget::showToast(QString messageToDisplay) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void localLibraryWidget::openBookOptionsDialog(int pseudoBookID) {
|
void localLibraryWidget::openBookOptionsDialog(int pseudoBookID) {
|
||||||
if(mainPathAndItsEmpty == true) {
|
if(mainPathIsEmpty == true) {
|
||||||
return void();
|
return void();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,11 +474,11 @@ void localLibraryWidget::setupBooksListToggle(int pageNumber) {
|
||||||
|
|
||||||
void localLibraryWidget::setupBooksListFolders(int pageNumber) {
|
void localLibraryWidget::setupBooksListFolders(int pageNumber) {
|
||||||
log("Showing folders for page: " + QString::number(pageNumber), className);
|
log("Showing folders for page: " + QString::number(pageNumber), className);
|
||||||
QStringList dirList = QDir(pathForFolders).entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
|
QStringList directoryList = QDir(pathForFolders).entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
|
||||||
log("Full directory list: "+ dirList.join(","), className);
|
log("Full directory list is "+ directoryList.join(", ") + "'", className);
|
||||||
|
|
||||||
// Main path is set and its empty
|
// Main path is set and its empty
|
||||||
if(mainPathAndItsEmpty == true) {
|
if(mainPathIsEmpty == true) {
|
||||||
ui->pageNumberLabel->setText("0 <i>of</i> 0");
|
ui->pageNumberLabel->setText("0 <i>of</i> 0");
|
||||||
ui->previousPageBtn->setEnabled(false);
|
ui->previousPageBtn->setEnabled(false);
|
||||||
ui->nextPageBtn->setEnabled(false);
|
ui->nextPageBtn->setEnabled(false);
|
||||||
|
@ -486,8 +486,8 @@ void localLibraryWidget::setupBooksListFolders(int pageNumber) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This part is calculating which folders to show per page
|
// This part is calculating which folders to show per page
|
||||||
QStringList directoryListFront = dirList;
|
QStringList directoryListFront = directoryList;
|
||||||
QStringList directoryListBack = dirList;
|
QStringList directoryListBack = directoryList;
|
||||||
int pageNumberAbove = pageNumber;
|
int pageNumberAbove = pageNumber;
|
||||||
while(pageNumberAbove != 1) {
|
while(pageNumberAbove != 1) {
|
||||||
for (int i = 0; i < buttonsNumber; ++i) {
|
for (int i = 0; i < buttonsNumber; ++i) {
|
||||||
|
@ -497,7 +497,7 @@ void localLibraryWidget::setupBooksListFolders(int pageNumber) {
|
||||||
}
|
}
|
||||||
pageNumberAbove = pageNumberAbove - 1;
|
pageNumberAbove = pageNumberAbove - 1;
|
||||||
}
|
}
|
||||||
log("Front directory list: " + directoryListFront.join(","), className);
|
log("Front directory is '" + directoryListFront.join(", ") + "'", className);
|
||||||
|
|
||||||
int aboveRemove = pageNumber * buttonsNumber;
|
int aboveRemove = pageNumber * buttonsNumber;
|
||||||
if(directoryListBack.count() > aboveRemove) {
|
if(directoryListBack.count() > aboveRemove) {
|
||||||
|
@ -507,7 +507,7 @@ void localLibraryWidget::setupBooksListFolders(int pageNumber) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log("Back directory list: " + directoryListBack.join(","), className);
|
log("Back directory list '" + directoryListBack.join(", ") + "'", className);
|
||||||
|
|
||||||
QStringList directoryListPure;
|
QStringList directoryListPure;
|
||||||
for(QString directory: directoryListFront) {
|
for(QString directory: directoryListFront) {
|
||||||
|
@ -515,7 +515,7 @@ void localLibraryWidget::setupBooksListFolders(int pageNumber) {
|
||||||
directoryListPure.append(directory);
|
directoryListPure.append(directory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log("Final directory list: " + directoryListPure.join(","), className);
|
log("Final directory list '" + directoryListPure.join(", ") +"'", className);
|
||||||
|
|
||||||
idList.clear();
|
idList.clear();
|
||||||
int in = 1;
|
int in = 1;
|
||||||
|
@ -636,8 +636,8 @@ void localLibraryWidget::setupBooksListFolders(int pageNumber) {
|
||||||
void localLibraryWidget::calculateMaximumPagesNumberForFolders() {
|
void localLibraryWidget::calculateMaximumPagesNumberForFolders() {
|
||||||
log("Main path is '" + pathForFolders + "'", className);
|
log("Main path is '" + pathForFolders + "'", className);
|
||||||
|
|
||||||
checkIfMainPathEmpty();
|
checkIfMainPathIsEmpty();
|
||||||
if(mainPathAndItsEmpty == true) {
|
if(mainPathIsEmpty == true) {
|
||||||
return void();
|
return void();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -666,7 +666,7 @@ void localLibraryWidget::calculateMaximumPagesNumberForFolders() {
|
||||||
foreach (int number, booksListForPathIndex) {
|
foreach (int number, booksListForPathIndex) {
|
||||||
list.append(QString::number(number));
|
list.append(QString::number(number));
|
||||||
}
|
}
|
||||||
log("bookListForPathIndex is: " + list.join(","), className);
|
log("bookListForPathIndex is '" + list.join(", ") + "'", className);
|
||||||
|
|
||||||
directoryListCount = QDir(pathForFolders).entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name).count();
|
directoryListCount = QDir(pathForFolders).entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name).count();
|
||||||
log("Directories count in directory: " + QString::number(directoryListCount), className);
|
log("Directories count in directory: " + QString::number(directoryListCount), className);
|
||||||
|
@ -790,9 +790,9 @@ void localLibraryWidget::refreshFolders() {
|
||||||
goToPage(1);
|
goToPage(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void localLibraryWidget::checkIfMainPathEmpty() {
|
void localLibraryWidget::checkIfMainPathIsEmpty() {
|
||||||
if(folderFeatureEnabled == true) {
|
if(folderFeatureEnabled == true) {
|
||||||
// If the main path is empty, prevent it from well, freezing and using the cpu for 100% because of a while loop
|
// If the main path is empty, prevent it from freezing and using the CPU at 100% because of a while loop
|
||||||
if(pathForFolders == "/mnt/onboard/onboard/") {
|
if(pathForFolders == "/mnt/onboard/onboard/") {
|
||||||
bool isDirEmpty = QDir(pathForFolders).entryList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot).isEmpty();
|
bool isDirEmpty = QDir(pathForFolders).entryList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot).isEmpty();
|
||||||
log("Main path is empty: " + QVariant(isDirEmpty).toString(), className);
|
log("Main path is empty: " + QVariant(isDirEmpty).toString(), className);
|
||||||
|
@ -805,12 +805,12 @@ void localLibraryWidget::checkIfMainPathEmpty() {
|
||||||
pagesNumber = 0;
|
pagesNumber = 0;
|
||||||
firstPageForBooks = 0;
|
firstPageForBooks = 0;
|
||||||
lastPageFolderCount = 0;
|
lastPageFolderCount = 0;
|
||||||
mainPathAndItsEmpty = true;
|
mainPathIsEmpty = true;
|
||||||
showToast("The library is empty");
|
showToast("Library is empty");
|
||||||
return void();
|
return void();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mainPathAndItsEmpty = false;
|
mainPathIsEmpty = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue