Use nullptr instead of 0

This commit is contained in:
Luis Ángel San Martín 2019-05-31 21:00:19 +02:00
parent bb334cfd50
commit 268bebbddd
81 changed files with 113 additions and 113 deletions

View File

@ -9,7 +9,7 @@ class AddLabelDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit AddLabelDialog(QWidget *parent = 0); explicit AddLabelDialog(QWidget *parent = nullptr);
YACReader::LabelColors selectedColor(); YACReader::LabelColors selectedColor();
QString name(); QString name();
signals: signals:

View File

@ -11,7 +11,7 @@ class AddLibraryDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
AddLibraryDialog(QWidget *parent = 0); AddLibraryDialog(QWidget *parent = nullptr);
private: private:
QLabel *nameLabel; QLabel *nameLabel;

View File

@ -11,7 +11,7 @@ class ComicFilesManager : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ComicFilesManager(QObject *parent = 0); explicit ComicFilesManager(QObject *parent = nullptr);
void copyComicsTo(const QList<QPair<QString, QString>> &sourceComics, const QString &folderDest, const QModelIndex &dest); void copyComicsTo(const QList<QPair<QString, QString>> &sourceComics, const QString &folderDest, const QModelIndex &dest);
void moveComicsTo(const QList<QPair<QString, QString>> &comics, const QString &folderDest, const QModelIndex &dest); void moveComicsTo(const QList<QPair<QString, QString>> &comics, const QString &folderDest, const QModelIndex &dest);
static QList<QPair<QString, QString>> getDroppedFiles(const QList<QUrl> &urls); static QList<QPair<QString, QString>> getDroppedFiles(const QList<QUrl> &urls);

View File

