Skip to content

Commit a8fa59e

Browse files
committed
save and load quiet setting. Try to work with older version of settings that didn't use the quiet setting and instead changed the notify time value.
1 parent affb932 commit a8fa59e

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/trayitem.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,11 @@ void TrayItem::updateTitle()
433433
QString title = XLibUtil::getWindowTitle(m_window);
434434

435435
setToolTip(QString("%1 [%2]").arg(title).arg(m_dockedAppName));
436-
if (!m_settings.getQuiet() && m_settings.getNotifyTime() > 0)
437-
showMessage(m_dockedAppName, title, QSystemTrayIcon::Information, m_settings.getNotifyTime());
436+
if (!m_settings.getQuiet()) {
437+
// Using nonZeroBalloonTimeout because previous versions of KDocker settings would't
438+
// use Quiet as a separate value and instead would set the time to 0.
439+
showMessage(m_dockedAppName, title, QSystemTrayIcon::Information, m_settings.nonZeroBalloonTimeout());
440+
}
438441

439442
if (m_iconified && !m_attentionIcon.isNull() && !m_wantsAttention) {
440443
m_wantsAttention = true;

src/trayitemoptions.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,6 @@ bool TrayItemOptions::getIconifyObscured() const
287287

288288
int TrayItemOptions::getNotifyTime() const
289289
{
290-
if (m_quiet == TrayItemOptions::TriState::SetTrue)
291-
return 0;
292290
return m_notifyTime;
293291
}
294292

src/trayitemsettings.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ void TrayItemSettings::loadSettingsSection()
8181
if (val.isValid())
8282
setAttentionIconPath(val.toString());
8383

84+
val = m_settings.value("Quiet");
85+
if (val.isValid())
86+
setQuiet(val.toBool());
87+
8488
val = m_settings.value("BalloonTimeout");
8589
if (val.isValid())
8690
setNotifyTime(val.toInt());
@@ -183,6 +187,7 @@ void TrayItemSettings::loadSettingsOptions(const TrayItemOptions &options)
183187
void TrayItemSettings::saveSettingsSection()
184188
{
185189
// Group is set by caller
190+
m_settings.setValue("Quiet", getQuiet());
186191
m_settings.setValue("BalloonTimeout", getNotifyTime());
187192
m_settings.setValue("Sticky", getSticky());
188193
m_settings.setValue("SkipPager", getSkipPager());

0 commit comments

Comments
 (0)