From 9fa8313413fe03c16f833f7526c6b8e273f2d611 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Fri, 17 Oct 2025 17:29:25 +0200 Subject: [PATCH] remove scan source from handler scan status --- src/kds_s2000w_handler.c | 1 - src/kds_s2000w_handler.h | 1 - src/kds_s2000w_handler_opts.c | 28 ---------------------------- tests/kds_s2000w_net_get_opt_tests.c | 1 - tests/kds_s2000w_net_tests.c | 1 - 5 files changed, 32 deletions(-) diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index 173d7c6..04b30be 100644 --- a/src/kds_s2000w_handler.c +++ b/src/kds_s2000w_handler.c @@ -112,7 +112,6 @@ handler* kds_s2000w_handler_init() h->current_scan_status->available_images = 0; h->current_scan_status->downloaded_images = 0; h->current_scan_status->complete_scanned = false; - h->current_scan_status->feeder = DocumentFeeder; h->read_info->scan_started = false; h->read_info->cancel = false; h->read_info->read_size = 0; diff --git a/src/kds_s2000w_handler.h b/src/kds_s2000w_handler.h index 841787e..db676bc 100644 --- a/src/kds_s2000w_handler.h +++ b/src/kds_s2000w_handler.h @@ -47,7 +47,6 @@ typedef struct { uint8_t available_images; uint8_t downloaded_images; bool complete_scanned; - uint8_t feeder; } scanstatus; typedef struct { diff --git a/src/kds_s2000w_handler_opts.c b/src/kds_s2000w_handler_opts.c index 8e2244b..5e26194 100644 --- a/src/kds_s2000w_handler_opts.c +++ b/src/kds_s2000w_handler_opts.c @@ -59,19 +59,6 @@ void _kds_s2000w_handler_opts_load_options(handler* h) resp = NULL; } -void _kds_s2000w_handler_opts_set_scan_source(const option_descriptor* descriptor, handler* h, const char* value) -{ - if (strcmp(descriptor->config_name, SCAN_SOURCE) != 0) - return; - - if (strcmp(value, "Flatbed") == 0) - h->current_scan_status->feeder = Flatbed; - if (strcmp(value, "DocumentFeeder") == 0) - h->current_scan_status->feeder = DocumentFeeder; - if (strcmp(value, "Automatic") == 0) - h->current_scan_status->feeder = Automatic; -} - void _kds_s2000w_handler_opts_set_autostart_on(json_object* config) { uint32_t auto_start_value = AUTOSTART_ON; @@ -463,20 +450,6 @@ void kds_s2000w_handler_opts_get_option(handler* h, uint32_t option, void* value } json_object* value_object = json_object_object_get(config, descriptor->config_name); - if (strcmp(descriptor->config_name, SCAN_SOURCE) == 0) { - _kds_s2000w_handler_opts_write_value(value_object, descriptor->descriptor->type, value); - - if (strcmp(value, "Flatbed") == 0) - h->current_scan_status->feeder = Flatbed; - - if (strcmp(value, "DocumentFeeder") == 0) - h->current_scan_status->feeder = DocumentFeeder; - - if (strcmp(value, "Automatic") == 0) - h->current_scan_status->feeder = Automatic; - - return; - } if (strcmp(descriptor->config_name, IMAGE_OFFSET_X) == 0) { int32_t* int_value = (int32_t*) value; @@ -542,7 +515,6 @@ void kds_s2000w_handler_opts_set_option(handler* h, uint32_t option, void* value && strcmp(descriptor->config_name, IMAGE_HEIGHT) != 0) _kds_s2000w_handler_opts_write_value_to_json(value_object, descriptor->descriptor->type, value); - _kds_s2000w_handler_opts_set_scan_source(descriptor, h, value); config = _kds_s2000w_handler_opts_reset(descriptor, h); if (h->profile > PROFILE_MIN) diff --git a/tests/kds_s2000w_net_get_opt_tests.c b/tests/kds_s2000w_net_get_opt_tests.c index 42f95cc..f9ccbd3 100644 --- a/tests/kds_s2000w_net_get_opt_tests.c +++ b/tests/kds_s2000w_net_get_opt_tests.c @@ -122,7 +122,6 @@ void sane_kds_s2000w_net_control_get_option_two_test(void** state) sane_kds_s2000w_net_control_option(h, 2, SANE_ACTION_GET_VALUE, &value, NULL); assert_string_equal(value, "DocumentFeeder"); - assert_int_equal(h->current_scan_status->feeder, DocumentFeeder); kds_s2000w_handler_free(h); h = NULL; diff --git a/tests/kds_s2000w_net_tests.c b/tests/kds_s2000w_net_tests.c index 76ce535..7bddfd2 100644 --- a/tests/kds_s2000w_net_tests.c +++ b/tests/kds_s2000w_net_tests.c @@ -397,7 +397,6 @@ void sane_kds_s2000w_net_start_one_page_per_flatscan_test(void** state) expect_function_call(__wrap_kds_s2000w_client_get_image); expect_function_call(__wrap_kds_s2000w_client_delete_image); handler* h = kds_s2000w_handler_init(); - h->current_scan_status->feeder = Flatbed; const char* test_config = "{\"Configuration\": { \"ColorMode\": \"Color\" } }"; h->current_scanner_config = json_tokener_parse(test_config); -- 2.47.3