mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Dead code tells no tales
This commit is contained in:
parent
37da8155a4
commit
7ad14e7a3e
215 changed files with 153 additions and 56138 deletions
|
@ -313,77 +313,6 @@ void ExportTemplateManager::_bind_methods() {
|
|||
ClassDB::bind_method("_uninstall_template", &ExportTemplateManager::_uninstall_template);
|
||||
ClassDB::bind_method("_uninstall_template_confirm", &ExportTemplateManager::_uninstall_template_confirm);
|
||||
ClassDB::bind_method("_install_from_file", &ExportTemplateManager::_install_from_file);
|
||||
|
||||
#if 0
|
||||
FileAccess *fa = NULL;
|
||||
zlib_filefunc_def io = zipio_create_io_from_file(&fa);
|
||||
|
||||
unzFile pkg = unzOpen2(p_file.utf8().get_data(), &io);
|
||||
if (!pkg) {
|
||||
|
||||
current_option = -1;
|
||||
//confirmation->get_cancel()->hide();
|
||||
accept->get_ok()->set_text(TTR("I see.."));
|
||||
accept->set_text(TTR("Can't open export templates zip."));
|
||||
accept->popup_centered_minsize();
|
||||
return;
|
||||
}
|
||||
int ret = unzGoToFirstFile(pkg);
|
||||
|
||||
int fc = 0; //count them
|
||||
|
||||
while (ret == UNZ_OK) {
|
||||
fc++;
|
||||
ret = unzGoToNextFile(pkg);
|
||||
}
|
||||
|
||||
ret = unzGoToFirstFile(pkg);
|
||||
|
||||
EditorProgress p("ltask", TTR("Loading Export Templates"), fc);
|
||||
|
||||
fc = 0;
|
||||
|
||||
while (ret == UNZ_OK) {
|
||||
|
||||
//get filename
|
||||
unz_file_info info;
|
||||
char fname[16384];
|
||||
ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);
|
||||
|
||||
String file = fname;
|
||||
|
||||
Vector<uint8_t> data;
|
||||
data.resize(info.uncompressed_size);
|
||||
|
||||
//read
|
||||
ret = unzOpenCurrentFile(pkg);
|
||||
ret = unzReadCurrentFile(pkg, data.ptr(), data.size());
|
||||
unzCloseCurrentFile(pkg);
|
||||
|
||||
print_line(fname);
|
||||
/*
|
||||
for(int i=0;i<512;i++) {
|
||||
print_line(itos(data[i]));
|
||||
}
|
||||
*/
|
||||
|
||||
file = file.get_file();
|
||||
|
||||
p.step(TTR("Importing:") + " " + file, fc);
|
||||
|
||||
FileAccess *f = FileAccess::open(EditorSettings::get_singleton()->get_settings_path() + "/templates/" + file, FileAccess::WRITE);
|
||||
|
||||
ERR_CONTINUE(!f);
|
||||
f->store_buffer(data.ptr(), data.size());
|
||||
|
||||
memdelete(f);
|
||||
|
||||
ret = unzGoToNextFile(pkg);
|
||||
fc++;
|
||||
}
|
||||
|
||||
unzClose(pkg);
|
||||
#endif
|
||||
}
|
||||
|
||||
ExportTemplateManager::ExportTemplateManager() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue