static Boolean dir_is_drop_target(DirPtr dir, int i) { FilePtr file = dirFile(dir, i); String action = drop_action(fileType(file)); return i == NONE || file && (action && *action || S_ISDIR(fileStats(file)->st_mode) || (fileStats(file)->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))); }
Boolean cur_drop(int i, int op, SelPtr sel, Boolean absolute, Boolean dirtarget) { Boolean ret; FilePtr file = dirFile(curdir, i); String action; char path[MAXPATHLEN+1]; if (i != NONE) if (!((action = drop_action(fileType(file))) && *action) && S_ISDIR(fileStats(file)->st_mode)) ret = fileMov(op)(sel, pathname(path, dirName(curdir), fileName(file)), absolute); else ret = fileDrop(curdir, i, sel, absolute, dirtarget, False); else ret = fileMov(op)(sel, dirName(curdir), absolute); update(); return ret; }
bool select_action () const { return m_selecting || m_growing || drop_action(); }