Merge pull request #43 from mytskine/fix-gcc8-warnings-develop

Fix gcc8 warnings
This commit is contained in:
Luis Ángel San Martín 2019-04-19 16:56:56 +02:00 committed by GitHub
commit 14f1609ffa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 123 additions and 101 deletions

View File

@ -361,12 +361,12 @@ PageRender::PageRender()
} }
PageRender::PageRender(Render * r,int np, const QByteArray & rd, QImage * p,unsigned int d, QVector<ImageFilter *> f) PageRender::PageRender(Render * r,int np, const QByteArray & rd, QImage * p,unsigned int d, QVector<ImageFilter *> f)
:QThread(), :QThread(),
render(r),
numPage(np), numPage(np),
data(rd), data(rd),
page(p), page(p),
degrees(d), degrees(d),
filters(f) filters(f),
render(r)
{ {
} }
@ -398,7 +398,7 @@ void PageRender::run()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
Render::Render() Render::Render()
:currentIndex(0),doublePage(false),doubleMangaPage(false),comic(0),loadedComic(false),imageRotation(0),numLeftPages(4),numRightPages(4) :comic(0),doublePage(false),doubleMangaPage(false),currentIndex(0),numLeftPages(4),numRightPages(4),loadedComic(false),imageRotation(0)
{ {
int size = numLeftPages+numRightPages+1; int size = numLeftPages+numRightPages+1;
currentPageBufferedIndex = numLeftPages; currentPageBufferedIndex = numLeftPages;
@ -734,20 +734,26 @@ void Render::load(const QString & path, const ComicDB & comicDB)
for(int i = 0; i < filters.count(); i++) for(int i = 0; i < filters.count(); i++)
{ {
if(typeid(*filters[i]) == typeid(BrightnessFilter)) if(typeid(*filters[i]) == typeid(BrightnessFilter))
{
if(comicDB.info.brightness == -1) if(comicDB.info.brightness == -1)
filters[i]->setLevel(0); filters[i]->setLevel(0);
else else
filters[i]->setLevel(comicDB.info.brightness); filters[i]->setLevel(comicDB.info.brightness);
}
if(typeid(*filters[i]) == typeid(ContrastFilter)) if(typeid(*filters[i]) == typeid(ContrastFilter))
{
if(comicDB.info.contrast == -1) if(comicDB.info.contrast == -1)
filters[i]->setLevel(100); filters[i]->setLevel(100);
else else
filters[i]->setLevel(comicDB.info.contrast); filters[i]->setLevel(comicDB.info.contrast);
}
if(typeid(*filters[i]) == typeid(GammaFilter)) if(typeid(*filters[i]) == typeid(GammaFilter))
{
if(comicDB.info.gamma == -1) if(comicDB.info.gamma == -1)
filters[i]->setLevel(100); filters[i]->setLevel(100);
else else
filters[i]->setLevel(comicDB.info.gamma); filters[i]->setLevel(comicDB.info.gamma);
}
} }
createComic(path); createComic(path);
if (comic!=0) if (comic!=0)
@ -857,7 +863,7 @@ void Render::nextPage()
update(); update();
emit pageChanged(currentIndex); emit pageChanged(currentIndex);
} }
else if (hasLoadedComic() && (currentIndex == numPages()-1)) else if (hasLoadedComic() && ((unsigned int)currentIndex == numPages()-1))
{ {
emit isLast(); emit isLast();
} }

View File

