mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
empty folder loaded after deleting the last comic in a folder
This commit is contained in:
@ -295,8 +295,8 @@ void ComicModel::setupFolderModelData(unsigned long long int folderId,const QStr
|
||||
QSqlDatabase::removeDatabase(_databasePath);
|
||||
endResetModel();
|
||||
|
||||
if(_data.length()==0)
|
||||
emit isEmpty();
|
||||
/*if(_data.length()==0)
|
||||
emit isEmpty();*/
|
||||
}
|
||||
|
||||
void ComicModel::setupLabelModelData(unsigned long long parentLabel, const QString &databasePath)
|
||||
@ -321,8 +321,8 @@ void ComicModel::setupLabelModelData(unsigned long long parentLabel, const QStri
|
||||
QSqlDatabase::removeDatabase(_databasePath);
|
||||
endResetModel();
|
||||
|
||||
if(_data.length()==0)
|
||||
emit isEmpty();
|
||||
/*if(_data.length()==0)
|
||||
emit isEmpty();*/
|
||||
}
|
||||
|
||||
void ComicModel::setupFavoritesModelData(const QString &databasePath)
|
||||
@ -347,8 +347,8 @@ void ComicModel::setupFavoritesModelData(const QString &databasePath)
|
||||
QSqlDatabase::removeDatabase(_databasePath);
|
||||
endResetModel();
|
||||
|
||||
if(_data.length()==0)
|
||||
emit isEmpty();
|
||||
/*if(_data.length()==0)
|
||||
emit isEmpty();*/
|
||||
}
|
||||
|
||||
void ComicModel::setupReadingModelData(const QString &databasePath)
|
||||
@ -371,8 +371,8 @@ void ComicModel::setupReadingModelData(const QString &databasePath)
|
||||
QSqlDatabase::removeDatabase(_databasePath);
|
||||
endResetModel();
|
||||
|
||||
if(_data.length()==0)
|
||||
emit isEmpty();
|
||||
/*if(_data.length()==0)
|
||||
emit isEmpty();*/
|
||||
}
|
||||
|
||||
void ComicModel::setupModelData(const SearchModifiers modifier, const QString &filter, const QString &databasePath)
|
||||
@ -708,7 +708,7 @@ void ComicModel::removeInTransaction(int row)
|
||||
delete _data.at(row);
|
||||
_data.removeAt(row);
|
||||
|
||||
endRemoveRows();
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
void ComicModel::remove(ComicDB * comic, int row)
|
||||
|
@ -1672,15 +1672,11 @@ void LibraryWindow::selectSubfolder(const QModelIndex &mi, int child)
|
||||
navigationController->selectedFolder(dest);
|
||||
}
|
||||
|
||||
void LibraryWindow::checkEmptyFolder(QStringList * paths)
|
||||
//this methods is only using after deleting comics
|
||||
//TODO broken window :)
|
||||
void LibraryWindow::checkEmptyFolder()
|
||||
{
|
||||
if(paths == 0)
|
||||
{
|
||||
QStringList pathList = comicsModel->getPaths(currentPath());
|
||||
paths = &pathList;
|
||||
}
|
||||
|
||||
if(paths->size()>0 && !importedCovers)
|
||||
if(comicsModel->rowCount()>0 && !importedCovers)
|
||||
{
|
||||
disableComicsActions(false);
|
||||
}
|
||||
@ -1688,9 +1684,11 @@ void LibraryWindow::checkEmptyFolder(QStringList * paths)
|
||||
{
|
||||
disableComicsActions(true);
|
||||
#ifndef Q_OS_MAC
|
||||
if(paths->size()>0)
|
||||
if(comicsModel->rowCount()>0)
|
||||
toggleFullScreenAction->setEnabled(true);
|
||||
#endif
|
||||
if(comicsModel->rowCount() == 0)
|
||||
navigationController->reselectCurrentFolder();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -300,7 +300,7 @@ public:
|
||||
public slots:
|
||||
void loadLibrary(const QString & path);
|
||||
void selectSubfolder(const QModelIndex & mi, int child);
|
||||
void checkEmptyFolder(QStringList * paths = 0);
|
||||
void checkEmptyFolder();
|
||||
void openComic();
|
||||
void createLibrary();
|
||||
void create(QString source,QString dest, QString name);
|
||||
|
@ -259,6 +259,7 @@ void YACReaderNavigationController::setupConnections()
|
||||
connect(libraryWindow->listsView,SIGNAL(clicked(QModelIndex)),this,SLOT(selectedList(QModelIndex)));
|
||||
connect(libraryWindow->historyController,SIGNAL(modelIndexSelected(YACReaderLibrarySourceContainer)),this,SLOT(selectedIndexFromHistory(YACReaderLibrarySourceContainer)));
|
||||
connect(libraryWindow->emptyFolderWidget,SIGNAL(subfolderSelected(QModelIndex,int)),this,SLOT(selectSubfolder(QModelIndex,int)));
|
||||
connect(libraryWindow->comicsModel,SIGNAL(isEmpty()),this,SLOT(reselectCurrentFolder()));
|
||||
}
|
||||
|
||||
qulonglong YACReaderNavigationController::folderModelIndexToID(const QModelIndex &mi)
|
||||
|
Reference in New Issue
Block a user