apply several fixes including rename operation fix

rename operation returns a 301 which causes a mistake in some platforms

QString::right returns a substring n rightmost characters of the string, not the
substring starting from n.

don't use objects after calling deleteLater, which is kind of dangerouse (and causing
segment fault easily)