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 ac076be75d.
This commit is contained in:
Andy Williams 2017-05-18 08:40:43 +01:00
parent 5ed8ed5ba2
commit 67f4b98ddb
3 changed files with 0 additions and 31 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);
}