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
public:
explicit AddLabelDialog(QWidget *parent = 0);
explicit AddLabelDialog(QWidget *parent = nullptr);
YACReader::LabelColors selectedColor();
QString name();
signals:

View File

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

View File

@ -11,7 +11,7 @@ class ComicFilesManager : public QObject
{
Q_OBJECT
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 moveComicsTo(const QList<QPair<QString, QString>> &comics, const QString &folderDest, const QModelIndex &dest);
static QList<QPair<QString, QString>> getDroppedFiles(const QList<QUrl> &urls);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@ class ResponseParser : public QObject
{
Q_OBJECT
public:
explicit ResponseParser(QObject *parent = 0);
explicit ResponseParser(QObject *parent = nullptr);
bool responseError();
QString errorDescription();
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
{
if (!index.isValid())
return 0;
return nullptr;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}

View File

@ -7,7 +7,7 @@ class VolumeComicsModel : public JSONModel
{
Q_OBJECT
public:
explicit VolumeComicsModel(QObject *parent = 0);
explicit VolumeComicsModel(QObject *parent = nullptr);
void load(const QString &json);
//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
{
if (!index.isValid())
return 0;
return nullptr;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -56,7 +56,7 @@ public:
@param requestHandler Handler that will process each incoming HTTP request
@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 */
virtual ~HttpConnectionHandler();

View File

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

View File

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

View File

@ -52,7 +52,7 @@ public:
@param parent Parent object.
@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 */
virtual ~HttpListener();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,15 +9,15 @@
#include <QFile>
#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;
YACReaderHttpSessionStore *Static::yacreaderSessionStore = 0;
YACReaderHttpSessionStore *Static::yacreaderSessionStore = nullptr;
QString Static::getConfigFileName()
{
@ -62,5 +62,5 @@ QString Static::getConfigDir()
}
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
public:
explicit YACReaderHttpSession(QObject *parent = 0);
explicit YACReaderHttpSession(QObject *parent = nullptr);
~YACReaderHttpSession();
void setComicsOnDevice(const QSet<QString> &set);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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