diff options
author | Julian Eisel <julian@blender.org> | 2020-09-10 19:49:12 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-09-10 19:49:12 +0300 |
commit | bb51bc2a6d0920aec9b199a5484f6f6c37ca3bfc (patch) | |
tree | 4a08d87cc01dd46f7cc82407c23511f374c6650b /source/blender/editors/space_file | |
parent | d32aadab6e3ea2a85152fbd98f87babb9245c572 (diff) | |
parent | 51befa4108128a7bacf7a201046cf7ede999833a (diff) |
Merge branch 'master' into asset-metadata
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_file/filelist.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.h | 4 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 4 |
6 files changed, 13 insertions, 19 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index c97f6687367..8814aa95cab 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -954,11 +954,9 @@ void filelist_init_icons(void) void filelist_free_icons(void) { - int i; - BLI_assert(G.background == false); - for (i = 0; i < SPECIAL_IMG_MAX; i++) { + for (int i = 0; i < SPECIAL_IMG_MAX; i++) { IMB_freeImBuf(gSpecialFileImages[i]); gSpecialFileImages[i] = NULL; } diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h index c0b81905af9..b76a1c486a6 100644 --- a/source/blender/editors/space_file/filelist.h +++ b/source/blender/editors/space_file/filelist.h @@ -51,7 +51,7 @@ void folderlist_free(struct ListBase *folderlist); struct ListBase *folderlist_duplicate(ListBase *folderlist); void folderlist_popdir(struct ListBase *folderlist, char *dir); void folderlist_pushdir(struct ListBase *folderlist, const char *dir); -const char *folderlist_peeklastdir(struct ListBase *folderdist); +const char *folderlist_peeklastdir(struct ListBase *folderlist); int folderlist_clear_next(struct SpaceFile *sfile); void filelist_setsorting(struct FileList *filelist, const short sort, bool invert_sort); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 88c8c6b2939..306d6cba50e 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -861,15 +861,13 @@ int file_select_match(struct SpaceFile *sfile, const char *pattern, char *matche { int match = 0; - int i; - FileDirEntry *file; int n = filelist_files_ensure(sfile->files); /* select any file that matches the pattern, this includes exact match * if the user selects a single file by entering the filename */ - for (i = 0; i < n; i++) { - file = filelist_file(sfile->files, i); + for (int i = 0; i < n; i++) { + FileDirEntry *file = filelist_file(sfile->files, i); /* Do not check whether file is a file or dir here! Causes T44243 * (we do accept dirs at this stage). */ if (fnmatch(pattern, file->relpath, 0) == 0) { @@ -941,9 +939,8 @@ int autocomplete_file(struct bContext *C, char *str, void *UNUSED(arg_v)) if (str[0] && sfile->files) { AutoComplete *autocpl = UI_autocomplete_begin(str, FILE_MAX); int nentries = filelist_files_ensure(sfile->files); - int i; - for (i = 0; i < nentries; i++) { + for (int i = 0; i < nentries; i++) { FileDirEntry *file = filelist_file(sfile->files, i); UI_autocomplete_update_name(autocpl, file->relpath); } diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index b1c94c2668f..329b5fe67fd 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -241,13 +241,13 @@ int ED_fsmenu_get_nentries(struct FSMenu *fsmenu, FSMenuCategory category) return count; } -FSMenuEntry *ED_fsmenu_get_entry(struct FSMenu *fsmenu, FSMenuCategory category, int index) +FSMenuEntry *ED_fsmenu_get_entry(struct FSMenu *fsmenu, FSMenuCategory category, int idx) { FSMenuEntry *fsm_iter; - for (fsm_iter = ED_fsmenu_get_category(fsmenu, category); fsm_iter && index; + for (fsm_iter = ED_fsmenu_get_category(fsmenu, category); fsm_iter && idx; fsm_iter = fsm_iter->next) { - index--; + idx--; } return fsm_iter; @@ -645,11 +645,10 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks) wchar_t wline[FILE_MAXDIR]; __int64 tmp; char tmps[4], *name; - int i; tmp = GetLogicalDrives(); - for (i = 0; i < 26; i++) { + for (int i = 0; i < 26; i++) { if ((tmp >> i) & 1) { tmps[0] = 'A' + i; tmps[1] = ':'; diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index c4af27a25aa..6296314d40a 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -48,10 +48,10 @@ void fsmenu_insert_entry(struct FSMenu *fsmenu, void fsmenu_entry_refresh_valid(struct FSMenuEntry *fsentry); /** Return whether the entry was created by the user and can be saved and deleted */ -short fsmenu_can_save(struct FSMenu *fsmenu, enum FSMenuCategory category, int index); +short fsmenu_can_save(struct FSMenu *fsmenu, enum FSMenuCategory category, int idx); /** Removes the fsmenu entry at the given \a index. */ -void fsmenu_remove_entry(struct FSMenu *fsmenu, enum FSMenuCategory category, int index); +void fsmenu_remove_entry(struct FSMenu *fsmenu, enum FSMenuCategory category, int idx); /** saves the 'bookmarks' to the specified file */ void fsmenu_write_file(struct FSMenu *fsmenu, const char *filename); diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 25658d5b7f9..848c903fdb3 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -663,10 +663,10 @@ static bool filepath_drop_poll(bContext *C, if (drag->type == WM_DRAG_PATH) { SpaceFile *sfile = CTX_wm_space_file(C); if (sfile) { - return 1; + return true; } } - return 0; + return false; } static void filepath_drop_copy(wmDrag *drag, wmDropBox *drop) |