summaryrefslogtreecommitdiff
path: root/src/pendingupdates.cc
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-10-07 22:33:50 +0200
committerJannis M. Hoffmann <jannis@fehcom.de>2023-10-08 11:35:51 +0200
commit1978c49bea5b439d993067c055cec47e70db8fd6 (patch)
tree255caea96a13f95564e6b631be9a4ac55ce33cd9 /src/pendingupdates.cc
parent3b1278f5459514a6d6364f068ff97b8a0432057b (diff)
minor refactoring
Diffstat (limited to 'src/pendingupdates.cc')
-rw-r--r--src/pendingupdates.cc38
1 files changed, 5 insertions, 33 deletions
diff --git a/src/pendingupdates.cc b/src/pendingupdates.cc
index 1e4af8d..bf4e0f2 100644
--- a/src/pendingupdates.cc
+++ b/src/pendingupdates.cc
@@ -1,9 +1,10 @@
-/** --------------------------------------------------------------------
+/**
* @file pendingupdates.cc
* @brief <--->
* @author Andreas Aardal Hanssen
* @date 2002-2005
- * ----------------------------------------------------------------- **/
+ */
+
#include "pendingupdates.h"
#include "iodevice.h"
@@ -16,10 +17,9 @@
#include <string>
#include <vector>
-using namespace ::std;
+using namespace std;
using namespace Binc;
-//------------------------------------------------------------------------
PendingUpdates::PendingUpdates(void) : expunges(), flagupdates()
{
recent = 0;
@@ -29,16 +29,13 @@ PendingUpdates::PendingUpdates(void) : expunges(), flagupdates()
newexists = false;
}
-//------------------------------------------------------------------------
PendingUpdates::~PendingUpdates(void) {}
-//------------------------------------------------------------------------
void PendingUpdates::addExpunged(unsigned int uid)
{
expunges.push_back(uid);
}
-//------------------------------------------------------------------------
void PendingUpdates::addFlagUpdates(unsigned int sqnr,
unsigned int uid,
unsigned int flags,
@@ -49,92 +46,76 @@ void PendingUpdates::addFlagUpdates(unsigned int sqnr,
sqnrtocflags[sqnr] = cflags;
}
-//------------------------------------------------------------------------
void PendingUpdates::setExists(unsigned int n)
{
exists = n;
newexists = true;
}
-//------------------------------------------------------------------------
void PendingUpdates::setRecent(unsigned int n)
{
recent = n;
newrecent = true;
}
-//------------------------------------------------------------------------
unsigned int PendingUpdates::getExists(void) const
{
return exists;
}
-//------------------------------------------------------------------------
unsigned int PendingUpdates::getRecent(void) const
{
return recent;
}
-//------------------------------------------------------------------------
bool PendingUpdates::newExists(void) const
{
return newexists;
}
-//------------------------------------------------------------------------
bool PendingUpdates::newRecent(void) const
{
return newrecent;
}
-//------------------------------------------------------------------------
PendingUpdates::expunged_const_iterator::expunged_const_iterator(void) {}
-//------------------------------------------------------------------------
PendingUpdates::expunged_const_iterator::expunged_const_iterator(vector<unsigned int>::iterator i)
: internal(i)
{}
-//------------------------------------------------------------------------
unsigned int PendingUpdates::expunged_const_iterator::operator*(void) const
{
return *internal;
}
-//------------------------------------------------------------------------
void PendingUpdates::expunged_const_iterator::operator++(void)
{
++internal;
}
-//------------------------------------------------------------------------
bool PendingUpdates::expunged_const_iterator::operator==(expunged_const_iterator i) const
{
return internal == i.internal;
}
-//------------------------------------------------------------------------
bool PendingUpdates::expunged_const_iterator::operator!=(expunged_const_iterator i) const
{
return internal != i.internal;
}
-//------------------------------------------------------------------------
PendingUpdates::expunged_const_iterator PendingUpdates::beginExpunged(void)
{
return expunged_const_iterator(expunges.begin());
}
-//------------------------------------------------------------------------
PendingUpdates::expunged_const_iterator PendingUpdates::endExpunged(void)
{
return expunged_const_iterator(expunges.end());
}
-//------------------------------------------------------------------------
PendingUpdates::flagupdates_const_iterator::flagupdates_const_iterator(void) {}
-//------------------------------------------------------------------------
PendingUpdates::flagupdates_const_iterator::flagupdates_const_iterator(
map<unsigned int, unsigned int>::iterator i,
map<unsigned int, vector<string>> *j,
@@ -145,55 +126,46 @@ PendingUpdates::flagupdates_const_iterator::flagupdates_const_iterator(
sqnrtouid = sqnrmap;
}
-//------------------------------------------------------------------------
void PendingUpdates::flagupdates_const_iterator::operator++(void)
{
++internal;
}
-//------------------------------------------------------------------------
bool PendingUpdates::flagupdates_const_iterator::operator!=(flagupdates_const_iterator i) const
{
return internal != i.internal;
}
-//------------------------------------------------------------------------
PendingUpdates::flagupdates_const_iterator PendingUpdates::beginFlagUpdates(void)
{
return flagupdates_const_iterator(flagupdates.begin(), &sqnrtocflags, &sqnrtouid);
}
-//------------------------------------------------------------------------
PendingUpdates::flagupdates_const_iterator PendingUpdates::endFlagUpdates(void)
{
return flagupdates_const_iterator(flagupdates.end(), &sqnrtocflags, &sqnrtouid);
}
-//------------------------------------------------------------------------
unsigned int PendingUpdates::flagupdates_const_iterator::first(void) const
{
return internal->first;
}
-//------------------------------------------------------------------------
unsigned int PendingUpdates::flagupdates_const_iterator::second(void) const
{
return internal->second;
}
-//------------------------------------------------------------------------
vector<string> PendingUpdates::flagupdates_const_iterator::getCustomFlags(void) const
{
return (*sqnrtocflags)[internal->first];
}
-//------------------------------------------------------------------------
unsigned int PendingUpdates::flagupdates_const_iterator::getUID(void) const
{
return (*sqnrtouid)[internal->first];
}
-//--------------------------------------------------------------------
bool Binc::pendingUpdates(Mailbox *mailbox,
int type,
bool rescan,
@@ -203,7 +175,7 @@ bool Binc::pendingUpdates(Mailbox *mailbox,
{
Session &session = Session::getInstance();
- if (mailbox == 0) return true;
+ if (mailbox == nullptr) return true;
PendingUpdates p;
if (!mailbox->getUpdates(rescan, type, p, forceScan)) {