@ -17,7 +17,7 @@ class ComicFlow : public YACReaderFlow
{ {
Q_OBJECT Q_OBJECT
public: public:
ComicFlow(QWidget *parent = 0, FlowType flowType = CoverFlowLike); ComicFlow(QWidget *parent = nullptr, FlowType flowType = CoverFlowLike);
virtual ~ComicFlow(); virtual ~ComicFlow();
void setImagePaths(const QStringList &paths); void setImagePaths(const QStringList &paths);

View File

@ -12,7 +12,7 @@ class ComicFlowWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
ComicFlowWidget(QWidget *paret = 0); ComicFlowWidget(QWidget *paret = nullptr);
public slots: public slots:
virtual void setShowMarks(bool value) = 0; virtual void setShowMarks(bool value) = 0;
@ -44,7 +44,7 @@ private:
ComicFlow *flow; ComicFlow *flow;
public: public:
ComicFlowWidgetSW(QWidget *parent = 0); ComicFlowWidgetSW(QWidget *parent = nullptr);
void setShowMarks(bool value); void setShowMarks(bool value);
void setMarks(QVector<YACReaderComicReadStatus> marks); void setMarks(QVector<YACReaderComicReadStatus> marks);
@ -84,7 +84,7 @@ private:
YACReaderComicFlowGL *flow; YACReaderComicFlowGL *flow;
public: public:
ComicFlowWidgetGL(QWidget *parent = 0); ComicFlowWidgetGL(QWidget *parent = nullptr);
void setShowMarks(bool value); void setShowMarks(bool value);
void setMarks(QVector<YACReaderComicReadStatus> marks); void setMarks(QVector<YACReaderComicReadStatus> marks);

View File

@ -11,7 +11,7 @@ class ApiKeyDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ApiKeyDialog(QWidget *parent = 0); explicit ApiKeyDialog(QWidget *parent = nullptr);
~ApiKeyDialog(); ~ApiKeyDialog();
signals: signals:

View File

@ -7,7 +7,7 @@ class ComicVineAllVolumeComicsRetriever : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ComicVineAllVolumeComicsRetriever(const QString &volumeURLString, QObject *parent = 0); explicit ComicVineAllVolumeComicsRetriever(const QString &volumeURLString, QObject *parent = nullptr);
void getAllVolumeComics(); void getAllVolumeComics();
protected: protected:

View File

@ -10,7 +10,7 @@ class ComicVineClient : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ComicVineClient(QObject *parent = 0); explicit ComicVineClient(QObject *parent = nullptr);
~ComicVineClient(); ~ComicVineClient();
signals: signals:

View File

@ -26,7 +26,7 @@ class ComicVineDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ComicVineDialog(QWidget *parent = 0); explicit ComicVineDialog(QWidget *parent = nullptr);
QString databasePath; QString databasePath;
QString basePath; QString basePath;
void setComics(const QList<ComicDB> &comics); void setComics(const QList<ComicDB> &comics);

View File

@ -7,7 +7,7 @@ class ComicsModel : public JSONModel
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ComicsModel(QObject *parent = 0); explicit ComicsModel(QObject *parent = nullptr);
signals: signals:

View File

@ -7,7 +7,7 @@ class JSONModel : public QAbstractItemModel
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit JSONModel(QObject *parent = 0); explicit JSONModel(QObject *parent = nullptr);
virtual void load(const QString &json) = 0; virtual void load(const QString &json) = 0;
signals: signals:

View File

@ -57,7 +57,7 @@ QVariant LocalComicListModel::data(const QModelIndex &index, int role) const
Qt::ItemFlags LocalComicListModel::flags(const QModelIndex &index) const Qt::ItemFlags LocalComicListModel::flags(const QModelIndex &index) const
{ {
if (!index.isValid()) if (!index.isValid())
return 0; return nullptr;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable; return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
} }

View File

@ -9,7 +9,7 @@ class LocalComicListModel : public QAbstractItemModel
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit LocalComicListModel(QObject *parent = 0); explicit LocalComicListModel(QObject *parent = nullptr);
void load(QList<ComicDB> &comics); void load(QList<ComicDB> &comics);

View File

@ -7,7 +7,7 @@ class ResponseParser : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ResponseParser(QObject *parent = 0); explicit ResponseParser(QObject *parent = nullptr);
bool responseError(); bool responseError();
QString errorDescription(); QString errorDescription();
qint32 getNumResults(); qint32 getNumResults();

View File

@ -108,7 +108,7 @@ QVariant VolumeComicsModel::data(const QModelIndex &index, int role) const
Qt::ItemFlags VolumeComicsModel::flags(const QModelIndex &index) const Qt::ItemFlags VolumeComicsModel::flags(const QModelIndex &index) const
{ {
if (!index.isValid()) if (!index.isValid())
return 0; return nullptr;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable; return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
} }

View File

@ -7,7 +7,7 @@ class VolumeComicsModel : public JSONModel
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit VolumeComicsModel(QObject *parent = 0); explicit VolumeComicsModel(QObject *parent = nullptr);
void load(const QString &json); void load(const QString &json);
//void load(const QStringList & jsonList); //void load(const QStringList & jsonList);

View File

@ -102,7 +102,7 @@ QVariant VolumesModel::data(const QModelIndex &index, int role) const
Qt::ItemFlags VolumesModel::flags(const QModelIndex &index) const Qt::ItemFlags VolumesModel::flags(const QModelIndex &index) const
{ {
if (!index.isValid()) if (!index.isValid())
return 0; return nullptr;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable; return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
} }

View File

@ -7,7 +7,7 @@ class VolumesModel : public JSONModel
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit VolumesModel(QObject *parent = 0); explicit VolumesModel(QObject *parent = nullptr);
virtual ~VolumesModel(); virtual ~VolumesModel();
//receive a valid json with a list of volumes //receive a valid json with a list of volumes
void load(const QString &json); void load(const QString &json);

View File

@ -9,7 +9,7 @@ class ScraperLineEdit : public QLineEdit
{ {
Q_OBJECT Q_OBJECT
public: public:
ScraperLineEdit(const QString &title, QWidget *widget = 0); ScraperLineEdit(const QString &title, QWidget *widget = nullptr);
protected: protected:
void resizeEvent(QResizeEvent *); void resizeEvent(QResizeEvent *);

View File

@ -10,7 +10,7 @@ class ScraperResultsPaginator : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ScraperResultsPaginator(QWidget *parent = 0); explicit ScraperResultsPaginator(QWidget *parent = nullptr);
void update(const QString &json); void update(const QString &json);
int getCurrentPage(); int getCurrentPage();
void setCustomLabel(const QString &label); void setCustomLabel(const QString &label);

View File

@ -9,7 +9,7 @@ class ScraperScrollLabel : public QScrollArea
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ScraperScrollLabel(QWidget *parent = 0); explicit ScraperScrollLabel(QWidget *parent = nullptr);
signals: signals:

View File

@ -9,7 +9,7 @@ class ScraperSelector : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ScraperSelector(QWidget *parent = 0); explicit ScraperSelector(QWidget *parent = nullptr);
virtual void load(const QString &json, const QString &searchString); virtual void load(const QString &json, const QString &searchString);
public slots: public slots:

View File

@ -7,7 +7,7 @@ class ScraperTableView : public QTableView
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ScraperTableView(QWidget *parent = 0); explicit ScraperTableView(QWidget *parent = nullptr);
signals: signals:

View File

@ -9,7 +9,7 @@ class SearchSingleComic : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
SearchSingleComic(QWidget *parent = 0); SearchSingleComic(QWidget *parent = nullptr);
QString getVolumeInfo(); QString getVolumeInfo();
QString getComicInfo(); QString getComicInfo();
int getComicNumber(); int getComicNumber();

View File

@ -9,7 +9,7 @@ class SearchVolume : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
SearchVolume(QWidget *parent = 0); SearchVolume(QWidget *parent = nullptr);
void clean(); void clean();
public slots: public slots:
QString getVolumeInfo(); QString getVolumeInfo();

View File

@ -14,7 +14,7 @@ class SelectComic : public ScraperSelector
{ {
Q_OBJECT Q_OBJECT
public: public:
SelectComic(QWidget *parent = 0); SelectComic(QWidget *parent = nullptr);
void load(const QString &json, const QString &searchString); void load(const QString &json, const QString &searchString);
virtual ~SelectComic(); virtual ~SelectComic();

View File

@ -16,7 +16,7 @@ class SelectVolume : public ScraperSelector
{ {
Q_OBJECT Q_OBJECT
public: public:
SelectVolume(QWidget *parent = 0); SelectVolume(QWidget *parent = nullptr);
void load(const QString &json, const QString &searchString); void load(const QString &json, const QString &searchString);
virtual ~SelectVolume(); virtual ~SelectVolume();

View File

@ -10,7 +10,7 @@ class SeriesQuestion : public QWidget
Q_OBJECT Q_OBJECT
public: public:
SeriesQuestion(QWidget *parent = 0); SeriesQuestion(QWidget *parent = nullptr);
bool getYes(); bool getYes();
void setYes(bool yes = true); void setYes(bool yes = true);

View File

@ -23,7 +23,7 @@ public:
RIGHT RIGHT
}; };
ScrapperToolButton(ScrapperToolButton::Appearance appearance = DEFAULT, QWidget *parent = 0) ScrapperToolButton(ScrapperToolButton::Appearance appearance = DEFAULT, QWidget *parent = nullptr)
: QPushButton(parent), appearance(appearance) : QPushButton(parent), appearance(appearance)
{ {
setStyleSheet("QPushButton {border: none; background: #2e2e2e; color:white; border-radius:2px;}" setStyleSheet("QPushButton {border: none; background: #2e2e2e; color:white; border-radius:2px;}"
@ -67,7 +67,7 @@ class SortVolumeComics : public ScraperSelector
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit SortVolumeComics(QWidget *parent = 0); explicit SortVolumeComics(QWidget *parent = nullptr);
signals: signals:

View File

@ -9,7 +9,7 @@ class TitleHeader : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
TitleHeader(QWidget *parent = 0); TitleHeader(QWidget *parent = nullptr);
public slots: public slots:
void setTitle(const QString &title); void setTitle(const QString &title);
void setSubTitle(const QString &title); void setSubTitle(const QString &title);

View File

@ -10,7 +10,7 @@ class ComicsRemover : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ComicsRemover(QModelIndexList &indexList, QList<QString> &paths, qulonglong parentId, QObject *parent = 0); explicit ComicsRemover(QModelIndexList &indexList, QList<QString> &paths, qulonglong parentId, QObject *parent = nullptr);
signals: signals:
void remove(int); void remove(int);
@ -31,7 +31,7 @@ class FoldersRemover : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit FoldersRemover(QModelIndexList &indexList, QList<QString> &paths, QObject *parent = 0); explicit FoldersRemover(QModelIndexList &indexList, QList<QString> &paths, QObject *parent = nullptr);
signals: signals:
void remove(QModelIndex); void remove(QModelIndex);

View File

@ -9,7 +9,7 @@
#include <QQuickWidget> #include <QQuickWidget>
ComicsView::ComicsView(QWidget *parent) ComicsView::ComicsView(QWidget *parent)
: QWidget(parent), model(NULL), comicDB(nullptr) : QWidget(parent), model(nullptr), comicDB(nullptr)
{ {
setAcceptDrops(true); setAcceptDrops(true);
} }

View File

@ -16,7 +16,7 @@ class ComicsView : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ComicsView(QWidget *parent = 0); explicit ComicsView(QWidget *parent = nullptr);
virtual void setToolBar(QToolBar *toolBar) = 0; virtual void setToolBar(QToolBar *toolBar) = 0;
virtual void setModel(ComicModel *model); virtual void setModel(ComicModel *model);
virtual void setCurrentIndex(const QModelIndex &index) = 0; virtual void setCurrentIndex(const QModelIndex &index) = 0;

View File

@ -7,7 +7,7 @@ class ComicsViewTransition : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ComicsViewTransition(QWidget *parent = 0); explicit ComicsViewTransition(QWidget *parent = nullptr);
QSize sizeHint(); QSize sizeHint();
protected: protected:

View File

@ -14,7 +14,7 @@ class CreateLibraryDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
CreateLibraryDialog(QWidget *parent = 0); CreateLibraryDialog(QWidget *parent = nullptr);
private: private:
QLabel *nameLabel; QLabel *nameLabel;
@ -46,7 +46,7 @@ class UpdateLibraryDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
UpdateLibraryDialog(QWidget *parent = 0); UpdateLibraryDialog(QWidget *parent = nullptr);
private: private:
QLabel *message; QLabel *message;

View File

@ -48,7 +48,7 @@
class FolderItem class FolderItem
{ {
public: public:
FolderItem(const QList<QVariant> &data, FolderItem *parent = 0); FolderItem(const QList<QVariant> &data, FolderItem *parent = nullptr);
~FolderItem(); ~FolderItem();
void appendChild(FolderItem *child); void appendChild(FolderItem *child);

View File

@ -62,7 +62,7 @@ private:
class ReadingListItem : public ListItem class ReadingListItem : public ListItem
{ {
public: public:
ReadingListItem(const QList<QVariant> &data, ReadingListItem *parent = 0); ReadingListItem(const QList<QVariant> &data, ReadingListItem *parent = nullptr);
QIcon getIcon() const; QIcon getIcon() const;
ReadingListItem *parent; ReadingListItem *parent;
int childCount() const; int childCount() const;

View File

@ -7,7 +7,7 @@ class EmptyContainerInfo : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit EmptyContainerInfo(QWidget *parent = 0); explicit EmptyContainerInfo(QWidget *parent = nullptr);
void setPixmap(const QPixmap &pixmap); void setPixmap(const QPixmap &pixmap);
void setText(const QString &text); void setText(const QString &text);
QVBoxLayout *setUpDefaultLayout(bool addStretch); QVBoxLayout *setUpDefaultLayout(bool addStretch);

View File

@ -8,7 +8,7 @@ class EmptyFolderWidget : public EmptyContainerInfo
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit EmptyFolderWidget(QWidget *parent = 0); explicit EmptyFolderWidget(QWidget *parent = nullptr);
void setSubfolders(const QModelIndex &mi, const QStringList &foldersNames); void setSubfolders(const QModelIndex &mi, const QStringList &foldersNames);
signals: signals:
void subfolderSelected(QModelIndex, int); void subfolderSelected(QModelIndex, int);

View File

@ -9,7 +9,7 @@ class EmptyLabelWidget : public EmptyContainerInfo
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit EmptyLabelWidget(QWidget *parent = 0); explicit EmptyLabelWidget(QWidget *parent = nullptr);
void setColor(YACReader::LabelColors color); void setColor(YACReader::LabelColors color);
signals: signals:

View File

@ -7,7 +7,7 @@
class EmptyReadingListWidget : public EmptyContainerInfo class EmptyReadingListWidget : public EmptyContainerInfo
{ {
public: public:
EmptyReadingListWidget(QWidget *parent = 0); EmptyReadingListWidget(QWidget *parent = nullptr);
}; };
#endif // EMPTY_READING_LIST_WIDGET_H #endif // EMPTY_READING_LIST_WIDGET_H

View File

@ -7,7 +7,7 @@
class EmptySpecialListWidget : public EmptyContainerInfo class EmptySpecialListWidget : public EmptyContainerInfo
{ {
public: public:
EmptySpecialListWidget(QWidget *parent = 0); EmptySpecialListWidget(QWidget *parent = nullptr);
}; };
#endif // EMPTY_SPECIAL_LIST_H #endif // EMPTY_SPECIAL_LIST_H

View File

@ -11,7 +11,7 @@ class ExportComicsInfoDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
ExportComicsInfoDialog(QWidget *parent = 0); ExportComicsInfoDialog(QWidget *parent = nullptr);
~ExportComicsInfoDialog(); ~ExportComicsInfoDialog();
QString source; QString source;

View File

@ -14,7 +14,7 @@ class ExportLibraryDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
ExportLibraryDialog(QWidget *parent = 0); ExportLibraryDialog(QWidget *parent = nullptr);
public slots: public slots:
void exportLibrary(); void exportLibrary();
void findPath(); void findPath();

View File

@ -24,7 +24,7 @@ class ImportComicsInfoDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
ImportComicsInfoDialog(QWidget *parent = 0); ImportComicsInfoDialog(QWidget *parent = nullptr);
~ImportComicsInfoDialog(); ~ImportComicsInfoDialog();
QString dest; QString dest;

View File

@ -13,7 +13,7 @@ class ImportLibraryDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
ImportLibraryDialog(QWidget *parent = 0); ImportLibraryDialog(QWidget *parent = nullptr);
private: private:
QLabel *nameLabel; QLabel *nameLabel;

View File

@ -12,7 +12,7 @@ class InfoComicsView : public ComicsView
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit InfoComicsView(QWidget *parent = 0); explicit InfoComicsView(QWidget *parent = nullptr);
~InfoComicsView(); ~InfoComicsView();
void setToolBar(QToolBar *toolBar); void setToolBar(QToolBar *toolBar);
void setModel(ComicModel *model); void setModel(ComicModel *model);

View File

@ -7,7 +7,7 @@ class NoLibrariesWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit NoLibrariesWidget(QWidget *parent = 0); explicit NoLibrariesWidget(QWidget *parent = nullptr);
signals: signals:
void createNewLibrary(); void createNewLibrary();

View File

@ -9,7 +9,7 @@ class NoSearchResultsWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit NoSearchResultsWidget(QWidget *parent = 0); explicit NoSearchResultsWidget(QWidget *parent = nullptr);
signals: signals:

View File

@ -13,7 +13,7 @@ class OptionsDialog : public YACReaderOptionsDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
OptionsDialog(QWidget *parent = 0); OptionsDialog(QWidget *parent = nullptr);
public slots: public slots:
void editApiKey(); void editApiKey();

View File

@ -2,7 +2,7 @@
#include <QCoreApplication> #include <QCoreApplication>
PackageManager::PackageManager() PackageManager::PackageManager()
: _7z(0) : _7z(nullptr)
{ {
} }
@ -41,7 +41,7 @@ void PackageManager::extractPackage(const QString &packagePath, const QString &d
void PackageManager::cancel() void PackageManager::cancel()
{ {
if (_7z != 0) { if (_7z != nullptr) {
_7z->disconnect(); _7z->disconnect();
_7z->kill(); _7z->kill();
if (creating) { if (creating) {

View File

@ -118,7 +118,7 @@ private:
QString originalCoverSize; QString originalCoverSize;
public: public:
PropertiesDialog(QWidget *parent = 0); PropertiesDialog(QWidget *parent = nullptr);
QString databasePath; QString databasePath;
QString basePath; QString basePath;
QSize sizeHint(); QSize sizeHint();

View File

@ -10,7 +10,7 @@ class RenameLibraryDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
RenameLibraryDialog(QWidget *parent = 0); RenameLibraryDialog(QWidget *parent = nullptr);
private: private:
QLabel *newNameLabel; QLabel *newNameLabel;

View File

@ -50,8 +50,8 @@ void ComicController::service(HttpRequest &request, HttpResponse &response)
Comic *comicFile = FactoryComic::newComic(libraries.getPath(libraryId) + comic.path); Comic *comicFile = FactoryComic::newComic(libraries.getPath(libraryId) + comic.path);
if (comicFile != NULL) { if (comicFile != nullptr) {
QThread *thread = NULL; QThread *thread = nullptr;
thread = new QThread(); thread = new QThread();
@ -65,7 +65,7 @@ void ComicController::service(HttpRequest &request, HttpResponse &response)
comicFile->load(libraries.getPath(libraryId) + comic.path); comicFile->load(libraries.getPath(libraryId) + comic.path);
if (thread != NULL) if (thread != nullptr)
thread->start(); thread->start();
if (remoteComic) { if (remoteComic) {

View File

@ -53,8 +53,8 @@ void ComicControllerV2::service(HttpRequest &request, HttpResponse &response)
Comic *comicFile = FactoryComic::newComic(libraries.getPath(libraryId) + comic.path); Comic *comicFile = FactoryComic::newComic(libraries.getPath(libraryId) + comic.path);
if (comicFile != NULL) { if (comicFile != nullptr) {
QThread *thread = NULL; QThread *thread = nullptr;
thread = new QThread(); thread = new QThread();
@ -68,7 +68,7 @@ void ComicControllerV2::service(HttpRequest &request, HttpResponse &response)
comicFile->load(libraries.getPath(libraryId) + comic.path); comicFile->load(libraries.getPath(libraryId) + comic.path);
if (thread != NULL) if (thread != nullptr)
thread->start(); thread->start();
if (remoteComic) { if (remoteComic) {

View File

@ -9,12 +9,12 @@
HttpConnectionHandler::HttpConnectionHandler(QSettings* settings, HttpRequestHandler* requestHandler, QSslConfiguration* sslConfiguration) HttpConnectionHandler::HttpConnectionHandler(QSettings* settings, HttpRequestHandler* requestHandler, QSslConfiguration* sslConfiguration)
: QThread() : QThread()
{ {
Q_ASSERT(settings!=0); Q_ASSERT(settings!=nullptr);
Q_ASSERT(requestHandler!=0); Q_ASSERT(requestHandler!=nullptr);
this->settings=settings; this->settings=settings;
this->requestHandler=requestHandler; this->requestHandler=requestHandler;
this->sslConfiguration=sslConfiguration; this->sslConfiguration=sslConfiguration;
currentRequest=0; currentRequest=nullptr;
busy=false; busy=false;
// Create TCP or SSL socket // Create TCP or SSL socket
@ -111,7 +111,7 @@ void HttpConnectionHandler::handleConnection(tSocketDescriptor socketDescriptor)
readTimer.start(readTimeout); readTimer.start(readTimeout);
// delete previous request // delete previous request
delete currentRequest; delete currentRequest;
currentRequest=0; currentRequest=nullptr;
} }
@ -136,7 +136,7 @@ void HttpConnectionHandler::readTimeout()
socket->flush(); socket->flush();
socket->disconnectFromHost(); socket->disconnectFromHost();
delete currentRequest; delete currentRequest;
currentRequest=0; currentRequest=nullptr;
} }
@ -183,7 +183,7 @@ void HttpConnectionHandler::read()
socket->flush(); socket->flush();
socket->disconnectFromHost(); socket->disconnectFromHost();
delete currentRequest; delete currentRequest;
currentRequest=0; currentRequest=nullptr;
return; return;
} }
@ -269,7 +269,7 @@ void HttpConnectionHandler::read()
readTimer.start(readTimeout); readTimer.start(readTimeout);
} }
delete currentRequest; delete currentRequest;
currentRequest=0; currentRequest=nullptr;
} }
} }
} }

View File

@ -56,7 +56,7 @@ public:
@param requestHandler Handler that will process each incoming HTTP request @param requestHandler Handler that will process each incoming HTTP request
@param sslConfiguration SSL (HTTPS) will be used if not NULL @param sslConfiguration SSL (HTTPS) will be used if not NULL
*/ */
HttpConnectionHandler(QSettings* settings, HttpRequestHandler* requestHandler, QSslConfiguration* sslConfiguration=NULL); HttpConnectionHandler(QSettings* settings, HttpRequestHandler* requestHandler, QSslConfiguration* sslConfiguration=nullptr);
/** Destructor */ /** Destructor */
virtual ~HttpConnectionHandler(); virtual ~HttpConnectionHandler();

View File

@ -10,10 +10,10 @@
HttpConnectionHandlerPool::HttpConnectionHandlerPool(QSettings* settings, HttpRequestHandler* requestHandler) HttpConnectionHandlerPool::HttpConnectionHandlerPool(QSettings* settings, HttpRequestHandler* requestHandler)
: QObject() : QObject()
{ {
Q_ASSERT(settings!=0); Q_ASSERT(settings!=nullptr);
this->settings=settings; this->settings=settings;
this->requestHandler=requestHandler; this->requestHandler=requestHandler;
this->sslConfiguration=NULL; this->sslConfiguration=nullptr;
loadSslConfig(); loadSslConfig();
cleanupTimer.start(settings->value("cleanupInterval",1000).toInt()); cleanupTimer.start(settings->value("cleanupInterval",1000).toInt());
connect(&cleanupTimer, SIGNAL(timeout()), SLOT(cleanup())); connect(&cleanupTimer, SIGNAL(timeout()), SLOT(cleanup()));
@ -34,7 +34,7 @@ HttpConnectionHandlerPool::~HttpConnectionHandlerPool()
HttpConnectionHandler* HttpConnectionHandlerPool::getConnectionHandler() HttpConnectionHandler* HttpConnectionHandlerPool::getConnectionHandler()
{ {
HttpConnectionHandler* freeHandler=0; HttpConnectionHandler* freeHandler=nullptr;
mutex.lock(); mutex.lock();
// find a free handler in pool // find a free handler in pool
foreach(HttpConnectionHandler* handler, pool) foreach(HttpConnectionHandler* handler, pool)

View File

@ -11,9 +11,9 @@
HttpListener::HttpListener(QSettings* settings, HttpRequestHandler* requestHandler, QObject *parent) HttpListener::HttpListener(QSettings* settings, HttpRequestHandler* requestHandler, QObject *parent)
: QTcpServer(parent) : QTcpServer(parent)
{ {
Q_ASSERT(settings!=0); Q_ASSERT(settings!=nullptr);
Q_ASSERT(requestHandler!=0); Q_ASSERT(requestHandler!=nullptr);
pool=NULL; pool=nullptr;
this->settings=settings; this->settings=settings;
this->requestHandler=requestHandler; this->requestHandler=requestHandler;
// Reqister type of socketDescriptor for signal/slot handling // Reqister type of socketDescriptor for signal/slot handling
@ -64,7 +64,7 @@ void HttpListener::close() {
qDebug("HttpListener: closed"); qDebug("HttpListener: closed");
if (pool) { if (pool) {
delete pool; delete pool;
pool=NULL; pool=nullptr;
} }
} }
@ -73,7 +73,7 @@ void HttpListener::incomingConnection(tSocketDescriptor socketDescriptor) {
qDebug("HttpListener: New connection"); qDebug("HttpListener: New connection");
#endif #endif
HttpConnectionHandler* freeHandler=NULL; HttpConnectionHandler* freeHandler=nullptr;
if (pool) if (pool)
{ {
freeHandler=pool->getConnectionHandler(); freeHandler=pool->getConnectionHandler();

View File

@ -52,7 +52,7 @@ public:
@param parent Parent object. @param parent Parent object.
@warning Ensure to close or delete the listener before deleting the request handler. @warning Ensure to close or delete the listener before deleting the request handler.
*/ */
HttpListener(QSettings* settings, HttpRequestHandler* requestHandler, QObject* parent = NULL); HttpListener(QSettings* settings, HttpRequestHandler* requestHandler, QObject* parent = nullptr);
/** Destructor */ /** Destructor */
virtual ~HttpListener(); virtual ~HttpListener();

View File

@ -441,7 +441,7 @@ void HttpRequest::parseMultiPartFile()
#ifdef SUPERVERBOSE #ifdef SUPERVERBOSE
qDebug("HttpRequest: reading multpart data"); qDebug("HttpRequest: reading multpart data");
#endif #endif
QTemporaryFile* uploadedFile=0; QTemporaryFile* uploadedFile=nullptr;
QByteArray fieldValue; QByteArray fieldValue;
while (!tempFile.atEnd() && !finished && !tempFile.error()) while (!tempFile.atEnd() && !finished && !tempFile.error())
{ {

View File

@ -31,7 +31,7 @@ public:
* Constructor. * Constructor.
* @param parent Parent object. * @param parent Parent object.
*/ */
HttpRequestHandler(QObject* parent=NULL); HttpRequestHandler(QObject* parent=nullptr);
/** Destructor */ /** Destructor */
virtual ~HttpRequestHandler(); virtual ~HttpRequestHandler();

View File

@ -22,7 +22,7 @@ HttpSession::HttpSession(bool canStore)
} }
else else
{ {
dataPtr=0; dataPtr=nullptr;
} }
} }
@ -103,7 +103,7 @@ QByteArray HttpSession::getId() const
} }
bool HttpSession::isNull() const { bool HttpSession::isNull() const {
return dataPtr==0; return dataPtr==nullptr;
} }
void HttpSession::set(const QByteArray& key, const QVariant& value) void HttpSession::set(const QByteArray& key, const QVariant& value)

View File

@ -36,7 +36,7 @@ class DECLSPEC HttpSessionStore : public QObject {
public: public:
/** Constructor. */ /** Constructor. */
HttpSessionStore(QSettings* settings, QObject* parent=NULL); HttpSessionStore(QSettings* settings, QObject* parent=nullptr);
/** Destructor */ /** Destructor */
virtual ~HttpSessionStore(); virtual ~HttpSessionStore();

View File

@ -46,7 +46,7 @@ class DECLSPEC StaticFileController : public HttpRequestHandler {
public: public:
/** Constructor */ /** Constructor */
StaticFileController(QSettings* settings, QObject* parent = NULL); StaticFileController(QSettings* settings, QObject* parent = nullptr);
/** Generates the response */ /** Generates the response */
void service(HttpRequest& request, HttpResponse& response); void service(HttpRequest& request, HttpResponse& response);

View File

@ -49,7 +49,7 @@ public:
@param settings configurations settings @param settings configurations settings
@param parent Parent object @param parent Parent object
*/ */
TemplateCache(QSettings* settings, QObject* parent=0); TemplateCache(QSettings* settings, QObject* parent=nullptr);
protected: protected:

View File

@ -45,7 +45,7 @@ public:
@param settings configurations settings @param settings configurations settings
@param parent parent object @param parent parent object
*/ */
TemplateLoader(QSettings* settings, QObject* parent=0); TemplateLoader(QSettings* settings, QObject* parent=nullptr);
/** Destructor */ /** Destructor */
virtual ~TemplateLoader(); virtual ~TemplateLoader();

View File

@ -14,7 +14,7 @@ class RequestMapper : public HttpRequestHandler
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(RequestMapper) Q_DISABLE_COPY(RequestMapper)
public: public:
RequestMapper(QObject *parent = 0); RequestMapper(QObject *parent = nullptr);
void service(HttpRequest &request, HttpResponse &response); void service(HttpRequest &request, HttpResponse &response);
void loadSessionV1(HttpRequest &request, HttpResponse &response); void loadSessionV1(HttpRequest &request, HttpResponse &response);

View File

@ -9,15 +9,15 @@
#include <QFile> #include <QFile>
#include <QString> #include <QString>
QString Static::configDir = 0; QString Static::configDir = nullptr;
TemplateLoader *Static::templateLoader = 0; TemplateLoader *Static::templateLoader = nullptr;
HttpSessionStore *Static::sessionStore = 0; HttpSessionStore *Static::sessionStore = nullptr;
StaticFileController *Static::staticFileController = 0; StaticFileController *Static::staticFileController = 0;
YACReaderHttpSessionStore *Static::yacreaderSessionStore = 0; YACReaderHttpSessionStore *Static::yacreaderSessionStore = nullptr;
QString Static::getConfigFileName() QString Static::getConfigFileName()
{ {
@ -62,5 +62,5 @@ QString Static::getConfigDir()
} }
qWarning("Cannot find config file %s", qPrintable(configFileName)); //TODO establecer los valores por defecto qWarning("Cannot find config file %s", qPrintable(configFileName)); //TODO establecer los valores por defecto
return 0; return nullptr;
} }

View File

@ -9,7 +9,7 @@ class YACReaderHttpSession : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderHttpSession(QObject *parent = 0); explicit YACReaderHttpSession(QObject *parent = nullptr);
~YACReaderHttpSession(); ~YACReaderHttpSession();
void setComicsOnDevice(const QSet<QString> &set); void setComicsOnDevice(const QSet<QString> &set);

View File

@ -11,7 +11,7 @@ class YACReaderHttpSessionStore : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderHttpSessionStore(HttpSessionStore *sessionStore, QObject *parent = 0); explicit YACReaderHttpSessionStore(HttpSessionStore *sessionStore, QObject *parent = nullptr);
void addYACReaderHttpSession(const QByteArray &httpSessionId, YACReaderHttpSession *yacreaderHttpSession); void addYACReaderHttpSession(const QByteArray &httpSessionId, YACReaderHttpSession *yacreaderHttpSession);
YACReaderHttpSession *getYACReaderSessionHttpSession(const QByteArray &httpSessionId); YACReaderHttpSession *getYACReaderSessionHttpSession(const QByteArray &httpSessionId);

View File

@ -9,7 +9,7 @@ class YACReaderComicInfoHelper : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderComicInfoHelper(QObject *parent = 0); explicit YACReaderComicInfoHelper(QObject *parent = nullptr);
void setModel(ComicModel *model); void setModel(ComicModel *model);

View File

@ -9,7 +9,7 @@ YACReaderComicsSelectionHelper::YACReaderComicsSelectionHelper(QObject *parent)
void YACReaderComicsSelectionHelper::setModel(ComicModel *model) void YACReaderComicsSelectionHelper::setModel(ComicModel *model)
{ {
if (model == NULL) if (model == nullptr)
return; return;
this->model = model; this->model = model;
@ -22,7 +22,7 @@ void YACReaderComicsSelectionHelper::setModel(ComicModel *model)
void YACReaderComicsSelectionHelper::selectIndex(int index) void YACReaderComicsSelectionHelper::selectIndex(int index)
{ {
if (_selectionModel != nullptr && model != NULL) { if (_selectionModel != nullptr && model != nullptr) {
_selectionModel->select(model->index(index, 0), QItemSelectionModel::Select | QItemSelectionModel::Rows); _selectionModel->select(model->index(index, 0), QItemSelectionModel::Select | QItemSelectionModel::Rows);
emit selectionChanged(); emit selectionChanged();
@ -31,7 +31,7 @@ void YACReaderComicsSelectionHelper::selectIndex(int index)
void YACReaderComicsSelectionHelper::deselectIndex(int index) void YACReaderComicsSelectionHelper::deselectIndex(int index)
{ {
if (_selectionModel != nullptr && model != NULL) { if (_selectionModel != nullptr && model != nullptr) {
_selectionModel->select(model->index(index, 0), QItemSelectionModel::Deselect | QItemSelectionModel::Rows); _selectionModel->select(model->index(index, 0), QItemSelectionModel::Deselect | QItemSelectionModel::Rows);
emit selectionChanged(); emit selectionChanged();
@ -40,7 +40,7 @@ void YACReaderComicsSelectionHelper::deselectIndex(int index)
bool YACReaderComicsSelectionHelper::isSelectedIndex(int index) const bool YACReaderComicsSelectionHelper::isSelectedIndex(int index) const
{ {
if (_selectionModel != nullptr && model != NULL) { if (_selectionModel != nullptr && model != nullptr) {
QModelIndex mi = model->index(index, 0); QModelIndex mi = model->index(index, 0);
return _selectionModel->isSelected(mi); return _selectionModel->isSelected(mi);
} }

View File

@ -10,7 +10,7 @@ class YACReaderComicsSelectionHelper : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderComicsSelectionHelper(QObject *parent = 0); explicit YACReaderComicsSelectionHelper(QObject *parent = nullptr);
void setModel(ComicModel *model); void setModel(ComicModel *model);

View File

@ -24,7 +24,7 @@ class YACReaderComicsViewsManager : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderComicsViewsManager(QSettings *settings, LibraryWindow *parent = 0); explicit YACReaderComicsViewsManager(QSettings *settings, LibraryWindow *parent = nullptr);
QWidget *containerWidget(); QWidget *containerWidget();

View File

@ -9,7 +9,7 @@ class YACReaderFoldersView : public YACReaderTreeView
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderFoldersView(QWidget *parent = 0); explicit YACReaderFoldersView(QWidget *parent = nullptr);
signals: signals:
//Drops //Drops
@ -28,7 +28,7 @@ class YACReaderFoldersViewItemDeletegate : public QStyledItemDelegate
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderFoldersViewItemDeletegate(QObject *parent = 0); explicit YACReaderFoldersViewItemDeletegate(QObject *parent = nullptr);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
}; };

View File

@ -37,7 +37,7 @@ class YACReaderHistoryController : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderHistoryController(QObject *parent = 0); explicit YACReaderHistoryController(QObject *parent = nullptr);
signals: signals:
void enabledForward(bool enabled); void enabledForward(bool enabled);

View File

@ -13,7 +13,7 @@ class YACReaderLocalServer : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderLocalServer(QObject *parent = 0); explicit YACReaderLocalServer(QObject *parent = nullptr);
signals: signals:
void comicUpdated(quint64 libraryId, const ComicDB &comic); void comicUpdated(quint64 libraryId, const ComicDB &comic);

View File

@ -14,7 +14,7 @@ class YACReaderMainToolBar : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderMainToolBar(QWidget *parent = 0); explicit YACReaderMainToolBar(QWidget *parent = nullptr);
QSize sizeHint() const; QSize sizeHint() const;
QToolButton *backButton; QToolButton *backButton;

View File

@ -280,7 +280,7 @@ qulonglong YACReaderNavigationController::folderModelIndexToID(const QModelIndex
return 1; return 1;
auto folderItem = static_cast<FolderItem *>(mi.internalPointer()); auto folderItem = static_cast<FolderItem *>(mi.internalPointer());
if (folderItem != 0) if (folderItem != nullptr)
return folderItem->id; return folderItem->id;
return 1; return 1;

View File

@ -9,7 +9,7 @@ class YACReaderReadingListsView : public YACReaderTreeView
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderReadingListsView(QWidget *parent = 0); explicit YACReaderReadingListsView(QWidget *parent = nullptr);
protected: protected:
//Drop to import & internal Drag&Drop for resorting //Drop to import & internal Drag&Drop for resorting
@ -22,7 +22,7 @@ class YACReaderReadingListsViewItemDeletegate : public QStyledItemDelegate
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderReadingListsViewItemDeletegate(QObject *parent = 0); explicit YACReaderReadingListsViewItemDeletegate(QObject *parent = nullptr);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
}; };