mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
fmt: remove space in front of ? and ! (#14366)
This commit is contained in:
parent
df029da942
commit
d679146a80
324 changed files with 1865 additions and 1879 deletions
|
@ -153,7 +153,7 @@ fn (item_list Item_list) get_file_path() string {
|
|||
fn (mut item_list Item_list) scan_folder(path string, in_index int) ? {
|
||||
println('Scanning [$path]')
|
||||
mut folder_list := []string{}
|
||||
lst := os.ls(path) ?
|
||||
lst := os.ls(path)?
|
||||
|
||||
// manage the single files
|
||||
for c, x in lst {
|
||||
|
@ -171,7 +171,7 @@ fn (mut item_list Item_list) scan_folder(path string, in_index int) ? {
|
|||
if ext == .zip {
|
||||
item.i_type = .zip
|
||||
item_list.lst << item
|
||||
item_list.scan_zip(pt, item_list.lst.len - 1) ?
|
||||
item_list.scan_zip(pt, item_list.lst.len - 1)?
|
||||
continue
|
||||
}
|
||||
if is_image(ext) == true {
|
||||
|
@ -194,7 +194,7 @@ fn (mut item_list Item_list) scan_folder(path string, in_index int) ? {
|
|||
i_type: .folder
|
||||
}
|
||||
item_list.lst << item
|
||||
item_list.scan_folder(pt, item_list.lst.len - 1) ?
|
||||
item_list.scan_folder(pt, item_list.lst.len - 1)?
|
||||
}
|
||||
// println(item_list.lst.len)
|
||||
// println("==================================")
|
||||
|
|
|
@ -13,12 +13,12 @@ import szip
|
|||
|
||||
fn (mut il Item_list) scan_zip(path string, in_index int) ? {
|
||||
println('Scanning ZIP [$path]')
|
||||
mut zp := szip.open(path, szip.CompressionLevel.no_compression, szip.OpenMode.read_only) ?
|
||||
n_entries := zp.total() ?
|
||||
mut zp := szip.open(path, szip.CompressionLevel.no_compression, szip.OpenMode.read_only)?
|
||||
n_entries := zp.total()?
|
||||
// println(n_entries)
|
||||
for index in 0 .. n_entries {
|
||||
zp.open_entry_by_index(index) ?
|
||||
is_dir := zp.is_dir() ?
|
||||
zp.open_entry_by_index(index)?
|
||||
is_dir := zp.is_dir()?
|
||||
name := zp.name()
|
||||
size := zp.size()
|
||||
// println("$index ${name} ${size:10} $is_dir")
|
||||
|
@ -58,15 +58,15 @@ fn (mut app App) load_texture_from_zip() ?(gfx.Image, int, int) {
|
|||
}
|
||||
app.zip_index = item.container_index
|
||||
// println("Opening the zip [${item.path}]")
|
||||
app.zip = szip.open(item.path, szip.CompressionLevel.no_compression, szip.OpenMode.read_only) ?
|
||||
app.zip = szip.open(item.path, szip.CompressionLevel.no_compression, szip.OpenMode.read_only)?
|
||||
}
|
||||
// println("Now get the image")
|
||||
app.zip.open_entry_by_index(item.container_item_index) ?
|
||||
app.zip.open_entry_by_index(item.container_item_index)?
|
||||
zip_entry_size := int(item.size)
|
||||
|
||||
app.resize_buf_if_needed(zip_entry_size)
|
||||
|
||||
app.zip.read_entry_buf(app.mem_buf, app.mem_buf_size) ?
|
||||
app.zip.read_entry_buf(app.mem_buf, app.mem_buf_size)?
|
||||
app.zip.close_entry()
|
||||
return app.load_texture_from_buffer(app.mem_buf, zip_entry_size)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue