From 84ce33784284d5acbebd87e5d6784323bb01c506 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 14 Sep 2024 22:51:07 +0200 Subject: [PATCH] screen_status: remove obsolete library --- meson.build | 1 - src/ChatPage.cxx | 1 - src/FileBrowserPage.cxx | 1 - src/LyricsPage.cxx | 1 - src/QueuePage.cxx | 1 - src/save_playlist.cxx | 3 ++- src/screen_status.cxx | 50 ----------------------------------------- src/screen_status.hxx | 37 ------------------------------ 8 files changed, 2 insertions(+), 93 deletions(-) delete mode 100644 src/screen_status.cxx delete mode 100644 src/screen_status.hxx diff --git a/meson.build b/meson.build index f509d907..61187a40 100644 --- a/meson.build +++ b/meson.build @@ -398,7 +398,6 @@ ncmpc = executable('ncmpc', 'src/screen_init.cxx', 'src/screen_paint.cxx', 'src/screen_utils.cxx', - 'src/screen_status.cxx', 'src/screen_list.cxx', 'src/screen_client.cxx', 'src/QueuePage.cxx', diff --git a/src/ChatPage.cxx b/src/ChatPage.cxx index 19580dc6..6b1a1587 100644 --- a/src/ChatPage.cxx +++ b/src/ChatPage.cxx @@ -4,7 +4,6 @@ #include "ChatPage.hxx" #include "PageMeta.hxx" #include "screen.hxx" -#include "screen_status.hxx" #include "i18n.h" #include "charset.hxx" #include "Command.hxx" diff --git a/src/FileBrowserPage.cxx b/src/FileBrowserPage.cxx index 37653aca..9a7a22a7 100644 --- a/src/FileBrowserPage.cxx +++ b/src/FileBrowserPage.cxx @@ -4,7 +4,6 @@ #include "FileBrowserPage.hxx" #include "PageMeta.hxx" #include "FileListPage.hxx" -#include "screen_status.hxx" #include "save_playlist.hxx" #include "screen.hxx" #include "config.h" // IWYU pragma: keep diff --git a/src/LyricsPage.cxx b/src/LyricsPage.cxx index 13792081..ef948162 100644 --- a/src/LyricsPage.cxx +++ b/src/LyricsPage.cxx @@ -5,7 +5,6 @@ #include "LyricsCache.hxx" #include "LyricsLoader.hxx" #include "PageMeta.hxx" -#include "screen_status.hxx" #include "i18n.h" #include "Command.hxx" #include "Options.hxx" diff --git a/src/QueuePage.cxx b/src/QueuePage.cxx index e72f63da..1954ca00 100644 --- a/src/QueuePage.cxx +++ b/src/QueuePage.cxx @@ -3,7 +3,6 @@ #include "QueuePage.hxx" #include "PageMeta.hxx" -#include "screen_status.hxx" #include "save_playlist.hxx" #include "config.h" #include "i18n.h" diff --git a/src/save_playlist.cxx b/src/save_playlist.cxx index f9f46f31..668564d0 100644 --- a/src/save_playlist.cxx +++ b/src/save_playlist.cxx @@ -3,7 +3,6 @@ #include "save_playlist.hxx" #include "db_completion.hxx" -#include "screen_status.hxx" #include "config.h" // IWYU pragma: keep #include "i18n.h" #include "charset.hxx" @@ -17,6 +16,8 @@ #include +#include + #include #ifndef NCMPC_MINI diff --git a/src/screen_status.cxx b/src/screen_status.cxx deleted file mode 100644 index a82ca14e..00000000 --- a/src/screen_status.cxx +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -// Copyright The Music Player Daemon Project - -#include "screen_status.hxx" -#include "screen.hxx" -#include "ncmpc.hxx" -#include "util/Exception.hxx" - -#include - -void -screen_status_message(std::string &&msg) noexcept -{ - screen->status_bar.SetMessage(std::move(msg)); -} - -void -screen_status_message(std::string_view msg) noexcept -{ - screen_status_message(std::string{msg}); -} - -void -screen_status_message(const char *msg) noexcept -{ - screen_status_message(std::string{msg}); -} - -void -screen_status_vfmt(fmt::string_view format_str, fmt::format_args args) noexcept -{ - screen_status_message(fmt::vformat(format_str, std::move(args))); -} - -void -screen_status_printf(const char *format, ...) noexcept -{ - va_list ap; - va_start(ap,format); - char msg[256]; - vsnprintf(msg, sizeof(msg), format, ap); - va_end(ap); - screen_status_message(msg); -} - -void -screen_status_error(std::exception_ptr e) noexcept -{ - screen_status_message(GetFullMessage(std::move(e))); -} diff --git a/src/screen_status.hxx b/src/screen_status.hxx deleted file mode 100644 index ea2a2059..00000000 --- a/src/screen_status.hxx +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -// Copyright The Music Player Daemon Project - -#pragma once - -#include - -#include -#include - -void -screen_status_message(const char *msg) noexcept; - -void -screen_status_message(std::string_view msg) noexcept; - -void -screen_status_message(std::string &&msg) noexcept; - -void -screen_status_vfmt(fmt::string_view format_str, fmt::format_args args) noexcept; - -template -inline void -screen_status_fmt(const S &format_str, Args&&... args) noexcept -{ - screen_status_vfmt(format_str, fmt::make_format_args(args...)); -} - -#ifdef __GNUC__ -__attribute__((format(printf, 1, 2))) -#endif -void -screen_status_printf(const char *format, ...) noexcept; - -void -screen_status_error(std::exception_ptr e) noexcept;