FancyLineEdit: Don't save empty item in history on destruction

This would save an empty item in the history at shutdown, even if the
user didn't do anything at all.

Task-number: QTCREATORBUG-24762
Change-Id: I963e47e0d6e0ed17687ce8f887e3e240afb9e45f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Eike Ziller
2021-02-15 15:43:28 +01:00
parent 502508d87d
commit 02e34e5760

View File

@@ -213,6 +213,7 @@ FancyLineEdit::~FancyLineEdit()
// the QueuedConnection don't have enough time to call slot callback // the QueuedConnection don't have enough time to call slot callback
// because edit widget and all of its connections are destroyed before // because edit widget and all of its connections are destroyed before
// QCoreApplicationPrivate::sendPostedEvents dispatch our queued signal. // QCoreApplicationPrivate::sendPostedEvents dispatch our queued signal.
if (!text().isEmpty())
d->m_historyCompleter->addEntry(text()); d->m_historyCompleter->addEntry(text());
} }
} }