From 67f4b98ddbc5c9797bf159fa96d41afd12d425a7 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Thu, 18 May 2017 08:40:43 +0100 Subject: [PATCH] Revert "elm_code: Add a save_as API call for writing buffers to a new file" The implementation is flawed and was not noticed due to the tests not having run unexpectedly. This reverts commit ac076be75d125df9353c1a8cdcf970a9a01db370. --- src/lib/elementary/elm_code_file.c | 10 ---------- src/lib/elementary/elm_code_file.h | 2 -- src/tests/elementary/elm_code_test_basic.c | 19 ------------------- 3 files changed, 31 deletions(-) diff --git a/src/lib/elementary/elm_code_file.c b/src/lib/elementary/elm_code_file.c index 97c3659..1094929 100644 --- a/src/lib/elementary/elm_code_file.c +++ b/src/lib/elementary/elm_code_file.c @@ -210,16 +210,6 @@ EAPI void elm_code_file_save(Elm_Code_File *file) } } -EAPI void elm_code_file_save_as(Elm_Code_File *file, const char *path) -{ - Eina_File *newfile; - newfile = eina_file_open(path, EINA_FALSE); - file->file = newfile; - file->mime = efreet_mime_type_get(path); - - elm_code_file_save(file); -} - EAPI void elm_code_file_free(Elm_Code_File *file) { Elm_Code_Line *l; diff --git a/src/lib/elementary/elm_code_file.h b/src/lib/elementary/elm_code_file.h index 80842bf..9bafe43 100644 --- a/src/lib/elementary/elm_code_file.h +++ b/src/lib/elementary/elm_code_file.h @@ -43,8 +43,6 @@ EAPI Elm_Code_File *elm_code_file_open(Elm_Code *code, const char *path); EAPI void elm_code_file_save(Elm_Code_File *file); -EAPI void elm_code_file_save_as(Elm_Code_File *file, const char *path); - EAPI void elm_code_file_free(Elm_Code_File *file); EAPI void elm_code_file_close(Elm_Code_File *file); diff --git a/src/tests/elementary/elm_code_test_basic.c b/src/tests/elementary/elm_code_test_basic.c index 887db8d..5f6827b 100644 --- a/src/tests/elementary/elm_code_test_basic.c +++ b/src/tests/elementary/elm_code_test_basic.c @@ -42,28 +42,9 @@ START_TEST (elm_code_open_test) } END_TEST -START_TEST (elm_code_save_as_test) -{ - char *path = TESTS_SRC_DIR "/testfile.txt"; - char *dest = "/tmp/dest.txt"; - Elm_Code *code; - - elm_init(1, NULL); - code = elm_code_create(); - elm_code_file_open(code, path); - - elm_code_file_save_as(code->file, dest); - ck_assert(ecore_file_exists(dest)); - - ecore_file_remove(dest); - elm_code_free(code); - elm_shutdown(); -} -END_TEST void elm_code_test_basic(TCase *tc) { tcase_add_test(tc, elm_code_create_test); tcase_add_test(tc, elm_code_open_test); - tcase_add_test(tc, elm_code_save_as_test); } -- 2.7.4