diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-04-29 17:41:02 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-04-29 17:49:52 +0300 |
commit | 5d84d9b0d6ad114109d60cf3d0ddcd9bb1a5de13 (patch) | |
tree | ef4456b94bada69a976a4b0add3c2cd7d4512dc0 /source/blender/windowmanager/intern/wm_jobs.c | |
parent | 2f49908a5e57a3476e5abf19267988775072c76d (diff) |
Cleanup: Simplify job custom data query API
There were two calls to access job's custom data. One of them
ignored job type, the other one ignored job owner.
Now there is a single function to access job's custom data.
If the job type or owner is not relevant NULL or WM_JOB_TYPE_ANY
can be passes explicitly.
Differential Revision: https://developer.blender.org/D14803
Diffstat (limited to 'source/blender/windowmanager/intern/wm_jobs.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_jobs.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c index 701a93c7e21..b44cf9e48b8 100644 --- a/source/blender/windowmanager/intern/wm_jobs.c +++ b/source/blender/windowmanager/intern/wm_jobs.c @@ -280,20 +280,9 @@ const char *WM_jobs_name(const wmWindowManager *wm, const void *owner) return NULL; } -void *WM_jobs_customdata(wmWindowManager *wm, const void *owner) +void *WM_jobs_customdata_from_type(wmWindowManager *wm, const void *owner, int job_type) { - wmJob *wm_job = wm_job_find(wm, owner, WM_JOB_TYPE_ANY); - - if (wm_job) { - return WM_jobs_customdata_get(wm_job); - } - - return NULL; -} - -void *WM_jobs_customdata_from_type(wmWindowManager *wm, int job_type) -{ - wmJob *wm_job = wm_job_find(wm, NULL, job_type); + wmJob *wm_job = wm_job_find(wm, owner, job_type); if (wm_job) { return WM_jobs_customdata_get(wm_job); |