All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 1/2] shell: Make bt_shell_add_submenu set main menu if none has been set
Date: Mon, 28 Mar 2022 14:25:17 -0700	[thread overview]
Message-ID: <20220328212518.1890451-1-luiz.dentz@gmail.com> (raw)

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If not main menu has been set when calling bt_shell_add_submenu then
turns it on it main menu.
---
 src/shared/shell.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 0d82bc282..7ba264b99 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -1248,6 +1248,9 @@ bool bt_shell_add_submenu(const struct bt_shell_menu *menu)
 	if (!menu)
 		return false;
 
+	if (!data.main)
+		return bt_shell_set_menu(menu);
+
 	if (!data.submenus)
 		data.submenus = queue_new();
 
-- 
2.35.1


             reply	other threads:[~2022-03-28 21:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 21:25 Luiz Augusto von Dentz [this message]
2022-03-28 21:25 ` [PATCH BlueZ 2/2] client: Add support for player submenu Luiz Augusto von Dentz
2022-03-28 23:58 ` [BlueZ,1/2] shell: Make bt_shell_add_submenu set main menu if none has been set bluez.test.bot
2022-03-30 20:00 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220328212518.1890451-1-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.