@ -24,20 +24,20 @@
Viewer::Viewer(QWidget * parent) Viewer::Viewer(QWidget * parent)
:QScrollArea(parent), :QScrollArea(parent),
currentPage(0),
magnifyingGlassShowed(false),
fullscreen(false), fullscreen(false),
information(false), information(false),
doublePage(false), doublePage(false),
doubleMangaPage(false), doubleMangaPage(false),
zoom(100),
currentPage(0),
wheelStop(false), wheelStop(false),
direction(1), direction(1),
restoreMagnifyingGlass(false),
drag(false), drag(false),
numScrollSteps(22), numScrollSteps(22),
shouldOpenNext(false), shouldOpenNext(false),
shouldOpenPrevious(false), shouldOpenPrevious(false),
zoom(100) magnifyingGlassShowed(false),
restoreMagnifyingGlass(false)
{ {
translator = new YACReaderTranslator(this); translator = new YACReaderTranslator(this);
translator->hide(); translator->hide();

View File

@ -69,7 +69,7 @@ bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic,
int dataAvailable = 0; int dataAvailable = 0;
QByteArray packageSize; QByteArray packageSize;
localSocket->waitForReadyRead(1000); localSocket->waitForReadyRead(1000);
while(packageSize.size() < sizeof(quint32) && tries < 20) while(packageSize.size() < (int)sizeof(quint32) && tries < 20)
{ {
packageSize.append(localSocket->read(sizeof(quint32) - packageSize.size())); packageSize.append(localSocket->read(sizeof(quint32) - packageSize.size()));
localSocket->waitForReadyRead(100); localSocket->waitForReadyRead(100);

View File

@ -189,6 +189,7 @@ void ComicVineDialog::goBack()
showSearchVolume(); showSearchVolume();
else else
showSearchSingleComic(); showSearchSingleComic();
break;
default: default:
if(mode == Volume) if(mode == Volume)
showSearchVolume(); showSearchVolume();
@ -702,7 +703,7 @@ void ComicVineDialog::searchVolume(const QString &v, int page)
status = SearchingVolume; status = SearchingVolume;
} }
void ComicVineDialog::getVolumeComicsInfo(const QString &vID, int page) void ComicVineDialog::getVolumeComicsInfo(const QString &vID, int /* page */)
{ {
showLoading(tr("Retrieving volume info...")); showLoading(tr("Retrieving volume info..."));

View File

@ -4,7 +4,7 @@
#include <QDebug> #include <QDebug>
ResponseParser::ResponseParser(QObject *parent) : ResponseParser::ResponseParser(QObject *parent) :
QObject(parent),error(false),numResults(-1),currentPage(-1),totalPages(-1),errorTxt("None") QObject(parent),error(false),errorTxt("None"),numResults(-1),currentPage(-1),totalPages(-1)
{ {
} }

View File

@ -174,6 +174,8 @@ bool ComicModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int
case ReadingList: case ReadingList:
DBHelper::reasignOrderToComicsInReadingList(sourceId,allComicIds,db); DBHelper::reasignOrderToComicsInReadingList(sourceId,allComicIds,db);
break; break;
default:
break;
} }
QSqlDatabase::removeDatabase(db.connectionName()); QSqlDatabase::removeDatabase(db.connectionName());

View File

@ -753,8 +753,8 @@ bool DataBaseManagement::updateToCurrentVersion(const QString & path)
if(compareVersions(DataBaseManagement::checkValidDB(fullPath),"9.5.0")<0) if(compareVersions(DataBaseManagement::checkValidDB(fullPath),"9.5.0")<0)
pre9_5 = true; pre9_5 = true;
QSqlDatabase db = loadDatabaseFromFile(fullPath); QSqlDatabase db = loadDatabaseFromFile(fullPath);
bool returnValue = false; bool returnValue = false;
if(db.isValid() && db.isOpen()) if(db.isValid() && db.isOpen())
{ {
QSqlQuery updateVersion(db); QSqlQuery updateVersion(db);

View File

@ -159,7 +159,7 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const
} }
if (role == Qt::DecorationRole) if (role == Qt::DecorationRole)
{
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
if(item->data(FolderModel::Finished).toBool()){ if(item->data(FolderModel::Finished).toBool()){
if(finishedFolderIcon.isNull()){ if(finishedFolderIcon.isNull()){
@ -177,6 +177,7 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const
else else
return QVariant(YACReader::noHighlightedIcon(":/images/sidebar/folder.png")); return QVariant(YACReader::noHighlightedIcon(":/images/sidebar/folder.png"));
#endif #endif
}
if(role == FolderModel::CompletedRole) if(role == FolderModel::CompletedRole)
return item->data(FolderModel::Completed); return item->data(FolderModel::Completed);
@ -187,10 +188,10 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const
if(role == FolderModel::IdRole) if(role == FolderModel::IdRole)
return item->id; return item->id;
if (role != Qt::DisplayRole) if (role != Qt::DisplayRole)
return QVariant(); return QVariant();
return item->data(index.column()); return item->data(index.column());
} }
//! [3] //! [3]
@ -620,7 +621,7 @@ void FolderModel::updateFolderChildrenInfo(qulonglong folderId)
//PROXY //PROXY
FolderModelProxy::FolderModelProxy(QObject *parent) FolderModelProxy::FolderModelProxy(QObject *parent)
:QSortFilterProxyModel(parent),rootItem(0),filterEnabled(false),filter(""),includeComics(true) :QSortFilterProxyModel(parent),rootItem(0),includeComics(true),filter(""),filterEnabled(false)
{ {
} }

View File

@ -219,6 +219,7 @@ bool ReadingListModel::canDropMimeData(const QMimeData *data, Qt::DropAction act
return true; return true;
if(rowIsReadingList(row,parent))// TODO avoid droping in a different parent if(rowIsReadingList(row,parent))// TODO avoid droping in a different parent
{
if(!parent.isValid()) if(!parent.isValid())
return false; return false;
else else
@ -232,6 +233,7 @@ bool ReadingListModel::canDropMimeData(const QMimeData *data, Qt::DropAction act
return data->formats().contains(YACReader::YACReaderLibrarSubReadingListMimeDataFormat); return data->formats().contains(YACReader::YACReaderLibrarSubReadingListMimeDataFormat);
} }
}
return false; return false;
} }
@ -342,7 +344,9 @@ QMimeData *ReadingListModel::mimeData(const QModelIndexList &indexes) const
} }
if(indexes.length() > 1) if(indexes.length() > 1)
{
QLOG_DEBUG() << "mimeData requested for more than one index, this shouldn't be possible"; QLOG_DEBUG() << "mimeData requested for more than one index, this shouldn't be possible";
}
QModelIndex modelIndex = indexes.at(0); QModelIndex modelIndex = indexes.at(0);

