def set_cwd(self, index=None, force=False):
        if not index:
            index = self.get_index()
        path = self.get_path(index)
        if force or path != self.cwd and os.path.isdir(path):
            self.cwd = path
            self.cwdidx = index
            self.dirview.setExpanded(self.cwdidx, True)
            self.update(2)
        elif self.cwd and path == self.cwd:
            self.fileops.stopupdate = True
            self.dirview.setExpanded(self.cwdidx, False)
            self.cwd = ""
            self.cwdidx = None
            self.update_indexview()
Set the current working directory for renaming actions.
dataset/ETHPy150Open mikar/demimove/demimove/gui.py/DemiMoveGUI.set_cwd