From b6c5d06246636269e63c53b0f12608ca93f6000b Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sun, 15 Sep 2024 17:40:39 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20no=20escribia=20las=20notificaciones=20c?= =?UTF-8?q?on=20la=20primera=20cadena=20vac=C3=ADa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/common/notify.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/source/common/notify.cpp b/source/common/notify.cpp index 6063fca..c44aa8f 100644 --- a/source/common/notify.cpp +++ b/source/common/notify.cpp @@ -150,12 +150,6 @@ void Notify::clearFinishedNotifications() // Muestra una notificación de texto por pantalla; void Notify::showText(std::string text1, std::string text2, int icon) { - // Si no hay texto, acaba - if (text1 == "" && text2 == "") - { - return; - } - // Cuenta el número de textos a mostrar int numTexts = 0; if (text1 != "") @@ -163,6 +157,18 @@ void Notify::showText(std::string text1, std::string text2, int icon) if (text2 != "") numTexts++; + // Si no hay texto, acaba + if (numTexts == 0) + { + return; + } + // Si solo hay un texto, lo coloca en la primera variable + else if (numTexts == 1) + { + text1 = text1 + text2; + text2 = ""; + } + // Si las notificaciones no se apilan, elimina las anteriores if (!stack) {