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
27 changed files with 123 additions and 101 deletions

View File

@ -44,13 +44,13 @@ const QStringList Comic::literalComicExtensions = LiteralComicArchiveExtensions;
//-----------------------------------------------------------------------------
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();
}
//-----------------------------------------------------------------------------
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();
}

View File

@ -29,7 +29,7 @@ QString ComicDB::toTXT()
txt.append(QString("comicid:%1\r\n").arg(id));
txt.append(QString("hash:%1\r\n").arg(info.hash));
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
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));
//Informaci<63>n general
if(!info.coverPage.isNull())
txt.append(QString("coverPage:%1\r\n").arg(info.coverPage.toString()));
if(!info.coverPage.isNull())
txt.append(QString("coverPage:%1\r\n").arg(info.coverPage.toString()));
if(!info.title.isNull())
txt.append(QString("title:%1\r\n").arg(info.title.toString()));
if(!info.title.isNull())
txt.append(QString("title:%1\r\n").arg(info.title.toString()));
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())
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())
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())
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())
txt.append(QString("storyArc:%1\r\n").arg(info.storyArc.toString()));
@ -88,7 +88,7 @@ QString ComicDB::toTXT()
//Publicaci<63>n
if(!info.date.isNull())
txt.append(QString("date:%1\r\n").arg(info.date.toString()));
if(!info.publisher.isNull())
txt.append(QString("publisher:%1\r\n").arg(info.publisher.toString()));
@ -110,7 +110,7 @@ QString ComicDB::toTXT()
if(!info.notes.isNull())
txt.append(QString("notes:%1\r\n").arg(info.notes.toString()));
return txt;
return txt;
}
ComicDB &ComicDB::operator=(const ComicDB &other)
@ -181,6 +181,7 @@ ComicInfo::ComicInfo()
}
ComicInfo::ComicInfo(const ComicInfo & comicInfo)
:QObject()
{
operator=(comicInfo);
}

View File

@ -200,7 +200,7 @@ struct Preset pressetYACReaderFlowDownConfig = {
};
/*Constructor*/
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;
config = p;
@ -650,22 +650,21 @@ void YACReaderFlowGL::setCurrentIndex(int pos)
if(pos >= images.length() && images.length() > 0)
pos = images.length()-1;
startAnimationTimer();
startAnimationTimer();
currentSelected = pos;
currentSelected = pos;
config.animationStep *= config.animationSpeedUp;
config.animationStep *= config.animationSpeedUp;
if(config.animationStep > config.animationStepMax){
config.animationStep = config.animationStepMax;
}
if(config.animationStep > config.animationStepMax){
config.animationStep = config.animationStepMax;
}
if(viewRotateActive && viewRotate < 1){
viewRotate += config.viewRotateAdd;
}
viewRotateActive = 1;
if(viewRotateActive && viewRotate < 1){
viewRotate += config.viewRotateAdd;
}
viewRotateActive = 1;
}
void YACReaderFlowGL::updatePositions()
@ -756,7 +755,7 @@ void YACReaderFlowGL::remove(int item)
if(texture != defaultTexture)
delete(texture);
numObjects--;
numObjects--;
}
/*Info*/

View File

@ -283,7 +283,7 @@ private:
PictureFlowState::PictureFlowState(int a, float sr):
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:
d->state = new PictureFlowState(0,0);
break;
default:
break;
}
framesSkip = 0;
@ -1259,18 +1261,19 @@ void PictureFlow::showSlide(unsigned int index)
{
index = qMax<unsigned int>(index, 0);
index = qMin<unsigned int>(slideCount()-1, index);
if(index == d->state->centerSlide.slideIndex)
if((int)index == d->state->centerSlide.slideIndex) {
return;
}
int distance = centerIndex()-index;
int distance = centerIndex()-index;
if(abs(distance)>10)
{
if(distance<0)
setCenterIndex(centerIndex()+(-distance)-10);
else
setCenterIndex(centerIndex()-distance+10);
}
if(abs(distance)>10)
{
if(distance<0)
setCenterIndex(centerIndex()+(-distance)-10);
else
setCenterIndex(centerIndex()-distance+10);
}
d->state->centerIndex = index;
d->animator->start(index);
@ -1397,6 +1400,8 @@ void PictureFlow::setFlowType(FlowType flowType)
d->state->spacingRatio = 0;
d->state->reposition();
break;
default:
break;
}
d->state->reset();
d->renderer->init();

View File

@ -23,7 +23,7 @@ ScrollManagement::Movement ScrollManagement::getMovement(QWheelEvent *event)
}
// 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 += event->delta();