mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 02:42:50 +00:00
kcontrol: do not update the time while text is selected in clock KCM
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
8a124d6491
commit
569b6d8ebb
1 changed files with 8 additions and 3 deletions
|
@ -289,9 +289,14 @@ void KCMClock::slotUpdate()
|
||||||
{
|
{
|
||||||
const QDateTime now = QDateTime::currentDateTime();
|
const QDateTime now = QDateTime::currentDateTime();
|
||||||
if (!m_timechanged) {
|
if (!m_timechanged) {
|
||||||
m_timeedit->blockSignals(true);
|
// do not update while text has been selected otherwise selection changes, the value will
|
||||||
m_timeedit->setTime(now.time());
|
// be updated once selection is cleared
|
||||||
m_timeedit->blockSignals(false);
|
QLineEdit* timeeditlineedit = m_timeedit->findChild<QLineEdit*>();
|
||||||
|
if (!timeeditlineedit || !timeeditlineedit->hasSelectedText()) {
|
||||||
|
m_timeedit->blockSignals(true);
|
||||||
|
m_timeedit->setTime(now.time());
|
||||||
|
m_timeedit->blockSignals(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!m_datechanged) {
|
if (!m_datechanged) {
|
||||||
m_dateedit->blockSignals(true);
|
m_dateedit->blockSignals(true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue