Commit b162ec41 authored by Pekka Vuorela's avatar Pekka Vuorela

Merge pull request #43 from pvuorela/master

Emit profile change signal directly on setter
parents 8e98f8c8 10a8d5ac
...@@ -120,6 +120,7 @@ void ProfileControl::setProfile(const QString &profile) ...@@ -120,6 +120,7 @@ void ProfileControl::setProfile(const QString &profile)
{ {
if (profile != m_profile) { if (profile != m_profile) {
m_profile = profile; m_profile = profile;
emit profileChanged(profile);
profile_set_profile(profile.toUtf8().constData()); profile_set_profile(profile.toUtf8().constData());
} }
} }
...@@ -523,8 +524,10 @@ void ProfileControl::setClockAlarmToneEnabled(bool enabled) ...@@ -523,8 +524,10 @@ void ProfileControl::setClockAlarmToneEnabled(bool enabled)
void ProfileControl::currentProfileChangedCallback(const char *name, ProfileControl *profileControl) void ProfileControl::currentProfileChangedCallback(const char *name, ProfileControl *profileControl)
{ {
QString newProfile = QString::fromUtf8(name); QString newProfile = QString::fromUtf8(name);
profileControl->m_profile = newProfile; if (profileControl->m_profile != newProfile) {
emit profileControl->profileChanged(newProfile); profileControl->m_profile = newProfile;
emit profileControl->profileChanged(newProfile);
}
} }
void ProfileControl::updateStateCallBack(const char *profile, const char *key, const char *val, const char *type) void ProfileControl::updateStateCallBack(const char *profile, const char *key, const char *val, const char *type)
......
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