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:
authorCampbell Barton <ideasman42@gmail.com>2013-03-10 10:40:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-10 10:40:19 +0400
commit02ecd9f84279acab5d5fdc26c3db467164b6542d (patch)
treeb858d000d0cdbe57ac0191acb04b3ad4a77c683e /source/blender/blenkernel/intern
parentf9f707033665dc737f1011e82406a12fafa78326 (diff)
code cleanup:
- remove unused block from before blender was opensourced (BKE_library_make_local) noticed by Lawrence D'Oliveiro (ldo) - remove text_idbutton() unused function. - test_idbutton(name) was taking (name + 2), then checking 2 bytes before the pointer, this is error prone so better just take the name including the ID prefix.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/library.c43
1 files changed, 4 insertions, 39 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index a251a62df97..4038dd2d165 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1510,7 +1510,7 @@ void tag_main(struct Main *mainvar, const short tag)
* bmain is almost certainly G.main */
void BKE_library_make_local(Main *bmain, Library *lib, bool untagged_only)
{
- ListBase *lbarray[MAX_LIBARRAY], tempbase = {NULL, NULL};
+ ListBase *lbarray[MAX_LIBARRAY];
ID *id, *idn;
int a;
@@ -1545,17 +1545,8 @@ void BKE_library_make_local(Main *bmain, Library *lib, bool untagged_only)
}
id = idn;
}
-
- /* patch2: make it aphabetically */
- /* FIXME: but nothing is ever put into tempbase! */
- while ( (id = tempbase.first) ) {
- BLI_remlink(&tempbase, id);
- BLI_addtail(lbarray[a], id);
- new_id(lbarray[a], id, NULL);
- }
}
- /* patch 3: make sure library data isn't indirect falsely... */
a = set_listbasepointers(bmain, lbarray);
while (a--) {
for (id = lbarray[a]->first; id; id = id->next)
@@ -1571,44 +1562,18 @@ void test_idbutton(char *name)
ID *idtest;
- lb = which_libbase(G.main, GS(name - 2) );
+ lb = which_libbase(G.main, GS(name) );
if (lb == NULL) return;
/* search for id */
- idtest = BLI_findstring(lb, name, offsetof(ID, name) + 2);
+ idtest = BLI_findstring(lb, name + 2, offsetof(ID, name) + 2);
- if (idtest && !new_id(lb, idtest, name)) {
+ if (idtest && !new_id(lb, idtest, name + 2)) {
id_sort_by_name(lb, idtest);
}
}
/**
- * Puts into *text a descriptive block type prefix to be displayed before the block name.
- */
-/* Not actually used anywhere any more. */
-void text_idbutton(const struct ID *id, char *text)
-{
- if (id) {
- if (GS(id->name) == ID_SCE)
- strcpy(text, "SCE: ");
- else if (GS(id->name) == ID_SCR)
- strcpy(text, "SCR: ");
- else if (GS(id->name) == ID_MA && ((Material *)id)->use_nodes)
- strcpy(text, "NT: ");
- else {
- text[0] = id->name[0];
- text[1] = id->name[1];
- text[2] = ':';
- text[3] = ' ';
- text[4] = 0;
- }
- }
- else {
- text[0] = '\0';
- }
-}
-
-/**
* Sets the name of a block to name, suitably adjusted for uniqueness.
*/
void rename_id(ID *id, const char *name)