nctree: drop bchannels from options

This commit is contained in:
nick black 2021-02-24 23:33:53 -05:00
parent 7c40f40ba2
commit aa4da3f335
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
5 changed files with 0 additions and 12 deletions

View File

@ -23,7 +23,6 @@ typedef struct nctree_item {
typedef struct nctree_options {
const nctree_item* items; // top-level nctree_item array
unsigned count; // size of |items|
uint64_t bchannels; // base channels
int (*nctreecb)(struct ncplane*, void*, int); // item callback
int indentcols; // columns to indent per hierarchy
uint64_t flags; // bitfield of NCTREE_OPTION_*

View File

@ -3014,7 +3014,6 @@ typedef struct nctree_item {
typedef struct nctree_options {
const nctree_item* items; // top-level nctree_item array
unsigned count; // size of |items|
uint64_t bchannels; // base channels
int (*nctreecb)(struct ncplane*, void*, int); // item callback function
int indentcols; // columns to indent per level of hierarchy
uint64_t flags; // bitfield of NCTREE_OPTION_*

View File

@ -90,7 +90,6 @@ static nctree*
nctree_inner_create(ncplane* n, const struct nctree_options* opts){
nctree* ret = malloc(sizeof(*ret));
if(ret){
ret->bchannels = opts->bchannels;
ret->cbfxn = opts->nctreecb;
ret->indentcols = opts->indentcols;
ret->maxdepth = 0;
@ -104,7 +103,6 @@ nctree_inner_create(ncplane* n, const struct nctree_options* opts){
free(ret);
return NULL;
}
ncplane_set_base(n, " ", 0, opts->bchannels);
ret->items.ncp = n;
ret->items.curry = NULL;
nctree_redraw(ret);

View File

@ -415,7 +415,6 @@ create_tree(struct notcurses* nc){
.count = 1,
.nctreecb = callback,
.indentcols = 2,
.bchannels = 0,
.flags = 0,
};
struct nctree* tree = nctree_create(notcurses_stdplane(nc), &topts);

View File

@ -21,7 +21,6 @@ TEST_CASE("Tree") {
struct nctree_options opts = {
.items = nullptr,
.count = 2,
.bchannels = 0,
.nctreecb = treecb,
.indentcols = 0,
.flags = 0,
@ -35,7 +34,6 @@ TEST_CASE("Tree") {
struct nctree_options opts = {
.items = {},
.count = 0,
.bchannels = 0,
.nctreecb = treecb,
.indentcols = 1,
.flags = 0,
@ -73,7 +71,6 @@ TEST_CASE("Tree") {
struct nctree_options opts = {
.items = items,
.count = sizeof(items) / sizeof(*items),
.bchannels = 0,
.nctreecb = nullptr,
.indentcols = 1,
.flags = 0,
@ -87,7 +84,6 @@ TEST_CASE("Tree") {
struct nctree_options opts = {
.items = items,
.count = sizeof(items) / sizeof(*items),
.bchannels = 0,
.nctreecb = treecb,
.indentcols = -1,
.flags = 0,
@ -100,7 +96,6 @@ TEST_CASE("Tree") {
struct nctree_options opts = {
.items = items,
.count = sizeof(items) / sizeof(*items),
.bchannels = 0,
.nctreecb = treecb,
.indentcols = 1,
.flags = 0,
@ -123,7 +118,6 @@ TEST_CASE("Tree") {
struct nctree_options opts = {
.items = items,
.count = sizeof(items) / sizeof(*items),
.bchannels = 0,
.nctreecb = treecb,
.indentcols = 2,
.flags = 0,
@ -533,7 +527,6 @@ SUBCASE("TraverseLongList") {
struct nctree_options topts = {
.items = &rads,
.count = 1,
.bchannels = 0,
.nctreecb = treecb,
.indentcols = 2,
.flags = 0,