mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 13:04:28 -04:00
Corregido bug relativo a bookmarks y los c?mics en pdf o carpetas
Cambiado de uso de QPixmap por QImage en las partes que estan fuera de GUI Cambiadas las llamadas a enableAction para asegurar que se producen siempre antes que disableAction en caso de error al abrir. Corregida la gesti?n de errores de apertura al usar FactoryComic
This commit is contained in:
@ -410,10 +410,29 @@ void Render::load(const QString & path)
|
||||
//comic->moveToThread(QApplication::instance()->thread());
|
||||
comic = FactoryComic::newComic(path);
|
||||
|
||||
if(comic == NULL) //archivo no encontrado o no v<>lido
|
||||
|
||||
if(comic == NULL)//archivo no encontrado o no v<>lido
|
||||
{
|
||||
emit errorOpening();
|
||||
reset();
|
||||
return;
|
||||
}
|
||||
|
||||
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)));
|
||||
connect(comic,SIGNAL(numPages(unsigned int)),this,SIGNAL(numPages(unsigned int)));
|
||||
connect(comic,SIGNAL(numPages(unsigned int)),this,SLOT(setNumPages(unsigned int)));
|
||||
connect(comic,SIGNAL(imageLoaded(int,QByteArray)),this,SIGNAL(imageLoaded(int,QByteArray)));
|
||||
connect(comic,SIGNAL(isBookmark(bool)),this,SIGNAL(currentPageIsBookmark(bool)));
|
||||
connect(comic,SIGNAL(isBookmark(bool)),this,SLOT(pageIsBookmark(bool)));
|
||||
|
||||
connect(comic,SIGNAL(bookmarksUpdated()),this,SIGNAL(bookmarksUpdated()));
|
||||
|
||||
QThread * thread = NULL;
|
||||
if (typeid(*comic) != typeid(FileComic))
|
||||
{
|
||||
@ -426,20 +445,8 @@ void Render::load(const QString & path)
|
||||
|
||||
}
|
||||
|
||||
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)));
|
||||
connect(comic,SIGNAL(numPages(unsigned int)),this,SIGNAL(numPages(unsigned int)));
|
||||
connect(comic,SIGNAL(numPages(unsigned int)),this,SLOT(setNumPages(unsigned int)));
|
||||
connect(comic,SIGNAL(imageLoaded(int,QByteArray)),this,SIGNAL(imageLoaded(int,QByteArray)));
|
||||
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); //garantiza que se va a intentar abrir el c<>mic
|
||||
|
||||
if(thread != NULL)
|
||||
@ -785,3 +792,8 @@ void Render::save()
|
||||
{
|
||||
comic->saveBookmarks();
|
||||
}
|
||||
|
||||
Bookmarks * Render::getBookmarks()
|
||||
{
|
||||
return comic->bm;
|
||||
}
|
Reference in New Issue
Block a user