]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
remove special option combination
authorBastian Dehn <hhaalo@arcor.de>
Mon, 4 Mar 2024 19:48:43 +0000 (20:48 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 4 Mar 2024 19:48:43 +0000 (20:48 +0100)
src/kds_s2000w_handler_opts.c
src/kds_s2000w_option_descriptors.c

index ec6a346437bb8c35cb84c9d5b0890c2536a8ecc4..ee1e06b6ad109e4b87e0226687d4c5d0db622654 100644 (file)
@@ -60,52 +60,6 @@ void _load_options(handler* h)
        resp = NULL;
 }
 
-int _change_output_type_to_images()
-{
-       json_object* value_object = json_object_object_get(config, "ColorMode");
-       const char* color_mode_value = json_object_get_string(value_object);
-       if (strcmp(color_mode_value, "Color_BW") != 0) {
-               value_object = NULL;
-               value_object = json_object_object_get(config, "OutputType");
-               const char* reset_value_ptr = "Images";
-               _write_string_value_to_json(value_object, (void*) reset_value_ptr);
-               value_object = NULL;
-               return 1;
-       }
-
-       return 0;
-}
-
-int _color_change_to_color_bw()
-{
-       json_object* value_object = json_object_object_get(config, "ColorMode");
-       const char* color_mode_value = json_object_get_string(value_object);
-       if (strcmp(color_mode_value, "Color_BW") != 0) {
-               const char* reset_value_ptr = "Color_BW";
-               _write_string_value_to_json(value_object, (void*) reset_value_ptr);
-               value_object = NULL;
-               return 1;
-       }
-
-       return 0;
-}
-
-int _change_skip_blank_pages_off()
-{
-       json_object* value_object = json_object_object_get(config, "OutputType");
-       const char* output_type = json_object_get_string(value_object);
-       value_object = NULL;
-
-       if (strcmp(output_type, "SinglePageColorPDFPlus2TIFs") == 0) {
-               value_object = json_object_object_get(config, "SkipBlankPages");
-               json_object_set_int(value_object, 0);
-               value_object = NULL;
-               return 1;
-       }
-
-       return 0;
-}
-
 void kds_s2000w_handler_get_option(handler* h, int option, void* value, int* info)
 {
        config = json_object_object_get(resp_config, "Configuration");
@@ -227,9 +181,6 @@ void kds_s2000w_handler_set_option(handler* h, int option, void* value, int* inf
                        _write_string_value_to_json(value_object, value);
                        value_object = NULL;
 
-                       if (_change_output_type_to_images())
-                               *info = RELOAD_OPTIONS;
-
                        char* str_Value = (char*) value;
                        if (strcmp(str_Value, "Color") == 0) {
                                h->current_metadata->format = 1;
@@ -262,10 +213,6 @@ void kds_s2000w_handler_set_option(handler* h, int option, void* value, int* inf
                        value_object = json_object_object_get(config, "SkipBlankPages");
                        _write_int_value_to_json(value_object, value);
                        value_object = NULL;
-
-                       if (_change_skip_blank_pages_off())
-                               *info = RELOAD_OPTIONS;
-
                        break;
                case 9:
                        int* autostart_value = (int*) value;
@@ -286,13 +233,6 @@ void kds_s2000w_handler_set_option(handler* h, int option, void* value, int* inf
                        value_object = json_object_object_get(config, "OutputType");
                        _write_string_value_to_json(value_object, value);
                        value_object = NULL;
-
-                       if (_color_change_to_color_bw())
-                               *info = RELOAD_OPTIONS;
-
-                       if (_change_skip_blank_pages_off())
-                               *info = RELOAD_OPTIONS;
-
                        break;
                case 13:
                        value_object = json_object_object_get(config, "ColorAutoBrightnessMode");
index ba6d10ea6d99a0c41dfbe7b5df74778d2eaf65ff..874dfa754769cbe64d2234d0a60d518f32afc668 100644 (file)
@@ -132,12 +132,11 @@ SANE_Option_Descriptor* _kds_s2000w_option_descriptor_color_mode()
        descriptor->desc = SANE_DESC_SCAN_MODE;
        descriptor->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT;
        descriptor->constraint_type = SANE_CONSTRAINT_STRING_LIST;
-       constraint_colormode = malloc(sizeof(char*) * 5);
+       constraint_colormode = malloc(sizeof(char*) * 4);
        constraint_colormode[0] = "Color";
        constraint_colormode[1] = "Gray";
        constraint_colormode[2] = "BW";
-       constraint_colormode[3] = "Color_BW";
-       constraint_colormode[4] = NULL;
+       constraint_colormode[3] = NULL;
        descriptor->constraint.string_list = constraint_colormode;
        descriptor->type = SANE_TYPE_STRING;
        descriptor->unit = SANE_UNIT_NONE;
@@ -240,10 +239,9 @@ SANE_Option_Descriptor* _kds_s2000w_option_descriptor_output_type()
        descriptor->desc = "outputtype";
        descriptor->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT;
        descriptor->constraint_type = SANE_CONSTRAINT_STRING_LIST;
-       constraint_output_type = malloc(sizeof(char*) * 3);
+       constraint_output_type = malloc(sizeof(char*) * 2);
        constraint_output_type[0] = "Images";
-       constraint_output_type[1] = "SinglePageColorPDFPlus2TIFs";
-       constraint_output_type[2] = NULL;
+       constraint_output_type[1] = NULL;
        descriptor->constraint.string_list = constraint_output_type;
        descriptor->type = SANE_TYPE_STRING;
        descriptor->unit = SANE_UNIT_NONE;