2.5 filebrowser

* show only name of the last directory for the bookmark
* small fix of projectfile: header BLI_fileops.h was moved
Note: full path should appear in tool tip later, also for renaming bookmarks later on.
This commit is contained in:
2009-06-30 20:34:00 +00:00
parent 406b16e7d1
commit 60c2599a1a
4 changed files with 33 additions and 3 deletions

View File

@@ -736,6 +736,25 @@ void BLI_splitdirstring(char *di, char *fi)
}
}
void BLI_getlastdir(const char* dir, char *last, int maxlen)
{
char *s = dir;
char *lslash = NULL;
char *prevslash = NULL;
while (*s) {
if ((*s == '\\') || (*s == '/')) {
prevslash = lslash;
lslash = s;
}
s++;
}
if (prevslash) {
BLI_strncpy(last, prevslash+1, maxlen);
} else {
BLI_strncpy(last, dir, maxlen);
}
}
char *BLI_gethome(void) {
#if !defined(WIN32)
return getenv("HOME");