View File

@ -499,8 +499,8 @@ void DBHelper::update(qulonglong libraryId, ComicInfo & comicInfo)
void DBHelper::update(ComicInfo * comicInfo, QSqlDatabase & db) void DBHelper::update(ComicInfo * comicInfo, QSqlDatabase & db)
{ {
if(comicInfo == nullptr) if(comicInfo == nullptr)
return; return;
QSqlQuery updateComicInfo(db); QSqlQuery updateComicInfo(db);
updateComicInfo.prepare("UPDATE comic_info SET " updateComicInfo.prepare("UPDATE comic_info SET "
@ -1335,7 +1335,6 @@ QList<Label> DBHelper::getLabels(qulonglong libraryId)
QSqlRecord record = selectQuery.record(); QSqlRecord record = selectQuery.record();
int name = record.indexOf("name"); int name = record.indexOf("name");
int color = record.indexOf("color");
int id = record.indexOf("id"); int id = record.indexOf("id");
int ordering = record.indexOf("ordering"); int ordering = record.indexOf("ordering");

View File

@ -267,8 +267,6 @@ void ImportWidget::newCover(const QPixmap & image)
{ {
Q_UNUSED(image) Q_UNUSED(image)
} }
static int i = 1;
static int previousWidth = 10;
static int j = 0; static int j = 0;
void ImportWidget::addCoverTest() void ImportWidget::addCoverTest()
{ {

View File

@ -88,7 +88,7 @@
#endif #endif
LibraryWindow::LibraryWindow() LibraryWindow::LibraryWindow()
:QMainWindow(),fullscreen(false),fetching(false),previousFilter(""),removeError(false),status(LibraryWindow::Normal) :QMainWindow(),fullscreen(false),previousFilter(""),fetching(false),status(LibraryWindow::Normal),removeError(false)
{ {
setupUI(); setupUI();
@ -2571,6 +2571,8 @@ void LibraryWindow::deleteComicsFromList()
case ReadingListModel::ReadingList: case ReadingListModel::ReadingList:
comicsModel->deleteComicsFromReadingList(indexList,id); comicsModel->deleteComicsFromReadingList(indexList,id);
break; break;
case ReadingListModel::Separator:
break;
} }
} }
@ -2627,7 +2629,7 @@ void LibraryWindow::importLibraryPackage()
void LibraryWindow::updateComicsView(quint64 libraryId, const ComicDB & comic) void LibraryWindow::updateComicsView(quint64 libraryId, const ComicDB & comic)
{ {
if(libraryId == libraries.getId(selectedLibrary->currentText())) { if(libraryId == (quint64)libraries.getId(selectedLibrary->currentText())) {
comicsModel->reload(comic); comicsModel->reload(comic);
comicsViewsManager->updateCurrentComicView(); comicsViewsManager->updateCurrentComicView();
} }

View File

@ -422,37 +422,37 @@ void PropertiesDialog::setComics(QList<ComicDB> comics)
numPagesEdit->setText(QString::number(*comic.info.numPages));*/ numPagesEdit->setText(QString::number(*comic.info.numPages));*/
if(!comic.info.number.isNull()) if(!comic.info.number.isNull())
numberEdit->setText(comic.info.number.toString()); numberEdit->setText(comic.info.number.toString());
if(!comic.info.isBis.isNull()) if(!comic.info.isBis.isNull())
isBisCheck->setChecked(comic.info.isBis.toBool()); isBisCheck->setChecked(comic.info.isBis.toBool());
if(!comic.info.count.isNull()) if(!comic.info.count.isNull())
countEdit->setText(comic.info.count.toString()); countEdit->setText(comic.info.count.toString());
if(!comic.info.volume.isNull()) if(!comic.info.volume.isNull())
volumeEdit->setText(comic.info.volume.toString()); volumeEdit->setText(comic.info.volume.toString());
if(!comic.info.storyArc.isNull()) if(!comic.info.storyArc.isNull())
storyArcEdit->setText(comic.info.storyArc.toString()); storyArcEdit->setText(comic.info.storyArc.toString());
if(!comic.info.arcNumber.isNull()) if(!comic.info.arcNumber.isNull())
arcNumberEdit->setText(comic.info.arcNumber.toString()); arcNumberEdit->setText(comic.info.arcNumber.toString());
if(!comic.info.arcCount.isNull()) if(!comic.info.arcCount.isNull())
arcCountEdit->setText(comic.info.arcCount.toString()); arcCountEdit->setText(comic.info.arcCount.toString());
if(!comic.info.genere.isNull()) if(!comic.info.genere.isNull())
genereEdit->setText(comic.info.genere.toString()); genereEdit->setText(comic.info.genere.toString());
if(!comic.info.writer.isNull()) if(!comic.info.writer.isNull())
writer->setPlainText(comic.info.writer.toString()); writer->setPlainText(comic.info.writer.toString());
if(!comic.info.penciller.isNull()) if(!comic.info.penciller.isNull())
penciller->setPlainText(comic.info.penciller.toString()); penciller->setPlainText(comic.info.penciller.toString());
if(!comic.info.inker.isNull()) if(!comic.info.inker.isNull())
inker->setPlainText(comic.info.inker.toString()); inker->setPlainText(comic.info.inker.toString());
if(!comic.info.colorist.isNull()) if(!comic.info.colorist.isNull())
colorist->setPlainText(comic.info.colorist.toString()); colorist->setPlainText(comic.info.colorist.toString());
if(!comic.info.letterer.isNull()) if(!comic.info.letterer.isNull())
letterer->setPlainText(comic.info.letterer.toString()); letterer->setPlainText(comic.info.letterer.toString());
if(!comic.info.coverArtist.isNull()) if(!comic.info.coverArtist.isNull())
coverArtist->setPlainText(comic.info.coverArtist.toString()); coverArtist->setPlainText(comic.info.coverArtist.toString());
size->setText(QString::number(comic.info.hash.right(comic.info.hash.length()-40).toInt()/1024.0/1024.0,'f',2)+"Mb"); size->setText(QString::number(comic.info.hash.right(comic.info.hash.length()-40).toInt()/1024.0/1024.0,'f',2)+"Mb");

View File

@ -9,7 +9,7 @@
LibrariesControllerV2::LibrariesControllerV2() {} LibrariesControllerV2::LibrariesControllerV2() {}
void LibrariesControllerV2::service(HttpRequest& request, HttpResponse& response) void LibrariesControllerV2::service(HttpRequest& /* request */, HttpResponse& response)
{ {
response.setHeader("Content-Type", "application/json"); response.setHeader("Content-Type", "application/json");

View File

@ -273,7 +273,7 @@ QString StaticFileController::getDeviceAwareFileName(QString fileName, QString d
return getLocalizedFileName(fileName,locales,path); //no hay archivo específico para el dispositivo, pero puede haberlo para estas locales return getLocalizedFileName(fileName,locales,path); //no hay archivo específico para el dispositivo, pero puede haberlo para estas locales
} }
QString StaticFileController::getDeviceAwareFileName(QString fileName, QString device, QString display, QString locales, QString path) const QString StaticFileController::getDeviceAwareFileName(QString fileName, QString device, QString display, QString /* locales */, QString path) const
{ {
QFileInfo fi(fileName); QFileInfo fi(fileName);
QString baseName = fi.baseName(); QString baseName = fi.baseName();

View File

@ -121,7 +121,7 @@ void RequestMapper::loadSessionV1(HttpRequest & request, HttpResponse& response)
} }
} }
void RequestMapper::loadSessionV2(HttpRequest & request, HttpResponse& response) void RequestMapper::loadSessionV2(HttpRequest & request, HttpResponse& /* response */)
{ {
QMutexLocker locker(&mutex); QMutexLocker locker(&mutex);

View File

@ -70,16 +70,16 @@ void Startup::start() {
if(templateSettings->value("path").isNull()) if(templateSettings->value("path").isNull())
templateSettings->setValue("path",templatePath); templateSettings->setValue("path",templatePath);
Static::templateLoader=new TemplateCache(templateSettings,app); Static::templateLoader=new TemplateCache(templateSettings,app);
// Configure session store // Configure session store
QSettings* sessionSettings=new QSettings(configFileName,QSettings::IniFormat,app); QSettings* sessionSettings=new QSettings(configFileName,QSettings::IniFormat,app);
sessionSettings->beginGroup("sessions"); sessionSettings->beginGroup("sessions");
if(sessionSettings->value("expirationTime").isNull()) if(sessionSettings->value("expirationTime").isNull())
sessionSettings->setValue("expirationTime",864000000); sessionSettings->setValue("expirationTime",864000000);
Static::sessionStore=new HttpSessionStore(sessionSettings,app); Static::sessionStore=new HttpSessionStore(sessionSettings,app);
Static::yacreaderSessionStore = new YACReaderHttpSessionStore(Static::sessionStore, app); Static::yacreaderSessionStore = new YACReaderHttpSessionStore(Static::sessionStore, app);
@ -101,12 +101,12 @@ void Startup::start() {
if(fileSettings->value("path").isNull()) if(fileSettings->value("path").isNull())
fileSettings->setValue("path",docroot); fileSettings->setValue("path",docroot);
Static::staticFileController=new StaticFileController(fileSettings,app); Static::staticFileController=new StaticFileController(fileSettings,app);
// Configure and start the TCP listener // Configure and start the TCP listener
qDebug("ServiceHelper: Starting service"); qDebug("ServiceHelper: Starting service");
QSettings* listenerSettings=new QSettings(configFileName,QSettings::IniFormat,app); QSettings* listenerSettings=new QSettings(configFileName,QSettings::IniFormat,app);
listenerSettings->beginGroup("listener"); listenerSettings->beginGroup("listener");
if(listenerSettings->value("maxRequestSize").isNull()) if(listenerSettings->value("maxRequestSize").isNull())
listenerSettings->setValue("maxRequestSize","32000000"); listenerSettings->setValue("maxRequestSize","32000000");
@ -123,9 +123,9 @@ void Startup::start() {
if(listenerSettings->value("minThreads").isNull()) if(listenerSettings->value("minThreads").isNull())
listenerSettings->setValue("minThreads",50); listenerSettings->setValue("minThreads",50);
listener = new HttpListener(listenerSettings,new RequestMapper(app),app); listener = new HttpListener(listenerSettings,new RequestMapper(app),app);
qDebug("ServiceHelper: Service has started"); qDebug("ServiceHelper: Service has started");
} }

View File

@ -1,7 +1,7 @@
#include "yacreader_http_session.h" #include "yacreader_http_session.h"
YACReaderHttpSession::YACReaderHttpSession(QObject *parent) YACReaderHttpSession::YACReaderHttpSession(QObject *parent)
: QObject(parent), comic(nullptr), remoteComic(nullptr), comicId(0), remoteComicId(0) : QObject(parent), comicId(0), remoteComicId(0), comic(nullptr), remoteComic(nullptr)
{ {
} }

View File

@ -104,7 +104,7 @@ void YACReaderClientConnectionWorker::run()
int dataAvailable = 0; int dataAvailable = 0;
QByteArray packageSize; QByteArray packageSize;
clientConnection->waitForReadyRead(1000); clientConnection->waitForReadyRead(1000);
while(packageSize.size() < sizeof(quint32) && tries < 20) while(((long unsigned int)packageSize.size() < sizeof(quint32)) && (tries < 20))
{ {
packageSize.append(clientConnection->read(sizeof(quint32) - packageSize.size())); packageSize.append(clientConnection->read(sizeof(quint32) - packageSize.size()));
clientConnection->waitForReadyRead(100); clientConnection->waitForReadyRead(100);
@ -188,7 +188,9 @@ void YACReaderClientConnectionWorker::run()
tries++; tries++;
} }
if(tries == 200 && written != block.size()) if(tries == 200 && written != block.size())
{
QLOG_ERROR() << QString("Local connection (comic info requested): unable to send response (%1,%2)").arg(written).arg(block.size()); QLOG_ERROR() << QString("Local connection (comic info requested): unable to send response (%1,%2)").arg(written).arg(block.size());
}
break; break;
} }
case YACReader::SendComicInfo: case YACReader::SendComicInfo:

View File

@ -259,6 +259,8 @@ void YACReaderNavigationController::loadIndexFromHistory(const YACReaderLibraryS
loadListInfo(sourceMI); loadListInfo(sourceMI);
break; break;
} }
case YACReaderLibrarySourceContainer::None:
break;
} }
} }

View File

@ -44,13 +44,13 @@ const QStringList Comic::literalComicExtensions = LiteralComicArchiveExtensions;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
Comic::Comic() Comic::Comic()
:_pages(),_index(0),_path(),_loaded(false),bm(new Bookmarks()),_loadedPages(),_isPDF(false),_invalidated(false),_errorOpening(false) :_pages(),_loadedPages(),_index(0),_path(),_loaded(false),_isPDF(false),_invalidated(false),_errorOpening(false),bm(new Bookmarks())
{ {
setup(); setup();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
Comic::Comic(const QString & pathFile, int atPage ) Comic::Comic(const QString & pathFile, int atPage )
:_pages(),_index(0),_path(pathFile),_loaded(false),bm(new Bookmarks()),_loadedPages(),_isPDF(false),_firstPage(atPage),_errorOpening(false) :_pages(),_loadedPages(),_index(0),_path(pathFile),_loaded(false),_firstPage(atPage),_isPDF(false),_errorOpening(false),bm(new Bookmarks())
{ {
setup(); setup();
} }

View File

@ -29,7 +29,7 @@ QString ComicDB::toTXT()
txt.append(QString("comicid:%1\r\n").arg(id)); txt.append(QString("comicid:%1\r\n").arg(id));
txt.append(QString("hash:%1\r\n").arg(info.hash)); txt.append(QString("hash:%1\r\n").arg(info.hash));
txt.append(QString("path:%1\r\n").arg(path)); txt.append(QString("path:%1\r\n").arg(path));
txt.append(QString("numpages:%1\r\n").arg(info.numPages.toString())); txt.append(QString("numpages:%1\r\n").arg(info.numPages.toString()));
//new 7.0 //new 7.0
txt.append(QString("rating:%1\r\n").arg(info.rating)); txt.append(QString("rating:%1\r\n").arg(info.rating));
@ -37,23 +37,23 @@ QString ComicDB::toTXT()
txt.append(QString("contrast:%1\r\n").arg(info.contrast)); txt.append(QString("contrast:%1\r\n").arg(info.contrast));
//Informaci<63>n general //Informaci<63>n general
if(!info.coverPage.isNull()) if(!info.coverPage.isNull())
txt.append(QString("coverPage:%1\r\n").arg(info.coverPage.toString())); txt.append(QString("coverPage:%1\r\n").arg(info.coverPage.toString()));
if(!info.title.isNull()) if(!info.title.isNull())
txt.append(QString("title:%1\r\n").arg(info.title.toString())); txt.append(QString("title:%1\r\n").arg(info.title.toString()));
if(!info.number.isNull()) if(!info.number.isNull())
txt.append(QString("number:%1\r\n").arg(info.number.toString())); txt.append(QString("number:%1\r\n").arg(info.number.toString()));
if(!info.isBis.isNull()) if(!info.isBis.isNull())
txt.append(QString("isBis:%1\r\n").arg(info.isBis.toBool()?"1":"0")); txt.append(QString("isBis:%1\r\n").arg(info.isBis.toBool()?"1":"0"));
if(!info.count.isNull()) if(!info.count.isNull())
txt.append(QString("count:%1\r\n").arg(info.count.toString())); txt.append(QString("count:%1\r\n").arg(info.count.toString()));
if(!info.volume.isNull()) if(!info.volume.isNull())
txt.append(QString("volume:%1\r\n").arg(info.volume.toString())); txt.append(QString("volume:%1\r\n").arg(info.volume.toString()));
if(!info.storyArc.isNull()) if(!info.storyArc.isNull())
txt.append(QString("storyArc:%1\r\n").arg(info.storyArc.toString())); txt.append(QString("storyArc:%1\r\n").arg(info.storyArc.toString()));
@ -110,7 +110,7 @@ QString ComicDB::toTXT()
if(!info.notes.isNull()) if(!info.notes.isNull())
txt.append(QString("notes:%1\r\n").arg(info.notes.toString())); txt.append(QString("notes:%1\r\n").arg(info.notes.toString()));
return txt; return txt;
} }
ComicDB &ComicDB::operator=(const ComicDB &other) ComicDB &ComicDB::operator=(const ComicDB &other)
@ -181,6 +181,7 @@ ComicInfo::ComicInfo()
} }
ComicInfo::ComicInfo(const ComicInfo & comicInfo) ComicInfo::ComicInfo(const ComicInfo & comicInfo)
:QObject()
{ {
operator=(comicInfo); operator=(comicInfo);
} }

