diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/BasicHistory/src/ExportManager.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/BasicHistory/src/ExportManager.cpp')
-rw-r--r-- | plugins/BasicHistory/src/ExportManager.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/BasicHistory/src/ExportManager.cpp b/plugins/BasicHistory/src/ExportManager.cpp index 820abcf64b..111a813ed7 100644 --- a/plugins/BasicHistory/src/ExportManager.cpp +++ b/plugins/BasicHistory/src/ExportManager.cpp @@ -90,7 +90,7 @@ std::wstring ReplaceExt(const std::wstring& file, const wchar_t* ext) bool ExportManager::Export(IExport::ExportType type)
{
- m_exp = NULL;
+ m_exp = nullptr;
UINT cp;
std::wstring encoding;
bool isBin = false;
@@ -180,7 +180,7 @@ bool ExportManager::Export(IExport::ExportType type) const wchar_t* ExportManager::GetExt(IImport::ImportType type)
{
- IImport *imp = NULL;
+ IImport *imp = nullptr;
switch (type) {
case IImport::Binary:
imp = new BinaryExport();
@@ -199,7 +199,7 @@ const wchar_t* ExportManager::GetExt(IImport::ImportType type) int ExportManager::Import(IImport::ImportType type, const std::vector<MCONTACT>& contacts)
{
- IImport *imp = NULL;
+ IImport *imp = nullptr;
switch (type) {
case IImport::Binary:
imp = new BinaryExport();
@@ -238,7 +238,7 @@ int ExportManager::Import(IImport::ImportType type, const std::vector<MCONTACT>& bool ExportManager::Import(IImport::ImportType type, std::vector<IImport::ExternalMessage>& eventList, std::wstring* err, bool* differentContact, std::vector<MCONTACT>* contacts)
{
- IImport *imp = NULL;
+ IImport *imp = nullptr;
switch (type) {
case IImport::Binary:
imp = new BinaryExport();
@@ -269,10 +269,10 @@ bool ExportManager::Import(IImport::ImportType type, std::vector<IImport::Extern int contInFile = imp->IsContactInFile(v);
if (contInFile == -1) {
ret = false;
- if (err != NULL)
+ if (err != nullptr)
*err = TranslateT("File does not contain selected contact");
- if (contacts != NULL && differentContact != NULL) {
+ if (contacts != nullptr && differentContact != nullptr) {
contInFile = imp->IsContactInFile(*contacts);
if (contInFile >= 0) {
*differentContact = true;
@@ -282,12 +282,12 @@ bool ExportManager::Import(IImport::ImportType type, std::vector<IImport::Extern }
else if (contInFile == 0 || contInFile == -3) {
ret = imp->GetEventList(eventList);
- if (!ret && err != NULL)
+ if (!ret && err != nullptr)
*err = TranslateT("File is corrupted");
}
else {
ret = false;
- if (err != NULL)
+ if (err != nullptr)
*err = TranslateT("File is corrupted");
}
stream->close();
@@ -298,7 +298,7 @@ bool ExportManager::Import(IImport::ImportType type, std::vector<IImport::Extern void ExportManager::AddGroup(bool isMe, const std::wstring &time, const std::wstring &user, const std::wstring &eventText, int)
{
- if (m_exp == NULL)
+ if (m_exp == nullptr)
return;
m_exp->WriteGroup(isMe, time, user, eventText);
@@ -371,7 +371,7 @@ void ExportManager::DeleteExportedEvents() void ExportManager::SetDeleteWithoutExportEvents(int deltaTime, DWORD now)
{
- m_exp = NULL;
+ m_exp = nullptr;
m_deltaTime = deltaTime;
m_now = now;
RefreshEventList();
|