mirror of
https://github.com/YACReader/yacreader
synced 2025-07-23 07:24:58 -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:
@ -31,22 +31,33 @@ void Comic::setup()
|
||||
connect(this,SIGNAL(imageLoaded(int)),this,SLOT(updateBookmarkImage(int)));
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void Comic::load(const QString & path)
|
||||
bool Comic::load(const QString & path)
|
||||
{
|
||||
QFileInfo fi(path);
|
||||
bm->newComic(path);
|
||||
emit bookmarksLoaded(*bm);
|
||||
if(fi.isFile())
|
||||
{
|
||||
loadFromFile(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(fi.isDir())
|
||||
QFileInfo fi(path);
|
||||
if(fi.exists())
|
||||
{
|
||||
loadFromDir(path);
|
||||
bm->newComic(path);
|
||||
emit bookmarksLoaded(*bm);
|
||||
|
||||
if(fi.isFile())
|
||||
{
|
||||
loadFromFile(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(fi.isDir())
|
||||
{
|
||||
loadFromDir(path);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(NULL,tr("Not found"),tr("Comic not found"));
|
||||
emit errorOpening();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void Comic::loadFromFile(const QString & pathFile)
|
||||
|
Reference in New Issue
Block a user