]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Make tui_win_info::name pure virtual
authorTom Tromey <tom@tromey.com>
Thu, 2 Jul 2020 03:21:12 +0000 (21:21 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 2 Jul 2020 03:21:17 +0000 (21:21 -0600)
It seemed cleaner to me for tui_win_info::name to be pure virtual.
This meant adding a name method to the locator window; but this too
seems like an improvement.

gdb/ChangeLog
2020-07-01  Tom Tromey  <tom@tromey.com>

* tui/tui-data.h (struct tui_win_info) <name>: Now pure virtual.
* tui/tui-stack.h (struct tui_locator_window) <name>: New method.

gdb/ChangeLog
gdb/tui/tui-data.h
gdb/tui/tui-stack.h

index ec87edf13fc5db5a6d5d1f20c216ea6072378f65..662e6b9ad1dfb3375ebbf22884fdc0054ab503a5 100644 (file)
@@ -1,3 +1,8 @@
+2020-07-01  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-data.h (struct tui_win_info) <name>: Now pure virtual.
+       * tui/tui-stack.h (struct tui_locator_window) <name>: New method.
+
 2020-07-01  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-wingeneral.c (tui_win_info::refresh_window): Move from
index 3c14b2654eef34c4d83ad296a5cf7ce3d3e9bbe7..5e7a12293c9a2d8ce42a378346140dcc2759d1ec 100644 (file)
@@ -62,10 +62,7 @@ public:
   virtual void make_visible (bool visible);
 
   /* Return the name of this type of window.  */
-  virtual const char *name () const
-  {
-    return "";
-  }
+  virtual const char *name () const = 0;
 
   /* Compute the maximum height of this window.  */
   virtual int max_height () const;
index 564ac22495c124fb28a528b5afd10ec7e20e0995..9ff57b1ba73e4e07607edc39c57c9c8544cb77fa 100644 (file)
@@ -32,6 +32,11 @@ struct tui_locator_window : public tui_win_info
 {
   tui_locator_window () = default;
 
+  const char *name () const override
+  {
+    return STATUS_NAME;
+  }
+
   int max_height () const override
   {
     return 1;