Commit f8378983 authored by Karel Slaný's avatar Karel Slaný
Browse files

Replaced NULL with Q_NULLPTR in db_wrapper.cpp.

parent a3c362fb
......@@ -21,8 +21,6 @@
* the two.
*/
#include <QDebug>
#include "src/settings.h"
#include "src/net/db_wrapper.h"
#include "src/sqlite/account_db.h"
......@@ -46,10 +44,10 @@ bool DbWrapper::insertMessageListToDb(const QString &userName,
QList<qint64> &messageChangedStatusList, QString &txt)
/* ========================================================================= */
{
MessageDb *msgDb = NULL;
msgDb = globMessageDbsPtr->accessMessageDb(globSet.dbsLocation, userName,
MessageDb *msgDb = globMessageDbsPtr->accessMessageDb(
globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk());
if (msgDb == NULL) {
if (msgDb == Q_NULLPTR) {
txt = tr("Cannot open message database!");
return false;
}
......@@ -101,8 +99,6 @@ bool DbWrapper::insertMessageListToDb(const QString &userName,
msgDb->getMessageCount(MessageDb::TYPE_SENT));
}
//qDebug() << "Messages:" << messages.count();
return true;
}
......@@ -117,10 +113,9 @@ bool DbWrapper::insertCompleteMessageToDb(const QString &userName,
bool ret = true;
/* Open files database from username */
FileDb *fDb = NULL;
fDb = globFileDbsPtr->accessFileDb(globSet.dbsLocation, userName,
FileDb *fDb = globFileDbsPtr->accessFileDb(globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk());
if (fDb == NULL) {
if (fDb == Q_NULLPTR) {
txt = tr("Cannot open file database!");
return false;
}
......@@ -137,10 +132,10 @@ bool DbWrapper::insertCompleteMessageToDb(const QString &userName,
fDb->commitTransaction();
/* Open messages database from username */
MessageDb *msgDb = NULL;
msgDb = globMessageDbsPtr->accessMessageDb(globSet.dbsLocation, userName,
MessageDb *msgDb = globMessageDbsPtr->accessMessageDb(
globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk());
if (msgDb == NULL) {
if (msgDb == Q_NULLPTR) {
txt = tr("Cannot open message database!");
return false;
}
......@@ -209,10 +204,10 @@ bool DbWrapper::updateAuthorInfo(const QString &userName,
QString &txt)
/* ========================================================================= */
{
MessageDb *msgDb = NULL;
msgDb = globMessageDbsPtr->accessMessageDb(globSet.dbsLocation, userName,
MessageDb *msgDb = globMessageDbsPtr->accessMessageDb(
globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk());
if (msgDb == NULL) {
if (msgDb == Q_NULLPTR) {
txt = tr("Cannot open message database!");
return false;
}
......@@ -248,10 +243,10 @@ bool DbWrapper::insertMesasgeDeliveryInfoToDb(const QString &userName,
{
bool ret = true;
MessageDb *msgDb = NULL;
msgDb = globMessageDbsPtr->accessMessageDb(globSet.dbsLocation, userName,
MessageDb *msgDb = globMessageDbsPtr->accessMessageDb(
globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk());
if (msgDb == NULL) {
if (msgDb == Q_NULLPTR) {
txt = tr("Cannot open message database!");
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment