diff --git a/src/gui/Clipboard.cpp b/src/gui/Clipboard.cpp index ae5d8290f..ddd07f29f 100644 --- a/src/gui/Clipboard.cpp +++ b/src/gui/Clipboard.cpp @@ -67,11 +67,13 @@ void Clipboard::setText(const QString& text, bool clear) } #endif - if (clear && config()->get(Config::Security_ClearClipboard).toBool()) { - int timeout = config()->get(Config::Security_ClearClipboardTimeout).toInt(); - if (timeout > 0) { - m_lastCopied = text; - m_timer->start(timeout * 1000); + if (clear) { + m_lastCopied = text; + if (config()->get(Config::Security_ClearClipboard).toBool()) { + int timeout = config()->get(Config::Security_ClearClipboardTimeout).toInt(); + if (timeout > 0) { + m_timer->start(timeout * 1000); + } } } } @@ -80,8 +82,9 @@ void Clipboard::clearCopiedText() { if (m_timer->isActive()) { m_timer->stop(); - clearClipboard(); } + + clearClipboard(); } void Clipboard::clearClipboard()