mirror of
https://github.com/YACReader/yacreader
synced 2026-04-04 03:42:43 -04:00
fixed lots of warnings
This commit is contained in:
@ -146,6 +146,7 @@ void BookmarksList::save()
|
||||
|
||||
void BookmarksList::deleteOldest(int num)
|
||||
{
|
||||
Q_UNUSED(num)
|
||||
QString comic;
|
||||
QDateTime date(QDate(10000,1,1));//TODO MAX_DATE??
|
||||
for(QMap<QString,Bookmark>::const_iterator itr=list.begin();itr!=list.end();itr++)
|
||||
|
||||
@ -91,6 +91,12 @@ QPixmap * Comic::operator[](unsigned int index)
|
||||
p->loadFromData(_pages[index]);
|
||||
return p;
|
||||
}*/
|
||||
bool Comic::load(const QString & path, const ComicDB & comic)
|
||||
{
|
||||
Q_UNUSED(path);
|
||||
Q_UNUSED(comic);
|
||||
return false;
|
||||
};
|
||||
//-----------------------------------------------------------------------------
|
||||
bool Comic::loaded()
|
||||
{
|
||||
@ -287,12 +293,13 @@ void FileComic::fileExtracted(int index, const QByteArray & rawData)
|
||||
|
||||
void FileComic::crcError(int index)
|
||||
{
|
||||
emit errorOpening(tr("CRC error: some of the pages will not be displayed correctly"));
|
||||
emit errorOpening(tr("CRC error on page (%1): some of the pages will not be displayed correctly").arg(index));
|
||||
}
|
||||
|
||||
//TODO: comprobar que si se produce uno de estos errores, la carga del c<>mic es irrecuperable
|
||||
void FileComic::unknownError(int index)
|
||||
{
|
||||
Q_UNUSED(index)
|
||||
//emit errorOpening(tr("Unknown error opening the file"));
|
||||
//emit errorOpening();
|
||||
}
|
||||
@ -312,7 +319,7 @@ QList<QVector<quint32> > FileComic::getSections(int & sectionIndex)
|
||||
int sectionCount = 0;
|
||||
QVector <quint32> section;
|
||||
int idx = 0;
|
||||
int realIdx;
|
||||
unsigned int realIdx;
|
||||
foreach(quint32 i, sortedIndexes)
|
||||
{
|
||||
|
||||
@ -427,8 +434,6 @@ void FileComic::process()
|
||||
|
||||
_cfi=0;
|
||||
qSort(_fileNames.begin(),_fileNames.end(), naturalSortLessThanCI);
|
||||
int index = 0;
|
||||
int sortedIndex = 0;
|
||||
|
||||
if(_firstPage == -1)
|
||||
_firstPage = bm->getLastPage();
|
||||
|
||||
@ -49,7 +49,7 @@ class ComicDB;
|
||||
void setup();
|
||||
//Load pages from file
|
||||
virtual bool load(const QString & path, int atPage = -1) = 0;
|
||||
virtual bool load(const QString & path, const ComicDB & comic){return false;};
|
||||
virtual bool load(const QString & path, const ComicDB & comic);
|
||||
|
||||
/*void loadFromFile(const QString & pathFile);
|
||||
void loadFromDir(const QString & pathDir);
|
||||
|
||||
@ -13,10 +13,10 @@ Configuration::Configuration()
|
||||
//load("/YACReader.conf");
|
||||
}
|
||||
|
||||
Configuration::Configuration(const Configuration & conf)
|
||||
/*Configuration::Configuration(const Configuration & conf)
|
||||
{
|
||||
//nothing
|
||||
}
|
||||
}*/
|
||||
|
||||
void Configuration::load(QSettings * settings)
|
||||
{
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
#define CONF_FILE_PATH "."
|
||||
#define SLIDE_ASPECT_RATIO 1.585
|
||||
|
||||
using namespace YACReader;
|
||||
|
||||
class Configuration : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -37,7 +39,7 @@
|
||||
QColor backgroundColor;
|
||||
|
||||
Configuration();
|
||||
Configuration(const Configuration & conf);
|
||||
//Configuration(const Configuration & conf);
|
||||
void load(const QString & path = CONF_FILE_PATH);
|
||||
|
||||
|
||||
|
||||
@ -228,8 +228,7 @@ void GoToFlow::updateSize() //TODO : fix. it doesn't work.
|
||||
|
||||
void GoToFlow::updateConfig(QSettings * settings)
|
||||
{
|
||||
|
||||
|
||||
Q_UNUSED(settings)
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
//SlideInitializer
|
||||
|
||||
@ -39,7 +39,7 @@ private:
|
||||
|
||||
QVector<bool> imagesLoaded;
|
||||
QVector<bool> imagesSetted;
|
||||
uint numImagesLoaded;
|
||||
int numImagesLoaded;
|
||||
QVector<bool> imagesReady;
|
||||
QVector<QByteArray> rawImages;
|
||||
QTimer* updateTimer;
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
GoToFlowGL::GoToFlowGL(QWidget* parent, FlowType flowType)
|
||||
:GoToFlowWidget(parent)
|
||||
{
|
||||
|
||||
Q_UNUSED(flowType)
|
||||
flow = new YACReaderPageFlowGL(this);
|
||||
flow->setShowMarks(false);
|
||||
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
#include <QSettings>
|
||||
#include "yacreader_global.h"
|
||||
|
||||
using namespace YACReader;
|
||||
|
||||
class QSettings;
|
||||
class GoToFlowDecorationBar;
|
||||
class GoToFlowToolBar;
|
||||
|
||||
@ -27,6 +27,7 @@ void MagnifyingGlass::setup(const QSize & size)
|
||||
void MagnifyingGlass::mouseMoveEvent(QMouseEvent * event)
|
||||
{
|
||||
updateImage();
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void MagnifyingGlass::updateImage(int x, int y)
|
||||
@ -191,20 +192,20 @@ void MagnifyingGlass::wheelEvent(QWheelEvent * event)
|
||||
}
|
||||
void MagnifyingGlass::zoomIn()
|
||||
{
|
||||
if(zoomLevel>0.2)
|
||||
zoomLevel -= 0.025;
|
||||
if(zoomLevel>0.2f)
|
||||
zoomLevel -= 0.025f;
|
||||
}
|
||||
|
||||
void MagnifyingGlass::zoomOut()
|
||||
{
|
||||
if(zoomLevel<0.9)
|
||||
zoomLevel += 0.025;
|
||||
if(zoomLevel<0.9f)
|
||||
zoomLevel += 0.025f;
|
||||
}
|
||||
|
||||
void MagnifyingGlass::sizeUp()
|
||||
{
|
||||
Viewer * p = (Viewer *)parent();
|
||||
if(width()<(p->width()*0.90))
|
||||
if(width()<(p->width()*0.90f))
|
||||
resize(width()+30,height()+15);
|
||||
}
|
||||
|
||||
@ -217,7 +218,7 @@ void MagnifyingGlass::sizeDown()
|
||||
void MagnifyingGlass::heightUp()
|
||||
{
|
||||
Viewer * p = (Viewer *)parent();
|
||||
if(height()<(p->height()*0.90))
|
||||
if(height()<(p->height()*0.90f))
|
||||
resize(width(),height()+15);
|
||||
}
|
||||
|
||||
@ -230,7 +231,7 @@ void MagnifyingGlass::heightDown()
|
||||
void MagnifyingGlass::widthUp()
|
||||
{
|
||||
Viewer * p = (Viewer *)parent();
|
||||
if(width()<(p->width()*0.90))
|
||||
if(width()<(p->width()*0.90f))
|
||||
resize(width()+30,height());
|
||||
}
|
||||
|
||||
|
||||
@ -881,6 +881,8 @@ void MainWindowViewer::newVersion()
|
||||
|
||||
void MainWindowViewer::closeEvent ( QCloseEvent * event )
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
|
||||
if(isClient)
|
||||
sendComic();
|
||||
|
||||
|
||||
@ -523,7 +523,7 @@ void Render::render()
|
||||
if(doublePage)
|
||||
{
|
||||
if(pagesReady[currentIndex] && pagesReady[qMin(currentIndex+1,(int)comic->numPages()-1)])
|
||||
if(currentIndex+1 > comic->numPages()-1)
|
||||
if(currentIndex+1 > (int)comic->numPages()-1)
|
||||
pageRenders[currentPageBufferedIndex] = new DoublePageRender(this,currentIndex,comic->getRawData()->at(currentIndex),QByteArray(),buffer[currentPageBufferedIndex],imageRotation,filters);
|
||||
else
|
||||
pageRenders[currentPageBufferedIndex] = new DoublePageRender(this,currentIndex,comic->getRawData()->at(currentIndex),comic->getRawData()->at(currentIndex+1),buffer[currentPageBufferedIndex],imageRotation,filters);
|
||||
@ -577,7 +577,7 @@ QPixmap * Render::getCurrentPage()
|
||||
|
||||
void Render::setRotation(int degrees)
|
||||
{
|
||||
|
||||
Q_UNUSED(degrees)
|
||||
}
|
||||
|
||||
void Render::setComic(Comic * c)
|
||||
@ -728,7 +728,7 @@ void Render::nextPage()
|
||||
if(doublePage)
|
||||
{
|
||||
nextPage = currentIndex;
|
||||
if(currentIndex+2<comic->numPages())
|
||||
if(currentIndex+2<(int)comic->numPages())
|
||||
{
|
||||
nextPage = currentIndex+2;
|
||||
if(currentIndex != nextPage)
|
||||
@ -941,7 +941,7 @@ void Render::fillBuffer()
|
||||
{
|
||||
for(int i = 1; i <= qMax(numLeftPages,numRightPages); i++)
|
||||
{
|
||||
if ((currentIndex+i < comic->numPages()) &&
|
||||
if ((currentIndex+i < (int)comic->numPages()) &&
|
||||
buffer[currentPageBufferedIndex+i]->isNull() &&
|
||||
i <= numRightPages &&
|
||||
pageRenders[currentPageBufferedIndex+i]==0 &&
|
||||
@ -969,13 +969,13 @@ void Render::fillBufferDoublePage()
|
||||
{
|
||||
for(int i = 1; i <= qMax(numLeftPages,numRightPages); i++)
|
||||
{
|
||||
if ((currentIndex+2*i < comic->numPages()) &&
|
||||
if ((currentIndex+2*i < (int)comic->numPages()) &&
|
||||
buffer[currentPageBufferedIndex+i]->isNull() &&
|
||||
i <= numRightPages &&
|
||||
pageRenders[currentPageBufferedIndex+i]==0 &&
|
||||
(pagesReady[currentIndex+2*i] && pagesReady[qMin(currentIndex+(2*i)+1,(int)comic->numPages()-1)])) //preload next pages
|
||||
{
|
||||
if(currentIndex+(2*i)+1 > comic->numPages()-1)
|
||||
if(currentIndex+(2*i)+1 > (int)comic->numPages()-1)
|
||||
pageRenders[currentPageBufferedIndex+i] = new DoublePageRender(this,currentIndex+2*i,comic->getRawData()->at(currentIndex+(2*i)),QByteArray(),buffer[currentPageBufferedIndex+i],imageRotation,filters);
|
||||
else
|
||||
pageRenders[currentPageBufferedIndex+i] = new DoublePageRender(this,currentIndex+2*i,comic->getRawData()->at(currentIndex+(2*i)),comic->getRawData()->at(currentIndex+(2*i)+1),buffer[currentPageBufferedIndex+i],imageRotation,filters);
|
||||
@ -1033,7 +1033,7 @@ void Render::doublePageSwitch()
|
||||
QString Render::getCurrentPagesInformation()
|
||||
{
|
||||
QString s = QString::number(currentIndex+1);
|
||||
if (doublePage && (currentIndex+1 < comic->numPages()))
|
||||
if (doublePage && (currentIndex+1 < (int)comic->numPages()))
|
||||
s += "-"+QString::number(currentIndex+2);
|
||||
s += "/"+QString::number(comic->numPages());
|
||||
return s;
|
||||
|
||||
@ -304,13 +304,14 @@ void YACReaderTranslator::mousePressEvent(QMouseEvent *event)
|
||||
void YACReaderTranslator::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
drag = false;
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void YACReaderTranslator::mouseMoveEvent(QMouseEvent * event)
|
||||
{
|
||||
if(drag)
|
||||
this->move(QPoint(mapToParent(event->pos())-click));
|
||||
|
||||
event->accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
@ -787,11 +787,13 @@ void Viewer::mousePressEvent ( QMouseEvent * event )
|
||||
yDragOrigin = event->y();
|
||||
xDragOrigin = event->x();
|
||||
setCursor(Qt::ClosedHandCursor);
|
||||
event->accept();
|
||||
}
|
||||
void Viewer::mouseReleaseEvent ( QMouseEvent * event )
|
||||
{
|
||||
drag = false;
|
||||
setCursor(Qt::OpenHandCursor);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void Viewer::updateFitToWidthRatio(float ratio)
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#include "configuration.h"
|
||||
|
||||
YACReaderSliderAction::YACReaderSliderAction (QWidget * parent)
|
||||
:QWidgetAction (0) {
|
||||
:QWidgetAction (parent) {
|
||||
|
||||
QWidget* pWidget = new QWidget (NULL);
|
||||
QHBoxLayout* pLayout = new QHBoxLayout();
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
|
||||
#include <QLocalSocket>
|
||||
|
||||
using namespace YACReader;
|
||||
|
||||
YACReaderLocalClient::YACReaderLocalClient(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
@ -30,7 +32,7 @@ bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic,
|
||||
QDataStream out(&block, QIODevice::WriteOnly);
|
||||
out.setVersion(QDataStream::Qt_4_8);
|
||||
out << (quint16)0;
|
||||
out << (quint8)YACReaderIPCMessages::RequestComicInfo;
|
||||
out << (quint8)YACReader::RequestComicInfo;
|
||||
out << libraryId;
|
||||
out << comic;
|
||||
out.device()->seek(0);
|
||||
@ -87,7 +89,7 @@ bool YACReaderLocalClient::sendComicInfo(quint64 libraryId, ComicDB & comic)
|
||||
QDataStream out(&block, QIODevice::WriteOnly);
|
||||
out.setVersion(QDataStream::Qt_4_8);
|
||||
out << (quint16)0;
|
||||
out << (quint8)YACReaderIPCMessages::SendComicInfo;
|
||||
out << (quint8)YACReader::SendComicInfo;
|
||||
out << libraryId;
|
||||
out << comic;
|
||||
out.device()->seek(0);
|
||||
|
||||
Reference in New Issue
Block a user