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 @@ ...@@ -21,8 +21,6 @@
* the two. * the two.
*/ */
#include <QDebug>
#include "src/settings.h" #include "src/settings.h"
#include "src/net/db_wrapper.h" #include "src/net/db_wrapper.h"
#include "src/sqlite/account_db.h" #include "src/sqlite/account_db.h"
...@@ -46,10 +44,10 @@ bool DbWrapper::insertMessageListToDb(const QString &userName, ...@@ -46,10 +44,10 @@ bool DbWrapper::insertMessageListToDb(const QString &userName,
QList<qint64> &messageChangedStatusList, QString &txt) QList<qint64> &messageChangedStatusList, QString &txt)
/* ========================================================================= */ /* ========================================================================= */
{ {
MessageDb *msgDb = NULL; MessageDb *msgDb = globMessageDbsPtr->accessMessageDb(
msgDb = globMessageDbsPtr->accessMessageDb(globSet.dbsLocation, userName, globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk()); AccountListModel::globAccounts[userName].storeToDisk());
if (msgDb == NULL) { if (msgDb == Q_NULLPTR) {
txt = tr("Cannot open message database!"); txt = tr("Cannot open message database!");
return false; return false;
} }
...@@ -101,8 +99,6 @@ bool DbWrapper::insertMessageListToDb(const QString &userName, ...@@ -101,8 +99,6 @@ bool DbWrapper::insertMessageListToDb(const QString &userName,
msgDb->getMessageCount(MessageDb::TYPE_SENT)); msgDb->getMessageCount(MessageDb::TYPE_SENT));
} }
//qDebug() << "Messages:" << messages.count();
return true; return true;
} }
...@@ -117,10 +113,9 @@ bool DbWrapper::insertCompleteMessageToDb(const QString &userName, ...@@ -117,10 +113,9 @@ bool DbWrapper::insertCompleteMessageToDb(const QString &userName,
bool ret = true; bool ret = true;
/* Open files database from username */ /* Open files database from username */
FileDb *fDb = NULL; FileDb *fDb = globFileDbsPtr->accessFileDb(globSet.dbsLocation, userName,
fDb = globFileDbsPtr->accessFileDb(globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk()); AccountListModel::globAccounts[userName].storeToDisk());
if (fDb == NULL) { if (fDb == Q_NULLPTR) {
txt = tr("Cannot open file database!"); txt = tr("Cannot open file database!");
return false; return false;
} }
...@@ -137,10 +132,10 @@ bool DbWrapper::insertCompleteMessageToDb(const QString &userName, ...@@ -137,10 +132,10 @@ bool DbWrapper::insertCompleteMessageToDb(const QString &userName,
fDb->commitTransaction(); fDb->commitTransaction();
/* Open messages database from username */ /* Open messages database from username */
MessageDb *msgDb = NULL; MessageDb *msgDb = globMessageDbsPtr->accessMessageDb(
msgDb = globMessageDbsPtr->accessMessageDb(globSet.dbsLocation, userName, globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk()); AccountListModel::globAccounts[userName].storeToDisk());
if (msgDb == NULL) { if (msgDb == Q_NULLPTR) {
txt = tr("Cannot open message database!"); txt = tr("Cannot open message database!");
return false; return false;
} }
...@@ -209,10 +204,10 @@ bool DbWrapper::updateAuthorInfo(const QString &userName, ...@@ -209,10 +204,10 @@ bool DbWrapper::updateAuthorInfo(const QString &userName,
QString &txt) QString &txt)
/* ========================================================================= */ /* ========================================================================= */
{ {
MessageDb *msgDb = NULL; MessageDb *msgDb = globMessageDbsPtr->accessMessageDb(
msgDb = globMessageDbsPtr->accessMessageDb(globSet.dbsLocation, userName, globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk()); AccountListModel::globAccounts[userName].storeToDisk());
if (msgDb == NULL) { if (msgDb == Q_NULLPTR) {
txt = tr("Cannot open message database!"); txt = tr("Cannot open message database!");
return false; return false;
} }
...@@ -248,10 +243,10 @@ bool DbWrapper::insertMesasgeDeliveryInfoToDb(const QString &userName, ...@@ -248,10 +243,10 @@ bool DbWrapper::insertMesasgeDeliveryInfoToDb(const QString &userName,
{ {
bool ret = true; bool ret = true;
MessageDb *msgDb = NULL; MessageDb *msgDb = globMessageDbsPtr->accessMessageDb(
msgDb = globMessageDbsPtr->accessMessageDb(globSet.dbsLocation, userName, globSet.dbsLocation, userName,
AccountListModel::globAccounts[userName].storeToDisk()); AccountListModel::globAccounts[userName].storeToDisk());
if (msgDb == NULL) { if (msgDb == Q_NULLPTR) {
txt = tr("Cannot open message database!"); txt = tr("Cannot open message database!");
return false; 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