mirror of
https://github.com/YACReader/yacreader
synced 2025-07-22 15:04:40 -04:00
corregido bug al intentar abrir un c?mic en un path no existente
- ahora se muestra un error al usuario. - y se restaura el estado inicial.
This commit is contained in:
@ -403,6 +403,7 @@ void Render::load(const QString & path)
|
||||
previousIndex = currentIndex = 0;
|
||||
|
||||
connect(comic,SIGNAL(errorOpening()),this,SIGNAL(errorOpening()));
|
||||
connect(comic,SIGNAL(errorOpening()),this,SLOT(reset()));
|
||||
connect(comic,SIGNAL(imageLoaded(int)),this,SIGNAL(imageLoaded(int)));
|
||||
connect(comic,SIGNAL(imageLoaded(int)),this,SLOT(pageRawDataReady(int)));
|
||||
//connect(comic,SIGNAL(pageChanged(int)),this,SIGNAL(pageChanged(int)));
|
||||
@ -412,9 +413,19 @@ void Render::load(const QString & path)
|
||||
connect(comic,SIGNAL(isBookmark(bool)),this,SIGNAL(currentPageIsBookmark(bool)));
|
||||
connect(comic,SIGNAL(bookmarksLoaded(const Bookmarks &)),this,SIGNAL(bookmarksLoaded(const Bookmarks &)));
|
||||
pagesReady.clear();
|
||||
comic->load(path);
|
||||
if(comic->load(path)) //garantiza que se va a intentar abrir el c<>mic
|
||||
{
|
||||
invalidate();
|
||||
loadedComic = true;
|
||||
update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Render::reset()
|
||||
{
|
||||
loadedComic = false;
|
||||
invalidate();
|
||||
loadedComic = true; //TODO reset if an error occurs while opening
|
||||
}
|
||||
//si se solicita la siguiente p<>gina, se calcula cu<63>l debe ser en funci<63>n de si se lee en modo a doble p<>gina o no.
|
||||
//la p<>gina s<>lo se renderiza, si realmente ha cambiado.
|
||||
|
Reference in New Issue
Block a user