Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Emit profile change signal directly on setter
  • Loading branch information
pvuorela committed Oct 15, 2015
1 parent 8e98f8c commit 10a8d5a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/profilecontrol.cpp
Expand Up @@ -120,6 +120,7 @@ void ProfileControl::setProfile(const QString &profile)
{
if (profile != m_profile) {
m_profile = profile;
emit profileChanged(profile);
profile_set_profile(profile.toUtf8().constData());
}
}
Expand Down Expand Up @@ -523,8 +524,10 @@ void ProfileControl::setClockAlarmToneEnabled(bool enabled)
void ProfileControl::currentProfileChangedCallback(const char *name, ProfileControl *profileControl)
{
QString newProfile = QString::fromUtf8(name);
profileControl->m_profile = newProfile;
emit profileControl->profileChanged(newProfile);
if (profileControl->m_profile != newProfile) {
profileControl->m_profile = newProfile;
emit profileControl->profileChanged(newProfile);
}
}

void ProfileControl::updateStateCallBack(const char *profile, const char *key, const char *val, const char *type)
Expand Down

0 comments on commit 10a8d5a

Please sign in to comment.