]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
remove scan source from handler scan status
authorBastian Dehn <hhaalo@arcor.de>
Fri, 17 Oct 2025 15:29:25 +0000 (17:29 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 17 Oct 2025 15:29:25 +0000 (17:29 +0200)
src/kds_s2000w_handler.c
src/kds_s2000w_handler.h
src/kds_s2000w_handler_opts.c
tests/kds_s2000w_net_get_opt_tests.c
tests/kds_s2000w_net_tests.c

index 173d7c6f764ae30796d301d80bfd65b0ec7cbf94..04b30be036e413253bb8b4aecfbaf64347dabcef 100644 (file)
@@ -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;
index 841787e13d95f54fe47a7ae1c706b68f27b81e08..db676bce28f67248b31e196cf3e87ed2b9c690ca 100644 (file)
@@ -47,7 +47,6 @@ typedef struct {
        uint8_t available_images;
        uint8_t downloaded_images;
        bool complete_scanned;
-       uint8_t feeder;
 } scanstatus;
 
 typedef struct {
index 8e2244b01e8176bd3ad108328db714ff76e68f22..5e261943811b8631d5c295db31c50a36e0d79dff 100644 (file)
@@ -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)
index 42f95cc5ee5394768bde94663b2f1fe381a39697..f9ccbd3c1b1f46a3d3759299e7a1f5ba43bfd459 100644 (file)
@@ -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;
index 76ce5353cfa341d6777d06c1fa929b825fc87e25..7bddfd22cb0c6d8bfec953575b799a7096539dde 100644 (file)
@@ -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);