Skip to content
Snippets Groups Projects
Commit d9b5182f authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

[ #36391 ] Fix cppcheck warnings

parent 118a2e58
Branches
Tags
No related merge requests found
......@@ -241,13 +241,12 @@ void AccountListModel::slotVoiceMailNotify(const QString &accountID, int count)
void AccountListModel::update()
{
ConfigurationManagerInterface & configurationManager = DBus::ConfigurationManager::instance();
Account* current;
QList<Account*> tmp;
for (int i = 0; i < m_lAccounts.size(); i++)
tmp << m_lAccounts[i];
for (int i = 0; i < tmp.size(); i++) {
current = tmp[i];
Account* current = tmp[i];
if (!current->isNew() && (current->state() != Account::AccountEditState::NEW
&& current->state() != Account::AccountEditState::MODIFIED
&& current->state() != Account::AccountEditState::OUTDATED))
......@@ -297,7 +296,6 @@ void AccountListModel::save()
//create or update each account from accountList
for (int i = 0; i < size(); i++) {
Account* current = (*this)[i];
//current->save();
current->performAction(Account::AccountEditAction::SAVE);
}
......@@ -406,9 +404,8 @@ QVector<Account*> AccountListModel::getAccountsByState(const QString& state)
///Get the first registerred account (default account)
Account* AccountListModel::firstRegisteredAccount() const
{
Account* current;
for (int i = 0; i < m_lAccounts.count(); ++i) {
current = m_lAccounts[i];
Account* current = m_lAccounts[i];
if(current && current->registrationStatus() == Account::State::REGISTERED && current->isEnabled())
return current;
else if (current && (current->registrationStatus() == Account::State::READY) && m_lAccounts.count() == 1)
......
......@@ -808,7 +808,7 @@ Call::State Call::performAction(Call::Action action)
try {
changeCurrentState(actionPerformedStateMap[previousState][action]);
}
catch(Call::State state) {
catch(Call::State& state) {
qDebug() << "State change failed (actionPerformedStateMap)" << state;
m_CurrentState = Call::State::ERROR;
emit stateChanged();
......
......@@ -70,7 +70,7 @@ TopLevelItem::~TopLevelItem() {
}
ContactTreeNode::ContactTreeNode(Contact* ct, ContactProxyModel* parent) : CategorizedCompositeNode(CategorizedCompositeNode::Type::CONTACT),
m_pContact(ct)
m_pContact(ct),m_pParent3(nullptr)
{
m_pBinder = new ContactTreeBinder(parent,this);
}
......
......@@ -217,8 +217,8 @@ void NumberCompletionModel::getRange(QMap<QString,PhoneDirectoryModel::NumberWra
int toAdd = size-1;
mid = iBeg;
while (toAdd && mid != map.end()) {
mid++;
toAdd--;
++mid;
--toAdd;
}
}
if (mid != map.end() && mid.key().left(prefixLen) == pref && iBeg.key().left(prefixLen) < pref) {
......@@ -236,7 +236,7 @@ void NumberCompletionModel::getRange(QMap<QString,PhoneDirectoryModel::NumberWra
}
while ((iEnd).key().left(prefixLen) == pref && iEnd+1 != map.end()) {
iEnd++;
++iEnd;
}
endOk = (iEnd.key().left(prefixLen) == pref);
......@@ -245,7 +245,7 @@ void NumberCompletionModel::getRange(QMap<QString,PhoneDirectoryModel::NumberWra
}
while (iBeg.key().left(prefixLen) != pref && iBeg != iEnd)
iBeg++;
++iBeg;
if (iEnd == iBeg && iBeg.key().left(prefixLen) != pref) {
iEnd = map.end();
......@@ -257,7 +257,7 @@ void NumberCompletionModel::getRange(QMap<QString,PhoneDirectoryModel::NumberWra
set << n;
}
}
iBeg++;
++iBeg;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment