bug fixed onpening next/previous folder

This commit is contained in:
Luis Ángel San Martín 2013-07-20 08:53:15 +02:00
parent bf8c0109eb
commit 0d83e0a117
4 changed files with 18 additions and 8 deletions

View File

@ -424,6 +424,7 @@ void FileComic::process()
out << "--tiempo en copiar datos : " << myTimer.elapsed() << endl;
f.close();
emit imagesLoaded();
moveToThread(QApplication::instance()->thread());
}
//-----------------------------------------------------------------------------
void FileComic::loadSizes()
@ -544,6 +545,7 @@ void FolderComic::process()
}
}
emit imagesLoaded();
moveToThread(QApplication::instance()->thread());
}
////////////////////////////////////////////////////////////////////////////////
@ -618,6 +620,7 @@ void PDFComic::process()
delete pdfComic;
emit imagesLoaded();
moveToThread(QApplication::instance()->thread());
}
void PDFComic::renderPage(int page)

View File

@ -863,8 +863,13 @@ void MainWindowViewer::openPreviousComic()
if(!siblingComics.isEmpty())
{
int currentIndex = siblingComics.indexOf(currentComicDB);
currentComicDB = siblingComics.at(currentIndex-1);
open(currentDirectory+currentComicDB.path,currentComicDB,siblingComics);
if (currentIndex == -1)
return;
if(currentIndex-1 >= 0 && currentIndex-1 < siblingComics.count())
{
currentComicDB = siblingComics.at(currentIndex-1);
open(currentDirectory+currentComicDB.path,currentComicDB,siblingComics);
}
return;
}
if(!previousComicPath.isEmpty())
@ -882,9 +887,13 @@ void MainWindowViewer::openNextComic()
if(!siblingComics.isEmpty())
{
int currentIndex = siblingComics.indexOf(currentComicDB);
if (currentIndex == -1)
return;
if(currentIndex+1 > 0 && currentIndex+1 < siblingComics.count())
currentComicDB = siblingComics.at(currentIndex+1);
open(currentDirectory+currentComicDB.path,currentComicDB,siblingComics);
{
currentComicDB = siblingComics.at(currentIndex+1);
open(currentDirectory+currentComicDB.path,currentComicDB,siblingComics);
}
return;
}
if(!nextComicPath.isEmpty())

View File

@ -54,12 +54,10 @@ struct SevenZipInterface {
};
//SevenZipInterface * szInterface;
QLibrary * sevenzLib = 0;
CompressedArchive::CompressedArchive(const QString & filePath, QObject *parent) :
QObject(parent)
QObject(parent),sevenzLib(0)
{
szInterface = new SevenZipInterface;
//load functions
loadFunctions();

View File

@ -42,7 +42,7 @@ public slots:
QList<QString> getFileNames();
private:
SevenZipInterface * szInterface;
QLibrary * sevenzLib;
void loadFunctions();
};