View File

@ -200,7 +200,7 @@ struct Preset pressetYACReaderFlowDownConfig = {
}; };
/*Constructor*/ /*Constructor*/
YACReaderFlowGL::YACReaderFlowGL(QWidget *parent,struct Preset p) YACReaderFlowGL::YACReaderFlowGL(QWidget *parent,struct Preset p)
:QOpenGLWidget(/*QOpenGLWidget migration QGLFormat(QGL::SampleBuffers),*/ parent),numObjects(0),lazyPopulateObjects(-1),bUseVSync(false),hasBeenInitialized(false),flowRightToLeft(false) :QOpenGLWidget(/*QOpenGLWidget migration QGLFormat(QGL::SampleBuffers),*/ parent),numObjects(0),lazyPopulateObjects(-1),hasBeenInitialized(false),bUseVSync(false),flowRightToLeft(false)
{ {
updateCount = 0; updateCount = 0;
config = p; config = p;
@ -650,22 +650,21 @@ void YACReaderFlowGL::setCurrentIndex(int pos)
if(pos >= images.length() && images.length() > 0) if(pos >= images.length() && images.length() > 0)
pos = images.length()-1; pos = images.length()-1;
startAnimationTimer(); startAnimationTimer();
currentSelected = pos; currentSelected = pos;
config.animationStep *= config.animationSpeedUp; config.animationStep *= config.animationSpeedUp;
if(config.animationStep > config.animationStepMax){ if(config.animationStep > config.animationStepMax){
config.animationStep = config.animationStepMax; config.animationStep = config.animationStepMax;
} }
if(viewRotateActive && viewRotate < 1){ if(viewRotateActive && viewRotate < 1){
viewRotate += config.viewRotateAdd; viewRotate += config.viewRotateAdd;
} }
viewRotateActive = 1;
viewRotateActive = 1;
} }
void YACReaderFlowGL::updatePositions() void YACReaderFlowGL::updatePositions()
@ -756,7 +755,7 @@ void YACReaderFlowGL::remove(int item)
if(texture != defaultTexture) if(texture != defaultTexture)
delete(texture); delete(texture);
numObjects--; numObjects--;
} }
/*Info*/ /*Info*/

