options: rename to struct Options
authorMax Kellermann <max@musicpd.org>
Tue, 18 Sep 2018 16:43:45 +0000 (18:43 +0200)
committerMax Kellermann <max@musicpd.org>
Tue, 18 Sep 2018 16:43:45 +0000 (18:43 +0200)
27 files changed:
meson.build
src/ChatPage.cxx
src/FileBrowserPage.cxx
src/FileListPage.cxx
src/ListWindow.cxx
src/LyricsPage.cxx
src/Main.cxx
src/Options.cxx [moved from src/options.cxx with 99% similarity]
src/Options.hxx [moved from src/options.hxx with 93% similarity]
src/ProgressBar.cxx
src/QueuePage.cxx
src/SearchPage.cxx
src/StatusBar.cxx
src/Styles.cxx
src/TitleBar.cxx
src/conf.cxx
src/ncu.cxx
src/paint.hxx
src/player_command.cxx
src/screen.cxx
src/screen_artist.cxx
src/screen_find.cxx
src/screen_init.cxx
src/screen_keydef.cxx
src/screen_paint.cxx
src/screen_utils.cxx
src/xterm_title.cxx

index f1f1098..5a47b6e 100644 (file)
@@ -328,7 +328,7 @@ ncmpc = executable('ncmpc',
   'src/callbacks.cxx',
   'src/Queue.cxx',
   'src/filelist.cxx',
-  'src/options.cxx',
+  'src/Options.cxx',
   'src/Command.cxx',
   'src/Bindings.cxx',
   'src/GlobalBindings.cxx',
index 6b053ca..c853667 100644 (file)
@@ -25,7 +25,7 @@
 #include "mpdclient.hxx"
 #include "i18n.h"
 #include "charset.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 
 #include <mpd/idle.h>
 
index 675f211..42e5908 100644 (file)
@@ -30,7 +30,7 @@
 #include "filelist.hxx"
 #include "screen_utils.hxx"
 #include "screen_client.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 
 #include <mpd/client.h>
 
index 42c2e84..841ed54 100644 (file)
@@ -27,7 +27,7 @@
 #include "screen_find.hxx"
 #include "screen.hxx"
 #include "i18n.h"
-#include "options.hxx"
+#include "Options.hxx"
 #include "charset.hxx"
 #include "strfsong.hxx"
 #include "mpdclient.hxx"
index b9312b9..3f7c8b8 100644 (file)
@@ -21,7 +21,7 @@
 #include "ListRenderer.hxx"
 #include "ListText.hxx"
 #include "config.h"
-#include "options.hxx"
+#include "Options.hxx"
 #include "charset.hxx"
 #include "match.hxx"
 #include "Command.hxx"
index e470273..1d36ecf 100644 (file)
@@ -24,7 +24,7 @@
 #include "SongPage.hxx"
 #include "Event.hxx"
 #include "i18n.h"
-#include "options.hxx"
+#include "Options.hxx"
 #include "mpdclient.hxx"
 #include "screen.hxx"
 #include "lyrics.hxx"
index 90b22fb..cb2fe15 100644 (file)
@@ -22,7 +22,7 @@
 #include "mpdclient.hxx"
 #include "callbacks.hxx"
 #include "charset.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 #include "Command.hxx"
 #include "Bindings.hxx"
 #include "GlobalBindings.hxx"
similarity index 99%
rename from src/options.cxx
rename to src/Options.cxx
index 0f66729..d7170e6 100644 (file)
@@ -17,7 +17,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "options.hxx"
+#include "Options.hxx"
 #include "Bindings.hxx"
 #include "GlobalBindings.hxx"
 #include "config.h"
@@ -45,8 +45,7 @@ typedef struct {
 
 typedef void (*option_callback_fn_t)(int c, const char *arg);
 
-
-options_t options;
+Options options;
 
 static const arg_opt_t option_table[] = {
        { '?', "help", nullptr, "Show this help message" },
similarity index 93%
rename from src/options.hxx
rename to src/Options.hxx
index 5f6ce77..4be7c98 100644 (file)
@@ -17,8 +17,8 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#ifndef OPTIONS_H
-#define OPTIONS_H
+#ifndef OPTIONS_HXX
+#define OPTIONS_HXX
 
 #include "config.h"
 #include "defaults.hxx"
@@ -27,7 +27,7 @@
 #include <string>
 #include <chrono>
 
-typedef struct {
+struct Options {
        std::string host;
        std::string password;
        std::string config_file;
@@ -78,16 +78,18 @@ typedef struct {
 #ifdef HAVE_GETMOUSE
        bool enable_mouse;
 #endif
-#ifndef NCMPC_MINI
+#ifdef NCMPC_MINI
+       static constexpr bool jump_prefix_only = true;
+#else
        bool scroll = DEFAULT_SCROLL;
        bool visible_bitrate;
        bool welcome_screen_list = true;
        bool jump_prefix_only = true;
        bool second_column = true;
 #endif
-} options_t;
+};
 
-extern options_t options;
+extern Options options;
 
 void options_parse(int argc, const char **argv);
 
index 28cab86..0fd3af2 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "ProgressBar.hxx"
 #include "Styles.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 
 #include <assert.h>
 
index a5292af..5be84e8 100644 (file)
@@ -30,7 +30,7 @@
 #include "Event.hxx"
 #include "i18n.h"
 #include "charset.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 #include "mpdclient.hxx"
 #include "strfsong.hxx"
 #include "Completion.hxx"
index 61008fa..13c53e2 100644 (file)
@@ -22,7 +22,7 @@
 #include "screen_status.hxx"
 #include "TextListRenderer.hxx"
 #include "i18n.h"
-#include "options.hxx"
+#include "Options.hxx"
 #include "Bindings.hxx"
 #include "GlobalBindings.hxx"
 #include "charset.hxx"
index 302a5ee..61e0215 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "StatusBar.hxx"
 #include "Event.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 #include "Styles.hxx"
 #include "i18n.h"
 #include "strfsong.hxx"
index 3ddb849..0de17be 100644 (file)
@@ -23,7 +23,7 @@
 #include "i18n.h"
 
 #ifdef ENABLE_COLORS
-#include "options.hxx"
+#include "Options.hxx"
 #endif
 
 #include <assert.h>
index 7da7215..c8496fc 100644 (file)
@@ -20,7 +20,7 @@
 #include "TitleBar.hxx"
 #include "TabBar.hxx"
 #include "Styles.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 #include "i18n.h"
 #include "util/StringUTF8.hxx"
 
index 8d5d62c..371bf79 100644 (file)
@@ -28,7 +28,7 @@
 #include "BasicColors.hxx"
 #include "CustomColors.hxx"
 #include "screen_list.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 #include "io/Path.hxx"
 #include "util/CharUtil.hxx"
 #include "util/ScopeExit.hxx"
index 906541d..59e1e98 100644 (file)
@@ -26,7 +26,7 @@
 #endif
 
 #ifdef HAVE_GETMOUSE
-#include "options.hxx"
+#include "Options.hxx"
 #endif
 
 static SCREEN *ncu_screen;
index b274222..093bf4b 100644 (file)
@@ -21,7 +21,7 @@
 #define NCMPC_PAINT_H
 
 #include "Styles.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 
 /**
  * Sets the specified color, and enables "reverse" mode if selected is
index 611259c..83476bd 100644 (file)
@@ -20,7 +20,7 @@
 #include "player_command.hxx"
 #include "Command.hxx"
 #include "mpdclient.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 #include "i18n.h"
 #include "screen_client.hxx"
 #include "screen_status.hxx"
index 1c8f80d..5a4626d 100644 (file)
@@ -27,7 +27,7 @@
 #include "i18n.h"
 #include "charset.hxx"
 #include "mpdclient.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 #include "player_command.hxx"
 #include "SongPage.hxx"
 #include "LyricsPage.hxx"
index 95e3ff0..7c6e9c2 100644 (file)
@@ -31,7 +31,7 @@
 #include "charset.hxx"
 #include "mpdclient.hxx"
 #include "filelist.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 #include "util/NulledString.hxx"
 
 #include <vector>
index fbe0d96..78a28ad 100644 (file)
@@ -24,7 +24,7 @@
 #include "ListWindow.hxx"
 #include "keyboard.hxx"
 #include "i18n.h"
-#include "options.hxx"
+#include "Options.hxx"
 
 #include <glib.h>
 
index bb7ca2b..b34f66b 100644 (file)
@@ -23,7 +23,7 @@
 #include "QueuePage.hxx"
 #include "config.h"
 #include "i18n.h"
-#include "options.hxx"
+#include "Options.hxx"
 #include "Styles.hxx"
 #include "Event.hxx"
 
index 7ed8f11..f0000c4 100644 (file)
@@ -32,7 +32,7 @@
 #include "Bindings.hxx"
 #include "GlobalBindings.hxx"
 #include "screen_utils.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 #include "util/Compiler.h"
 
 #include <algorithm>
index e860289..3a9a537 100644 (file)
@@ -21,7 +21,7 @@
 #include "Page.hxx"
 #include "config.h"
 #include "mpdclient.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 #include "player_command.hxx"
 
 #include <mpd/client.h>
index 2ca2e43..6046108 100644 (file)
@@ -22,7 +22,7 @@
 #include "mpdclient.hxx"
 #include "config.h"
 #include "i18n.h"
-#include "options.hxx"
+#include "Options.hxx"
 #include "Styles.hxx"
 #include "wreadln.hxx"
 #include "ncmpc.hxx"
index dd08f61..ebfa62a 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #include "xterm_title.hxx"
-#include "options.hxx"
+#include "Options.hxx"
 
 #include <stdio.h>
 #include <stdlib.h>