fix: no escribia las notificaciones con la primera cadena vacía
This commit is contained in:
@@ -150,12 +150,6 @@ void Notify::clearFinishedNotifications()
|
|||||||
// Muestra una notificación de texto por pantalla;
|
// Muestra una notificación de texto por pantalla;
|
||||||
void Notify::showText(std::string text1, std::string text2, int icon)
|
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
|
// Cuenta el número de textos a mostrar
|
||||||
int numTexts = 0;
|
int numTexts = 0;
|
||||||
if (text1 != "")
|
if (text1 != "")
|
||||||
@@ -163,6 +157,18 @@ void Notify::showText(std::string text1, std::string text2, int icon)
|
|||||||
if (text2 != "")
|
if (text2 != "")
|
||||||
numTexts++;
|
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
|
// Si las notificaciones no se apilan, elimina las anteriores
|
||||||
if (!stack)
|
if (!stack)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user