mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 17:18:23 -04:00
cambiado el archivo de imagen notCover.png
corregido bug: no se mostraba noLibraries tras borrar la ?ltima biblioteca corregido bug: no se deshabilitaban las acciones en noLibraries y importing (falta deshabilitar el filtro) ThumbnailCreator comprueba ahora que el archivo de origen exista DETECTADO bug en la carga del modelo 'tree', se evita el crash pero parece haber un error de concepto en el algoritmo de carga
This commit is contained in:
parent
3ac85ccb7b
commit
07db7ff6ef
@ -255,7 +255,9 @@ void TreeModel::setupModelData(QSqlQuery &sqlquery, TreeItem *parent)
|
||||
|
||||
item->id = record.value("id").toULongLong();
|
||||
//la inserción de hijos se hace de forma ordenada
|
||||
items.value(record.value("parentId").toULongLong())->appendChild(item);
|
||||
TreeItem * parent = items.value(record.value("parentId").toULongLong());
|
||||
if(parent !=0)
|
||||
parent->appendChild(item);
|
||||
//se añade el item al map, de forma que se pueda encontrar como padre en siguientes iteraciones
|
||||
items.insert(item->id,item);
|
||||
}
|
||||
|
@ -427,6 +427,12 @@ ThumbnailCreator::ThumbnailCreator(QString fileSource, QString target="", int co
|
||||
void ThumbnailCreator::create()
|
||||
{
|
||||
QFileInfo fi(_fileSource);
|
||||
if(!fi.exists()) //TODO: error file not found.
|
||||
{
|
||||
_cover.load(":/images/notCover.png");
|
||||
return;
|
||||
}
|
||||
|
||||
if(fi.suffix().compare("pdf",Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
Poppler::Document * pdfComic = Poppler::Document::load(_fileSource);
|
||||
|
@ -1229,6 +1229,12 @@ void LibraryWindow::removeLibrary()
|
||||
{
|
||||
deleteCurrentLibrary();
|
||||
}
|
||||
|
||||
if(libraries.size()==0)
|
||||
{
|
||||
disableAllActions();
|
||||
showNoLibrariesWidget();
|
||||
}
|
||||
}
|
||||
|
||||
void LibraryWindow::renameLibrary()
|
||||
@ -1478,17 +1484,20 @@ void LibraryWindow::closeEvent ( QCloseEvent * event )
|
||||
|
||||
void LibraryWindow::showNoLibrariesWidget()
|
||||
{
|
||||
disableAllActions();
|
||||
mainWidget->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void LibraryWindow::showRootWidget()
|
||||
{
|
||||
enableActions();
|
||||
libraryToolBar->setDisabled(false);
|
||||
mainWidget->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
void LibraryWindow::showImportingWidget()
|
||||
{
|
||||
disableAllActions();
|
||||
importWidget->clear();
|
||||
libraryToolBar->setDisabled(true);
|
||||
mainWidget->setCurrentIndex(2);
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 14 KiB |
Loading…
x
Reference in New Issue
Block a user