'Add a file or directory to this widget.'

def add_file(self, filename):

    if (filename not in self.filenames):
        if (not os.access(filename, os.R_OK)):
            Alert(strings._('not_a_readable_file', True).format(filename))
            return
        self.filenames.append(filename)
        self.filenames.sort()
        fileinfo = QtCore.QFileInfo(filename)
        basename = os.path.basename(filename.rstrip('/'))
        ip = QtWidgets.QFileIconProvider()
        icon = ip.icon(fileinfo)
        if os.path.isfile(filename):
            size = common.human_readable_filesize(fileinfo.size())
        else:
            size = common.human_readable_filesize(common.dir_size(filename))
        item_name = '{0:s}    ({1:s})'.format(basename, size)
        item = QtWidgets.QListWidgetItem(item_name)
        item.setToolTip(size)
        item.setIcon(icon)
        self.addItem(item)
        self.files_updated.emit()
