mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 00:58:32 -04:00
Use nullptr instead of 0
This commit is contained in:
parent
2fe3fcf041
commit
923ad40057
@ -31,7 +31,7 @@ protected:
|
|||||||
//QPropertyAnimation * animation;
|
//QPropertyAnimation * animation;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BookmarksDialog(QWidget *parent = 0);
|
BookmarksDialog(QWidget *parent = nullptr);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setBookmarks(const Bookmarks &bookmarks);
|
void setBookmarks(const Bookmarks &bookmarks);
|
||||||
|
@ -11,7 +11,7 @@ class GoToDialog : public QDialog
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
GoToDialog(QWidget *parent = 0);
|
GoToDialog(QWidget *parent = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QLabel *numPagesLabel;
|
QLabel *numPagesLabel;
|
||||||
|
@ -29,7 +29,7 @@ class GoToFlow : public GoToFlowWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
GoToFlow(QWidget *parent = 0, FlowType flowType = CoverFlowLike);
|
GoToFlow(QWidget *parent = nullptr, FlowType flowType = CoverFlowLike);
|
||||||
~GoToFlow();
|
~GoToFlow();
|
||||||
bool ready; //comic is ready for read.
|
bool ready; //comic is ready for read.
|
||||||
private:
|
private:
|
||||||
|
@ -16,7 +16,7 @@ class GoToFlowGL : public GoToFlowWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
GoToFlowGL(QWidget *parent = 0, FlowType flowType = CoverFlowLike);
|
GoToFlowGL(QWidget *parent = nullptr, FlowType flowType = CoverFlowLike);
|
||||||
~GoToFlowGL();
|
~GoToFlowGL();
|
||||||
void reset();
|
void reset();
|
||||||
void centerSlide(int slide);
|
void centerSlide(int slide);
|
||||||
|
@ -24,7 +24,7 @@ private:
|
|||||||
void paintEvent(QPaintEvent *);
|
void paintEvent(QPaintEvent *);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GoToFlowToolBar(QWidget *parent = 0);
|
GoToFlowToolBar(QWidget *parent = nullptr);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setPage(int pageNumber);
|
void setPage(int pageNumber);
|
||||||
|
@ -19,7 +19,7 @@ protected:
|
|||||||
GoToFlowToolBar *toolBar;
|
GoToFlowToolBar *toolBar;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GoToFlowWidget(QWidget *paret = 0);
|
GoToFlowWidget(QWidget *paret = nullptr);
|
||||||
virtual ~GoToFlowWidget() = 0;
|
virtual ~GoToFlowWidget() = 0;
|
||||||
public slots:
|
public slots:
|
||||||
virtual void reset() = 0;
|
virtual void reset() = 0;
|
||||||
|
@ -952,7 +952,7 @@ void MainWindowViewer::saveImage()
|
|||||||
QFileInfo fi(pathFile);
|
QFileInfo fi(pathFile);
|
||||||
currentDirectoryImgDest = fi.absolutePath();
|
currentDirectoryImgDest = fi.absolutePath();
|
||||||
const QPixmap *p = viewer->pixmap();
|
const QPixmap *p = viewer->pixmap();
|
||||||
if (p != NULL)
|
if (p != nullptr)
|
||||||
p->save(pathFile);
|
p->save(pathFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ void NotificationsLabelWidget::setText(const QString &text)
|
|||||||
void NotificationsLabelWidget::updatePosition()
|
void NotificationsLabelWidget::updatePosition()
|
||||||
{
|
{
|
||||||
QWidget *parent = dynamic_cast<QWidget *>(this->parent());
|
QWidget *parent = dynamic_cast<QWidget *>(this->parent());
|
||||||
if (parent == 0) {
|
if (parent == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
move(QPoint((parent->geometry().size().width() - this->width()) / 2, (parent->geometry().size().height() - this->height()) / 2));
|
move(QPoint((parent->geometry().size().width() - this->width()) / 2, (parent->geometry().size().height() - this->height()) / 2));
|
||||||
|
@ -174,7 +174,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
|||||||
|
|
||||||
void OptionsDialog::findFolder()
|
void OptionsDialog::findFolder()
|
||||||
{
|
{
|
||||||
QString s = QFileDialog::getExistingDirectory(0, tr("Comics directory"), ".");
|
QString s = QFileDialog::getExistingDirectory(nullptr, tr("Comics directory"), ".");
|
||||||
if (!s.isEmpty()) {
|
if (!s.isEmpty()) {
|
||||||
pathEdit->setText(s);
|
pathEdit->setText(s);
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ class OptionsDialog : public YACReaderOptionsDialog
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
OptionsDialog(QWidget *parent = 0);
|
OptionsDialog(QWidget *parent = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//QLabel * pathLabel;
|
//QLabel * pathLabel;
|
||||||
|
@ -34,7 +34,7 @@ PageLabelWidget::PageLabelWidget(QWidget *parent)
|
|||||||
|
|
||||||
setFixedSize(labelSize);
|
setFixedSize(labelSize);
|
||||||
|
|
||||||
if (parent != 0)
|
if (parent != nullptr)
|
||||||
move(QPoint((parent->geometry().size().width() - this->width()), -this->height()));
|
move(QPoint((parent->geometry().size().width() - this->width()), -this->height()));
|
||||||
|
|
||||||
layout->addWidget(textLabel, 0, Qt::AlignCenter);
|
layout->addWidget(textLabel, 0, Qt::AlignCenter);
|
||||||
@ -45,7 +45,7 @@ void PageLabelWidget::show()
|
|||||||
{
|
{
|
||||||
if (this->pos().y() <= 0 && animation->state() != QPropertyAnimation::Running) {
|
if (this->pos().y() <= 0 && animation->state() != QPropertyAnimation::Running) {
|
||||||
QWidget *parent = dynamic_cast<QWidget *>(this->parent());
|
QWidget *parent = dynamic_cast<QWidget *>(this->parent());
|
||||||
if (parent == 0) {
|
if (parent == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ void PageLabelWidget::hide()
|
|||||||
{
|
{
|
||||||
if (this->pos().y() >= 0 && animation->state() != QPropertyAnimation::Running) {
|
if (this->pos().y() >= 0 && animation->state() != QPropertyAnimation::Running) {
|
||||||
QWidget *parent = dynamic_cast<QWidget *>(this->parent());
|
QWidget *parent = dynamic_cast<QWidget *>(this->parent());
|
||||||
if (parent == 0) {
|
if (parent == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//connect(animation,SIGNAL(finished()),this,SLOT(setHidden()));
|
//connect(animation,SIGNAL(finished()),this,SLOT(setHidden()));
|
||||||
@ -88,7 +88,7 @@ void PageLabelWidget::paintEvent(QPaintEvent *)
|
|||||||
void PageLabelWidget::updatePosition()
|
void PageLabelWidget::updatePosition()
|
||||||
{
|
{
|
||||||
QWidget *parent = dynamic_cast<QWidget *>(this->parent());
|
QWidget *parent = dynamic_cast<QWidget *>(this->parent());
|
||||||
if (parent == 0) {
|
if (parent == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ void PageRender::run()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
Render::Render()
|
Render::Render()
|
||||||
: comic(0), doublePage(false), doubleMangaPage(false), currentIndex(0), numLeftPages(4), numRightPages(4), loadedComic(false), imageRotation(0)
|
: comic(nullptr), 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;
|
||||||
@ -381,13 +381,13 @@ Render::Render()
|
|||||||
|
|
||||||
Render::~Render()
|
Render::~Render()
|
||||||
{
|
{
|
||||||
if (comic != 0) {
|
if (comic != nullptr) {
|
||||||
comic->moveToThread(QApplication::instance()->thread());
|
comic->moveToThread(QApplication::instance()->thread());
|
||||||
comic->deleteLater();
|
comic->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (PageRender *pr, pageRenders)
|
foreach (PageRender *pr, pageRenders)
|
||||||
if (pr != 0) {
|
if (pr != nullptr) {
|
||||||
if (pr->wait())
|
if (pr->wait())
|
||||||
delete pr;
|
delete pr;
|
||||||
}
|
}
|
||||||
@ -480,7 +480,7 @@ QPixmap *Render::getCurrentDoublePage()
|
|||||||
leftpage.setY(rightsize.rheight());
|
leftpage.setY(rightsize.rheight());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
QPixmap *page = new QPixmap(totalWidth, totalHeight);
|
QPixmap *page = new QPixmap(totalWidth, totalHeight);
|
||||||
QPainter painter(page);
|
QPainter painter(page);
|
||||||
@ -488,7 +488,7 @@ QPixmap *Render::getCurrentDoublePage()
|
|||||||
painter.drawImage(QRect(rightpage, rightsize), *buffer[currentPageBufferedIndex + 1]);
|
painter.drawImage(QRect(rightpage, rightsize), *buffer[currentPageBufferedIndex + 1]);
|
||||||
return page;
|
return page;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,7 +530,7 @@ QPixmap *Render::getCurrentDoubleMangaPage()
|
|||||||
leftpage.setY(rightsize.rheight());
|
leftpage.setY(rightsize.rheight());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
QPixmap *page = new QPixmap(totalWidth, totalHeight);
|
QPixmap *page = new QPixmap(totalWidth, totalHeight);
|
||||||
QPainter painter(page);
|
QPainter painter(page);
|
||||||
@ -538,7 +538,7 @@ QPixmap *Render::getCurrentDoubleMangaPage()
|
|||||||
painter.drawImage(QRect(leftpage, leftsize), *buffer[currentPageBufferedIndex + 1]);
|
painter.drawImage(QRect(leftpage, leftsize), *buffer[currentPageBufferedIndex + 1]);
|
||||||
return page;
|
return page;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -607,7 +607,7 @@ void Render::setRotation(int degrees)
|
|||||||
|
|
||||||
void Render::setComic(Comic *c)
|
void Render::setComic(Comic *c)
|
||||||
{
|
{
|
||||||
if (comic != 0) {
|
if (comic != nullptr) {
|
||||||
comic->moveToThread(QApplication::instance()->thread());
|
comic->moveToThread(QApplication::instance()->thread());
|
||||||
comic->disconnect();
|
comic->disconnect();
|
||||||
comic->deleteLater();
|
comic->deleteLater();
|
||||||
@ -642,7 +642,7 @@ void Render::update()
|
|||||||
void Render::load(const QString &path, int atPage)
|
void Render::load(const QString &path, int atPage)
|
||||||
{
|
{
|
||||||
createComic(path);
|
createComic(path);
|
||||||
if (comic != 0) {
|
if (comic != nullptr) {
|
||||||
loadComic(path, atPage);
|
loadComic(path, atPage);
|
||||||
startLoad();
|
startLoad();
|
||||||
}
|
}
|
||||||
@ -673,7 +673,7 @@ void Render::load(const QString &path, const ComicDB &comicDB)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
createComic(path);
|
createComic(path);
|
||||||
if (comic != 0) {
|
if (comic != nullptr) {
|
||||||
loadComic(path, comicDB);
|
loadComic(path, comicDB);
|
||||||
startLoad();
|
startLoad();
|
||||||
}
|
}
|
||||||
@ -684,7 +684,7 @@ void Render::createComic(const QString &path)
|
|||||||
previousIndex = currentIndex = 0;
|
previousIndex = currentIndex = 0;
|
||||||
pagesEmited.clear();
|
pagesEmited.clear();
|
||||||
|
|
||||||
if (comic != 0) {
|
if (comic != nullptr) {
|
||||||
//comic->moveToThread(QApplication::instance()->thread());
|
//comic->moveToThread(QApplication::instance()->thread());
|
||||||
comic->invalidate();
|
comic->invalidate();
|
||||||
|
|
||||||
@ -694,7 +694,7 @@ void Render::createComic(const QString &path)
|
|||||||
//comic->moveToThread(QApplication::instance()->thread());
|
//comic->moveToThread(QApplication::instance()->thread());
|
||||||
comic = FactoryComic::newComic(path);
|
comic = FactoryComic::newComic(path);
|
||||||
|
|
||||||
if (comic == NULL) //archivo no encontrado o no válido
|
if (comic == nullptr) //archivo no encontrado o no válido
|
||||||
{
|
{
|
||||||
emit errorOpening();
|
emit errorOpening();
|
||||||
reset();
|
reset();
|
||||||
@ -841,7 +841,7 @@ unsigned int Render::numPages()
|
|||||||
|
|
||||||
bool Render::hasLoadedComic()
|
bool Render::hasLoadedComic()
|
||||||
{
|
{
|
||||||
if (comic != 0)
|
if (comic != nullptr)
|
||||||
return comic->loaded();
|
return comic->loaded();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -920,7 +920,7 @@ void Render::updateBuffer()
|
|||||||
//renders
|
//renders
|
||||||
PageRender *pr = pageRenders.front();
|
PageRender *pr = pageRenders.front();
|
||||||
pageRenders.pop_front();
|
pageRenders.pop_front();
|
||||||
if (pr != 0) {
|
if (pr != nullptr) {
|
||||||
if (pr->wait())
|
if (pr->wait())
|
||||||
delete pr;
|
delete pr;
|
||||||
}
|
}
|
||||||
@ -942,7 +942,7 @@ void Render::updateBuffer()
|
|||||||
//renders
|
//renders
|
||||||
PageRender *pr = pageRenders.back();
|
PageRender *pr = pageRenders.back();
|
||||||
pageRenders.pop_back();
|
pageRenders.pop_back();
|
||||||
if (pr != 0) {
|
if (pr != nullptr) {
|
||||||
if (pr->wait())
|
if (pr->wait())
|
||||||
delete pr;
|
delete pr;
|
||||||
}
|
}
|
||||||
@ -951,7 +951,7 @@ void Render::updateBuffer()
|
|||||||
//images
|
//images
|
||||||
buffer.push_front(new QImage());
|
buffer.push_front(new QImage());
|
||||||
QImage *p = buffer.back();
|
QImage *p = buffer.back();
|
||||||
if (p != 0)
|
if (p != nullptr)
|
||||||
delete p;
|
delete p;
|
||||||
buffer.pop_back();
|
buffer.pop_back();
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ class ShortcutsDialog : public QDialog
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ShortcutsDialog(QWidget *parent = 0);
|
ShortcutsDialog(QWidget *parent = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTextEdit *shortcuts;
|
QTextEdit *shortcuts;
|
||||||
|
@ -29,7 +29,7 @@ Viewer::Viewer(QWidget *parent)
|
|||||||
doublePage(false),
|
doublePage(false),
|
||||||
doubleMangaPage(false),
|
doubleMangaPage(false),
|
||||||
zoom(100),
|
zoom(100),
|
||||||
currentPage(0),
|
currentPage(nullptr),
|
||||||
wheelStop(false),
|
wheelStop(false),
|
||||||
direction(1),
|
direction(1),
|
||||||
drag(false),
|
drag(false),
|
||||||
@ -145,7 +145,7 @@ Viewer::~Viewer()
|
|||||||
delete bd;
|
delete bd;
|
||||||
delete notificationsLabel;
|
delete notificationsLabel;
|
||||||
delete mglass;
|
delete mglass;
|
||||||
if (currentPage != 0)
|
if (currentPage != nullptr)
|
||||||
delete currentPage;
|
delete currentPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ void Viewer::updatePage()
|
|||||||
else {
|
else {
|
||||||
currentPage = render->getCurrentDoubleMangaPage();
|
currentPage = render->getCurrentDoubleMangaPage();
|
||||||
}
|
}
|
||||||
if (currentPage == NULL) {
|
if (currentPage == nullptr) {
|
||||||
currentPage = render->getCurrentPage();
|
currentPage = render->getCurrentPage();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -318,7 +318,7 @@ void Viewer::updatePage()
|
|||||||
void Viewer::updateContentSize()
|
void Viewer::updateContentSize()
|
||||||
{
|
{
|
||||||
//there is an image to resize
|
//there is an image to resize
|
||||||
if (currentPage != 0 && !currentPage->isNull()) {
|
if (currentPage != nullptr && !currentPage->isNull()) {
|
||||||
QSize pagefit;
|
QSize pagefit;
|
||||||
YACReader::FitMode fitmode = Configuration::getConfiguration().getFitMode();
|
YACReader::FitMode fitmode = Configuration::getConfiguration().getFitMode();
|
||||||
switch (fitmode) {
|
switch (fitmode) {
|
||||||
|
@ -170,7 +170,7 @@ private:
|
|||||||
void scrollTo(int x, int y);
|
void scrollTo(int x, int y);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Viewer(QWidget *parent = 0);
|
Viewer(QWidget *parent = nullptr);
|
||||||
~Viewer();
|
~Viewer();
|
||||||
void toggleFullScreen();
|
void toggleFullScreen();
|
||||||
const QPixmap *pixmap();
|
const QPixmap *pixmap();
|
||||||
|
@ -14,7 +14,7 @@ private:
|
|||||||
QSlider *slider;
|
QSlider *slider;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
YACReaderSlider(QWidget *parent = 0);
|
YACReaderSlider(QWidget *parent = nullptr);
|
||||||
void show();
|
void show();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -37,7 +37,7 @@ private:
|
|||||||
YACReaderSlider *widget;
|
YACReaderSlider *widget;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
YACReaderSliderAction(QWidget *parent = 0);
|
YACReaderSliderAction(QWidget *parent = nullptr);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateText(int value);
|
void updateText(int value);
|
||||||
|
@ -10,7 +10,7 @@ class YACReaderLocalClient : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit YACReaderLocalClient(QObject *parent = 0);
|
explicit YACReaderLocalClient(QObject *parent = nullptr);
|
||||||
~YACReaderLocalClient();
|
~YACReaderLocalClient();
|
||||||
signals:
|
signals:
|
||||||
void finished();
|
void finished();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user