SilverSearcher: Fix widget construction if not available

Setting a layout on a widget only works after the old layout
has been destroyed. Otherwise it just refuses and prints out
a warning on the cmdline which in turn results in not
displaying the failure inside the UI and keeping the line
edit for the optional search options.

Change-Id: Id4ff4679d67b625a7248569f6debf1912dc5bcf0
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
This commit is contained in:
Christian Stenger
2019-02-26 15:05:18 +01:00
parent b26febac83
commit 728ad535bc

View File

@@ -176,8 +176,6 @@ FindInFilesSilverSearcher::FindInFilesSilverSearcher(QObject *parent)
setEnabled(isSilverSearcherAvailable()); setEnabled(isSilverSearcherAvailable());
if (!isEnabled()) { if (!isEnabled()) {
auto layout = new QHBoxLayout(m_widget);
layout->setMargin(0);
QLabel *label = new QLabel(tr("Silver Searcher is not available on the system.")); QLabel *label = new QLabel(tr("Silver Searcher is not available on the system."));
label->setStyleSheet("QLabel { color : red; }"); label->setStyleSheet("QLabel { color : red; }");
layout->addWidget(label); layout->addWidget(label);