Commit eeaa6b35 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Don't insert variable when it's empty

parent 43c440ba
......@@ -38,7 +38,10 @@ void QuickTextMenu::initializeMenu()
mMenu = new MessageComposer::ConvertSnippetVariableMenu(false, mParentWidget, this);
connect(mMenu, &MessageComposer::ConvertSnippetVariableMenu::insertVariable, this, [this](MessageComposer::ConvertSnippetVariablesUtil::VariableType type) {
Q_EMIT insertText(mComposerInterface->convertVariable(type) + QLatin1Char(' '));
const QString valueStr = mComposerInterface->convertVariable(type);
if (!valueStr.isEmpty()) {
Q_EMIT insertText(valueStr + QLatin1Char(' '));
}
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment