Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/file_draw.c2
-rw-r--r--source/blender/editors/space_file/file_ops.c2
-rw-r--r--source/blender/editors/space_file/filelist.c20
-rw-r--r--source/blender/editors/space_file/filelist.h18
-rw-r--r--source/blender/editors/space_file/fsmenu.c4
-rw-r--r--source/blender/editors/space_file/space_file.c20
6 files changed, 33 insertions, 33 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index fd9a9ff9ab1..f407d82aa5e 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -560,7 +560,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
filelist_cache_previews_update(files);
/* Handle preview timer here, since it's filelist_file_cache_block() and filelist_cache_previews_update()
- * which controlls previews task. */
+ * which controls previews task. */
{
const bool previews_running = filelist_cache_previews_running(files);
// printf("%s: preview task: %d\n", __func__, previews_running);
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 81bc585db82..c9de18d9ca8 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -1301,7 +1301,7 @@ void file_operator_to_sfile(bContext *C, SpaceFile *sfile, wmOperator *op)
}
/* we could check for relative_path property which is used when converting
- * in the other direction but doesnt hurt to do this every time */
+ * in the other direction but doesn't hurt to do this every time */
BLI_path_abs(sfile->params->dir, BKE_main_blendfile_path(bmain));
/* XXX, files and dirs updates missing, not really so important though */
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 09e2660a762..368fc8be35c 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -215,7 +215,7 @@ typedef struct FileListInternEntry {
int blentype; /* ID type, in case typeflag has FILE_TYPE_BLENDERLIB set. */
char *relpath;
- char *name; /* not striclty needed, but used during sorting, avoids to have to recompute it there... */
+ char *name; /* not strictly needed, but used during sorting, avoids to have to recompute it there... */
BLI_stat_t st;
} FileListInternEntry;
@@ -236,7 +236,7 @@ typedef struct FileListEntryCache {
/* This one gathers all entries from both block and misc caches. Used for easy bulk-freing. */
ListBase cached_entries;
- /* Block cache: all entries between start and end index. used for part of the list on diplay. */
+ /* Block cache: all entries between start and end index. used for part of the list on display. */
FileDirEntry **block_entries;
int block_start_index, block_end_index, block_center_index, block_cursor;
@@ -1516,7 +1516,7 @@ static FileDirEntry *filelist_file_ex(struct FileList *filelist, const int index
return cache->block_entries[idx];
}
- if ((ret = BLI_ghash_lookup(cache->misc_entries, SET_INT_IN_POINTER(index)))) {
+ if ((ret = BLI_ghash_lookup(cache->misc_entries, POINTER_FROM_INT(index)))) {
return ret;
}
@@ -1529,11 +1529,11 @@ static FileDirEntry *filelist_file_ex(struct FileList *filelist, const int index
/* Else, we have to add new entry to 'misc' cache - and possibly make room for it first! */
ret = filelist_file_create_entry(filelist, index);
old_index = cache->misc_entries_indices[cache->misc_cursor];
- if ((old = BLI_ghash_popkey(cache->misc_entries, SET_INT_IN_POINTER(old_index), NULL))) {
+ if ((old = BLI_ghash_popkey(cache->misc_entries, POINTER_FROM_INT(old_index), NULL))) {
BLI_ghash_remove(cache->uuids, old->uuid, NULL, NULL);
filelist_file_release_entry(filelist, old);
}
- BLI_ghash_insert(cache->misc_entries, SET_INT_IN_POINTER(index), ret);
+ BLI_ghash_insert(cache->misc_entries, POINTER_FROM_INT(index), ret);
BLI_ghash_insert(cache->uuids, ret->uuid, ret);
cache->misc_entries_indices[cache->misc_cursor] = index;
@@ -1628,7 +1628,7 @@ static bool filelist_file_cache_block_create(FileList *filelist, const int start
FileDirEntry *entry;
/* That entry might have already been requested and stored in misc cache... */
- if ((entry = BLI_ghash_popkey(cache->misc_entries, SET_INT_IN_POINTER(idx), NULL)) == NULL) {
+ if ((entry = BLI_ghash_popkey(cache->misc_entries, POINTER_FROM_INT(idx), NULL)) == NULL) {
entry = filelist_file_create_entry(filelist, idx);
BLI_ghash_insert(cache->uuids, entry->uuid, entry);
}
@@ -2064,7 +2064,7 @@ unsigned int filelist_entry_select_set(
{
/* Default NULL pointer if not found is fine here! */
void **es_p = BLI_ghash_lookup_p(filelist->selection_state, entry->uuid);
- unsigned int entry_flag = es_p ? GET_UINT_FROM_POINTER(*es_p) : 0;
+ unsigned int entry_flag = es_p ? POINTER_AS_UINT(*es_p) : 0;
const unsigned int org_entry_flag = entry_flag;
BLI_assert(entry);
@@ -2090,7 +2090,7 @@ unsigned int filelist_entry_select_set(
if (entry_flag != org_entry_flag) {
if (es_p) {
if (entry_flag) {
- *es_p = SET_UINT_IN_POINTER(entry_flag);
+ *es_p = POINTER_FROM_UINT(entry_flag);
}
else {
BLI_ghash_remove(filelist->selection_state, entry->uuid, MEM_freeN, NULL);
@@ -2099,7 +2099,7 @@ unsigned int filelist_entry_select_set(
else if (entry_flag) {
void *key = MEM_mallocN(sizeof(entry->uuid), __func__);
memcpy(key, entry->uuid, sizeof(entry->uuid));
- BLI_ghash_insert(filelist->selection_state, key, SET_UINT_IN_POINTER(entry_flag));
+ BLI_ghash_insert(filelist->selection_state, key, POINTER_FROM_UINT(entry_flag));
}
}
@@ -2139,7 +2139,7 @@ unsigned int filelist_entry_select_get(FileList *filelist, FileDirEntry *entry,
((check == CHECK_FILES) && !(entry->typeflag & FILE_TYPE_DIR)))
{
/* Default NULL pointer if not found is fine here! */
- return GET_UINT_FROM_POINTER(BLI_ghash_lookup(filelist->selection_state, entry->uuid));
+ return POINTER_AS_UINT(BLI_ghash_lookup(filelist->selection_state, entry->uuid));
}
return 0;
diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h
index 76845c44226..6d898ee2fe9 100644
--- a/source/blender/editors/space_file/filelist.h
+++ b/source/blender/editors/space_file/filelist.h
@@ -56,12 +56,12 @@ typedef enum FileCheckType {
CHECK_ALL = 3
} FileCheckType;
-struct ListBase * folderlist_new(void);
+struct ListBase *folderlist_new(void);
void folderlist_free(struct ListBase *folderlist);
-struct ListBase * folderlist_duplicate(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 *folderdist);
int folderlist_clear_next(struct SpaceFile *sfile);
@@ -77,24 +77,24 @@ void filelist_filter(struct FileList *filelist);
void filelist_init_icons(void);
void filelist_free_icons(void);
void filelist_imgsize(struct FileList *filelist, short w, short h);
-struct ImBuf * filelist_getimage(struct FileList *filelist, const int index);
-struct ImBuf * filelist_geticon_image(struct FileList *filelist, const int index);
+struct ImBuf *filelist_getimage(struct FileList *filelist, const int index);
+struct ImBuf *filelist_geticon_image(struct FileList *filelist, const int index);
int filelist_geticon(struct FileList *filelist, const int index, const bool is_main);
-struct FileList * filelist_new(short type);
+struct FileList *filelist_new(short type);
void filelist_clear(struct FileList *filelist);
void filelist_clear_ex(struct FileList *filelist, const bool do_cache, const bool do_selection);
void filelist_free(struct FileList *filelist);
-const char * filelist_dir(struct FileList *filelist);
+const char *filelist_dir(struct FileList *filelist);
bool filelist_is_dir(struct FileList *filelist, const char *path);
void filelist_setdir(struct FileList *filelist, char *r_dir);
int filelist_files_ensure(struct FileList *filelist);
int filelist_empty(struct FileList *filelist);
-FileDirEntry * filelist_file(struct FileList *filelist, int index);
+FileDirEntry *filelist_file(struct FileList *filelist, int index);
int filelist_file_findpath(struct FileList *filelist, const char *file);
-FileDirEntry * filelist_entry_find_uuid(struct FileList *filelist, const int uuid[4]);
+FileDirEntry *filelist_entry_find_uuid(struct FileList *filelist, const int uuid[4]);
void filelist_file_cache_slidingwindow_set(struct FileList *filelist, size_t window_size);
bool filelist_file_cache_block(struct FileList *filelist, const int index);
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index baa8e78572a..38b8dd37d46 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -439,7 +439,7 @@ void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filename)
line[len - 1] = '\0';
}
/* don't do this because it can be slow on network drives,
- * having a bookmark from a drive thats ejected or so isn't
+ * having a bookmark from a drive that's ejected or so isn't
* all _that_ bad */
#if 0
if (BLI_exists(line))
@@ -577,7 +577,7 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
#else
/* unix */
{
- const char *home = getenv("HOME");
+ const char *home = BLI_getenv("HOME");
if (read_bookmarks && home) {
BLI_snprintf(line, sizeof(line), "%s/", home);
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 94f47d5a6aa..b0dea1eb31b 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -330,10 +330,10 @@ static void file_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
/* own keymaps */
- keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "File Browser Main", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "File Browser Main", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -386,7 +386,7 @@ static void file_main_region_draw(const bContext *C, ARegion *ar)
v2d->keepofs |= V2D_LOCKOFS_Y;
/* XXX this happens on scaling down Screen (like from startup.blend) */
- /* view2d has no type specific for filewindow case, which doesnt scroll vertically */
+ /* view2d has no type specific for filewindow case, which doesn't scroll vertically */
if (v2d->cur.ymax < 0) {
v2d->cur.ymin -= v2d->cur.ymax;
v2d->cur.ymax = 0;
@@ -453,7 +453,7 @@ static void file_keymap(struct wmKeyConfig *keyconf)
{
wmKeyMapItem *kmi;
/* keys for all regions */
- wmKeyMap *keymap = WM_keymap_find(keyconf, "File Browser", SPACE_FILE, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "File Browser", SPACE_FILE, 0);
/* More common 'fliebrowser-like navigation' shortcuts. */
WM_keymap_add_item(keymap, "FILE_OT_parent", UPARROWKEY, KM_PRESS, KM_ALT, 0);
@@ -476,7 +476,7 @@ static void file_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "FILE_OT_bookmark_add", BKEY, KM_PRESS, KM_CTRL, 0);
/* keys for main region */
- keymap = WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(keyconf, "File Browser Main", SPACE_FILE, 0);
kmi = WM_keymap_add_item(keymap, "FILE_OT_execute", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
RNA_boolean_set(kmi->ptr, "need_active", true);
@@ -568,7 +568,7 @@ static void file_keymap(struct wmKeyConfig *keyconf)
/* keys for button region (top) */
- keymap = WM_keymap_find(keyconf, "File Browser Buttons", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(keyconf, "File Browser Buttons", SPACE_FILE, 0);
kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0);
RNA_int_set(kmi->ptr, "increment", 1);
kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_SHIFT, 0);
@@ -592,7 +592,7 @@ static void file_tools_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
/* own keymaps */
- keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -618,7 +618,7 @@ static void file_header_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_header_init(ar);
- keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -635,10 +635,10 @@ static void file_ui_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "File Browser Buttons", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "File Browser Buttons", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}