removed completely the lag from information label

comics are now opened by the last read page
This commit is contained in:
Luis Ángel San Martín 2013-07-15 11:35:20 +02:00
parent a3837c0982
commit 0398b8ca57
7 changed files with 24 additions and 4 deletions

View File

@ -393,8 +393,9 @@ void FileComic::process()
out << "tiempo en ordenar : " << myTimer.elapsed() << endl;
_firstPage = 0;
_index = 0;
_firstPage = bm->getLastPage();
_index = bm->getLastPage();
emit(openAt(_index));
int sectionIndex;
QList<QVector <quint32> > sections = getSections(sectionIndex);

View File

@ -72,6 +72,7 @@
void imageLoaded(int index);
void imageLoaded(int index,const QByteArray & image);
void pageChanged(int index);
void openAt(int index);
void numPages(unsigned int numPages);
void errorOpening();
void isBookmark(bool);

View File

@ -589,7 +589,7 @@ void Render::load(const QString & path)
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(openAt(int)),this,SLOT(renderAt(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)));
@ -624,6 +624,12 @@ void Render::load(const QString & path)
}
void Render::renderAt(int page)
{
previousIndex = currentIndex = page;
emit pageChanged(page);
}
void Render::reset()
{
loadedComic = false;
@ -655,6 +661,7 @@ void Render::nextPage()
previousIndex = currentIndex;
currentIndex = nextPage;
update();
emit pageChanged(currentIndex);
}
else
emit isLast();
@ -685,6 +692,7 @@ void Render::previousPage()
previousIndex = currentIndex;
currentIndex = previousPage;
update();
emit pageChanged(currentIndex);
}
else
emit isCover();
@ -761,6 +769,7 @@ void Render::goTo(int index)
invalidate();
update();
emit pageChanged(currentIndex);
}
}

View File

@ -149,6 +149,8 @@ public slots:
void reset();
void reload();
Bookmarks * getBookmarks();
//sets the firt page to render
void renderAt(int page);
signals:
void currentPageReady();

View File

@ -140,11 +140,12 @@ void Viewer::createConnections()
connect(render,SIGNAL(errorOpening()),this,SLOT(showMessageErrorOpening()));
connect(render,SIGNAL(numPages(unsigned int)),goToFlow,SLOT(setNumSlides(unsigned int)));
connect(render,SIGNAL(numPages(unsigned int)),goToDialog,SLOT(setNumPages(unsigned int)));
connect(render,SIGNAL(numPages(unsigned int)),this,SLOT(updateInformation()));
//connect(render,SIGNAL(numPages(unsigned int)),this,SLOT(updateInformation()));
connect(render,SIGNAL(imageLoaded(int,QByteArray)),goToFlow,SLOT(setImageReady(int,QByteArray)));
connect(render,SIGNAL(currentPageReady()),this,SLOT(updatePage()));
connect(render,SIGNAL(processingPage()),this,SLOT(setLoadingMessage()));
connect(render,SIGNAL(currentPageIsBookmark(bool)),this,SIGNAL(pageIsBookmark(bool)));
connect(render,SIGNAL(pageChanged(int)),this,SLOT(updateInformation()));
//connect(render,SIGNAL(bookmarksLoaded(Bookmarks)),this,SLOT(setBookmarks(Bookmarks)));
connect(render,SIGNAL(isLast()),this,SLOT(showIsLastMessage()));

View File

@ -101,6 +101,11 @@ CompressedArchive::CompressedArchive(const QString & filePath, QObject *parent)
}
}
CompressedArchive::~CompressedArchive()
{
//TODO
}
void CompressedArchive::loadFunctions()
{
//LOAD library

View File

@ -31,6 +31,7 @@ class CompressedArchive : public QObject
Q_OBJECT
public:
explicit CompressedArchive(const QString & filePath, QObject *parent = 0);
~CompressedArchive();
signals: