Commit f3829b88 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Merge remote-tracking branch 'origin/Applications/18.08'

parents bd315fc2 48fd7b2c
cmake_minimum_required(VERSION 3.0)
set(PIM_VERSION "5.9.40")
set(PIM_VERSION "5.9.41")
project(KIdentityManagement VERSION ${PIM_VERSION})
......
......@@ -115,8 +115,16 @@ void IdentityCombo::setCurrentIdentity(const Identity &identity)
void IdentityCombo::setCurrentIdentity(const QString &name)
{
int idx = d->mIdentityManager->identities().indexOf(name);
if ((idx < 0) || (idx == currentIndex())) {
if (name.isEmpty()) {
return;
}
const int idx = d->mIdentityManager->identities().indexOf(name);
if (idx < 0) {
Q_EMIT invalidIdentity();
return;
}
if (idx == currentIndex()) {
return;
}
......@@ -129,8 +137,15 @@ void IdentityCombo::setCurrentIdentity(const QString &name)
void IdentityCombo::setCurrentIdentity(uint uoid)
{
int idx = d->mUoidList.indexOf(uoid);
if ((idx < 0) || (idx == currentIndex())) {
if (uoid == 0) {
return;
}
const int idx = d->mUoidList.indexOf(uoid);
if (idx < 0) {
Q_EMIT invalidIdentity();
return;
}
if (idx == currentIndex()) {
return;
}
......
......@@ -68,6 +68,7 @@ Q_SIGNALS:
*/
void identityChanged(uint uoid);
void identityDeleted(uint uoid);
void invalidIdentity();
public Q_SLOTS:
/**
......
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