mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Merge pull request #43 from mytskine/fix-gcc8-warnings-develop
Fix gcc8 warnings
This commit is contained in:
commit
14f1609ffa
@ -361,12 +361,12 @@ PageRender::PageRender()
|
||||
}
|
||||
PageRender::PageRender(Render * r,int np, const QByteArray & rd, QImage * p,unsigned int d, QVector<ImageFilter *> f)
|
||||
:QThread(),
|
||||
render(r),
|
||||
numPage(np),
|
||||
data(rd),
|
||||
page(p),
|
||||
degrees(d),
|
||||
filters(f)
|
||||
filters(f),
|
||||
render(r)
|
||||
{
|
||||
}
|
||||
|
||||
@ -398,7 +398,7 @@ void PageRender::run()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
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;
|
||||
currentPageBufferedIndex = numLeftPages;
|
||||
@ -734,21 +734,27 @@ void Render::load(const QString & path, const ComicDB & comicDB)
|
||||
for(int i = 0; i < filters.count(); i++)
|
||||
{
|
||||
if(typeid(*filters[i]) == typeid(BrightnessFilter))
|
||||
{
|
||||
if(comicDB.info.brightness == -1)
|
||||
filters[i]->setLevel(0);
|
||||
else
|
||||
filters[i]->setLevel(comicDB.info.brightness);
|
||||
}
|
||||
if(typeid(*filters[i]) == typeid(ContrastFilter))
|
||||
{
|
||||
if(comicDB.info.contrast == -1)
|
||||
filters[i]->setLevel(100);
|
||||
else
|
||||
filters[i]->setLevel(comicDB.info.contrast);
|
||||
}
|
||||
if(typeid(*filters[i]) == typeid(GammaFilter))
|
||||
{
|
||||
if(comicDB.info.gamma == -1)
|
||||
filters[i]->setLevel(100);
|
||||
else
|
||||
filters[i]->setLevel(comicDB.info.gamma);
|
||||
}
|
||||
}
|
||||
createComic(path);
|
||||
if (comic!=0)
|
||||
{
|
||||
@ -857,7 +863,7 @@ void Render::nextPage()
|
||||
update();
|
||||
emit pageChanged(currentIndex);
|
||||
}
|
||||
else if (hasLoadedComic() && (currentIndex == numPages()-1))
|
||||
else if (hasLoadedComic() && ((unsigned int)currentIndex == numPages()-1))
|
||||
{
|
||||
emit isLast();
|
||||
}
|
||||
|
@ -24,20 +24,20 @@
|
||||
|
||||
Viewer::Viewer(QWidget * parent)
|
||||
:QScrollArea(parent),
|
||||
currentPage(0),
|
||||
magnifyingGlassShowed(false),
|
||||
fullscreen(false),
|
||||
information(false),
|
||||
doublePage(false),
|
||||
doubleMangaPage(false),
|
||||
zoom(100),
|
||||
currentPage(0),
|
||||
wheelStop(false),
|
||||
direction(1),
|
||||
restoreMagnifyingGlass(false),
|
||||
drag(false),
|
||||
numScrollSteps(22),
|
||||
shouldOpenNext(false),
|
||||
shouldOpenPrevious(false),
|
||||
zoom(100)
|
||||
magnifyingGlassShowed(false),
|
||||
restoreMagnifyingGlass(false)
|
||||
{
|
||||
translator = new YACReaderTranslator(this);
|
||||
translator->hide();
|
||||
|
@ -69,7 +69,7 @@ bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic,
|
||||
int dataAvailable = 0;
|
||||
QByteArray packageSize;
|
||||
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()));
|
||||
localSocket->waitForReadyRead(100);
|
||||
|
@ -189,6 +189,7 @@ void ComicVineDialog::goBack()
|
||||
showSearchVolume();
|
||||
else
|
||||
showSearchSingleComic();
|
||||
break;
|
||||
default:
|
||||
if(mode == Volume)
|
||||
showSearchVolume();
|
||||
@ -702,7 +703,7 @@ void ComicVineDialog::searchVolume(const QString &v, int page)
|
||||
status = SearchingVolume;
|
||||
}
|
||||
|
||||
void ComicVineDialog::getVolumeComicsInfo(const QString &vID, int page)
|
||||
void ComicVineDialog::getVolumeComicsInfo(const QString &vID, int /* page */)
|
||||
{
|
||||
showLoading(tr("Retrieving volume info..."));
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <QDebug>
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -174,6 +174,8 @@ bool ComicModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int
|
||||
case ReadingList:
|
||||
DBHelper::reasignOrderToComicsInReadingList(sourceId,allComicIds,db);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
QSqlDatabase::removeDatabase(db.connectionName());
|
||||
|
@ -159,7 +159,7 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
|
||||
if (role == Qt::DecorationRole)
|
||||
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
if(item->data(FolderModel::Finished).toBool()){
|
||||
if(finishedFolderIcon.isNull()){
|
||||
@ -177,6 +177,7 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const
|
||||
else
|
||||
return QVariant(YACReader::noHighlightedIcon(":/images/sidebar/folder.png"));
|
||||
#endif
|
||||
}
|
||||
|
||||
if(role == FolderModel::CompletedRole)
|
||||
return item->data(FolderModel::Completed);
|
||||
@ -620,7 +621,7 @@ void FolderModel::updateFolderChildrenInfo(qulonglong folderId)
|
||||
//PROXY
|
||||
|
||||
FolderModelProxy::FolderModelProxy(QObject *parent)
|
||||
:QSortFilterProxyModel(parent),rootItem(0),filterEnabled(false),filter(""),includeComics(true)
|
||||
:QSortFilterProxyModel(parent),rootItem(0),includeComics(true),filter(""),filterEnabled(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -219,6 +219,7 @@ bool ReadingListModel::canDropMimeData(const QMimeData *data, Qt::DropAction act
|
||||
return true;
|
||||
|
||||
if(rowIsReadingList(row,parent))// TODO avoid droping in a different parent
|
||||
{
|
||||
if(!parent.isValid())
|
||||
return false;
|
||||
else
|
||||
@ -232,6 +233,7 @@ bool ReadingListModel::canDropMimeData(const QMimeData *data, Qt::DropAction act
|
||||
return data->formats().contains(YACReader::YACReaderLibrarSubReadingListMimeDataFormat);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -342,7 +344,9 @@ QMimeData *ReadingListModel::mimeData(const QModelIndexList &indexes) const
|
||||
}
|
||||
|
||||
if(indexes.length() > 1)
|
||||
{
|
||||
QLOG_DEBUG() << "mimeData requested for more than one index, this shouldn't be possible";
|
||||
}
|
||||
|
||||
QModelIndex modelIndex = indexes.at(0);
|
||||
|
||||
|
@ -1335,7 +1335,6 @@ QList<Label> DBHelper::getLabels(qulonglong libraryId)
|
||||
QSqlRecord record = selectQuery.record();
|
||||
|
||||
int name = record.indexOf("name");
|
||||
int color = record.indexOf("color");
|
||||
int id = record.indexOf("id");
|
||||
int ordering = record.indexOf("ordering");
|
||||
|
||||
|
@ -267,8 +267,6 @@ void ImportWidget::newCover(const QPixmap & image)
|
||||
{
|
||||
Q_UNUSED(image)
|
||||
}
|
||||
static int i = 1;
|
||||
static int previousWidth = 10;
|
||||
static int j = 0;
|
||||
void ImportWidget::addCoverTest()
|
||||
{
|
||||
|
@ -88,7 +88,7 @@
|
||||
#endif
|
||||
|
||||
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();
|
||||
|
||||
@ -2571,6 +2571,8 @@ void LibraryWindow::deleteComicsFromList()
|
||||
case ReadingListModel::ReadingList:
|
||||
comicsModel->deleteComicsFromReadingList(indexList,id);
|
||||
break;
|
||||
case ReadingListModel::Separator:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2627,7 +2629,7 @@ void LibraryWindow::importLibraryPackage()
|
||||
|
||||
void LibraryWindow::updateComicsView(quint64 libraryId, const ComicDB & comic)
|
||||
{
|
||||
if(libraryId == libraries.getId(selectedLibrary->currentText())) {
|
||||
if(libraryId == (quint64)libraries.getId(selectedLibrary->currentText())) {
|
||||
comicsModel->reload(comic);
|
||||
comicsViewsManager->updateCurrentComicView();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
LibrariesControllerV2::LibrariesControllerV2() {}
|
||||
|
||||
void LibrariesControllerV2::service(HttpRequest& request, HttpResponse& response)
|
||||
void LibrariesControllerV2::service(HttpRequest& /* request */, HttpResponse& response)
|
||||
{
|
||||
response.setHeader("Content-Type", "application/json");
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
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);
|
||||
QString baseName = fi.baseName();
|
||||
|
@ -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);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "yacreader_http_session.h"
|
||||
|
||||
YACReaderHttpSession::YACReaderHttpSession(QObject *parent)
|
||||
: QObject(parent), comic(nullptr), remoteComic(nullptr), comicId(0), remoteComicId(0)
|
||||
: QObject(parent), comicId(0), remoteComicId(0), comic(nullptr), remoteComic(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ void YACReaderClientConnectionWorker::run()
|
||||
int dataAvailable = 0;
|
||||
QByteArray packageSize;
|
||||
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()));
|
||||
clientConnection->waitForReadyRead(100);
|
||||
@ -188,7 +188,9 @@ void YACReaderClientConnectionWorker::run()
|
||||
tries++;
|
||||
}
|
||||
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());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case YACReader::SendComicInfo:
|
||||
|
@ -259,6 +259,8 @@ void YACReaderNavigationController::loadIndexFromHistory(const YACReaderLibraryS
|
||||
loadListInfo(sourceMI);
|
||||
break;
|
||||
}
|
||||
case YACReaderLibrarySourceContainer::None:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -181,6 +181,7 @@ ComicInfo::ComicInfo()
|
||||
}
|
||||
|
||||
ComicInfo::ComicInfo(const ComicInfo & comicInfo)
|
||||
:QObject()
|
||||
{
|
||||
operator=(comicInfo);
|
||||
}
|
||||
|
@ -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;
|
||||
@ -665,7 +665,6 @@ void YACReaderFlowGL::setCurrentIndex(int pos)
|
||||
}
|
||||
|
||||
viewRotateActive = 1;
|
||||
|
||||
}
|
||||
|
||||
void YACReaderFlowGL::updatePositions()
|
||||
|
@ -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,8 +1261,9 @@ 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;
|
||||
|
||||
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -57,7 +57,7 @@ void BusyIndicator::setColor(QColor color)
|
||||
fillColor = color;
|
||||
}
|
||||
|
||||
const BusyIndicator::IndicatorStyle BusyIndicator::indicatorStyle() const
|
||||
BusyIndicator::IndicatorStyle BusyIndicator::indicatorStyle() const
|
||||
{
|
||||
return m_style;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
|
||||
void setIndicatorStyle(IndicatorStyle);
|
||||
void setColor(QColor color);
|
||||
const IndicatorStyle indicatorStyle() const;
|
||||
IndicatorStyle indicatorStyle() const;
|
||||
|
||||
signals:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user