View File

@ -283,7 +283,7 @@ private:
PictureFlowState::PictureFlowState(int a, float sr): PictureFlowState::PictureFlowState(int a, float sr):
backgroundColor(0), slideWidth(150), slideHeight(200), backgroundColor(0), slideWidth(150), slideHeight(200),
reflectionEffect(PictureFlow::BlurredReflection), centerIndex(0) , rawAngle(a), spacingRatio(sr), flowRightToLeft(false) reflectionEffect(PictureFlow::BlurredReflection), rawAngle(a), spacingRatio(sr), centerIndex(0), flowRightToLeft(false)
{ {
} }
@ -1017,6 +1017,8 @@ PictureFlow::PictureFlow(QWidget* parent,FlowType flowType): QWidget(parent)
case StripOverlapped: case StripOverlapped:
d->state = new PictureFlowState(0,0); d->state = new PictureFlowState(0,0);
break; break;
default:
break;
} }
framesSkip = 0; framesSkip = 0;
@ -1259,18 +1261,19 @@ void PictureFlow::showSlide(unsigned int index)
{ {
index = qMax<unsigned int>(index, 0); index = qMax<unsigned int>(index, 0);
index = qMin<unsigned int>(slideCount()-1, index); index = qMin<unsigned int>(slideCount()-1, index);
if(index == d->state->centerSlide.slideIndex) if((int)index == d->state->centerSlide.slideIndex) {
return; return;
}
int distance = centerIndex()-index; int distance = centerIndex()-index;
if(abs(distance)>10) if(abs(distance)>10)
{ {
if(distance<0) if(distance<0)
setCenterIndex(centerIndex()+(-distance)-10); setCenterIndex(centerIndex()+(-distance)-10);
else else
setCenterIndex(centerIndex()-distance+10); setCenterIndex(centerIndex()-distance+10);
} }
d->state->centerIndex = index; d->state->centerIndex = index;
d->animator->start(index); d->animator->start(index);
@ -1397,6 +1400,8 @@ void PictureFlow::setFlowType(FlowType flowType)
d->state->spacingRatio = 0; d->state->spacingRatio = 0;
d->state->reposition(); d->state->reposition();
break; break;
default:
break;
} }
d->state->reset(); d->state->reset();
d->renderer->init(); d->renderer->init();

View File

@ -23,7 +23,7 @@ ScrollManagement::Movement ScrollManagement::getMovement(QWheelEvent *event)
} }
// Accumulate the delta // Accumulate the delta
if(event->delta()<0 != wheelAccumulator<0 ) //different sign means change in direction if((event->delta()<0) != (wheelAccumulator<0) ) //different sign means change in direction
wheelAccumulator = 0; wheelAccumulator = 0;
wheelAccumulator += event->delta(); wheelAccumulator += event->delta();

View File

@ -57,7 +57,7 @@ void BusyIndicator::setColor(QColor color)
fillColor = color; fillColor = color;
} }
const BusyIndicator::IndicatorStyle BusyIndicator::indicatorStyle() const BusyIndicator::IndicatorStyle BusyIndicator::indicatorStyle() const
{ {
return m_style; return m_style;
} }

View File

@ -26,7 +26,7 @@ public:
void setIndicatorStyle(IndicatorStyle); void setIndicatorStyle(IndicatorStyle);
void setColor(QColor color); void setColor(QColor color);
const IndicatorStyle indicatorStyle() const; IndicatorStyle indicatorStyle() const;
signals: signals: