Merged luisangelsm/yacreader into default

This commit is contained in:
Felix Kauselmann 2015-02-26 10:09:37 +01:00
commit 5b16c97140
3 changed files with 56 additions and 47 deletions

View File

@ -741,6 +741,18 @@ void MainWindowViewer::open(QString path, qint64 comicId, qint64 libraryId)
}
void MainWindowViewer::openComicFromPath(QString pathFile)
{
openComic(pathFile);
isClient = false; //this method is used for direct openings
}
//isClient shouldn't be modified when a siblinig comic is opened
void MainWindowViewer::openSiblingComic(QString pathFile)
{
openComic(pathFile);
}
void MainWindowViewer::openComic(QString pathFile)
{
QFileInfo fi(pathFile);
currentDirectory = fi.dir().absolutePath();
@ -751,9 +763,6 @@ void MainWindowViewer::openComicFromPath(QString pathFile)
enableActions();
viewer->open(pathFile);
isClient = false;
}
void MainWindowViewer::openFolder()
@ -1275,11 +1284,7 @@ void MainWindowViewer::openPreviousComic()
}
if(!previousComicPath.isEmpty())
{
viewer->open(previousComicPath);
QFileInfo fi(previousComicPath);
getSiblingComics(fi.absolutePath(),fi.fileName());
setWindowTitle("YACReader - " + fi.fileName());
openSiblingComic(previousComicPath);
}
}
@ -1302,11 +1307,7 @@ void MainWindowViewer::openNextComic()
}
if(!nextComicPath.isEmpty())
{
viewer->open(nextComicPath);
QFileInfo fi(nextComicPath);
getSiblingComics(fi.absolutePath(),fi.fileName());
setWindowTitle("YACReader - " + fi.fileName());
openSiblingComic(nextComicPath);
}
}

View File

@ -49,6 +49,8 @@ class EditShortcutsDialog;
void openPreviousComic();
void openNextComic();
void openComicFromPath(QString pathFile);
void openSiblingComic(QString pathFile);
void openComic(QString pathFile);
void openFolderFromPath(QString pathDir);
void openFolderFromPath(QString pathFile, QString atFileName);
void alwaysOnTopSwitch();
@ -71,6 +73,7 @@ class EditShortcutsDialog;
void next();
void updatePage();*/
private:
//!State
bool fullscreen;
@ -168,6 +171,5 @@ signals:
public:
MainWindowViewer();
~MainWindowViewer();
};
#endif

View File

@ -937,11 +937,17 @@ void Render::setNumPages(unsigned int numPages)
void Render::pageRawDataReady(int page)
{
if (!hasLoadedComic())
return;
pagesEmited.push_back(page);
if(pageRenders.size()>0)
{
for(int i=0;i<pagesEmited.size();i++)
{
if(pagesEmited.at(i)>= pagesReady.size())
return; //Oooops, something went wrong
pagesReady[pagesEmited.at(i)] = true;
if(pagesEmited.at(i) == currentIndex)
update();