From b5662ba6037cd27cbf276922c376a1192ba7c51e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 30 Sep 2016 11:47:40 +0200 Subject: QFileSystemModel: reuse an existing variable ... to improve readability. The variable 'oldName' was defined one line up from the same expression as the RHS of the if, so use the variable instead. Change-Id: Ifcd119317e8c9594f5280f294bc3301f681b94be Reviewed-by: Thiago Macieira --- src/widgets/dialogs/qfilesystemmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 11b3659990..b27cfa5805 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -873,7 +873,7 @@ bool QFileSystemModel::setData(const QModelIndex &idx, const QVariant &value, in QString newName = value.toString(); QString oldName = idx.data().toString(); - if (newName == idx.data().toString()) + if (newName == oldName) return true; const QString parentPath = filePath(parent(idx)); -- cgit v1.2.3