diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2023-09-20 22:38:07 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-09-23 08:18:30 -0700 |
commit | 6434b6ea486bbb959a15d83322b6869d8f29b9bc (patch) | |
tree | c87509f2e19499fe11a9cdada47b3b9bd1e7097c /src/corelib/io/qfilesystemengine_unix.cpp | |
parent | 610b26b819c7963dfeebf3e073562a51554acc9e (diff) |
moveToTrash/Unix: rename 'infoPath' variable to 'pathForInfo'
We have other variables whose name start with 'info' in this function,
so infoPath is misleading: it's not the path to infoFile and it isn't
related to the infoFileName. Instead, it's the path to the file being
trashed which will be saved in the info file.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1786d358a0e02dfd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/io/qfilesystemengine_unix.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 292c1ed434..2d4eb0256f 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -1365,14 +1365,14 @@ bool QFileSystemEngine::moveFileToTrash(const QFileSystemEntry &source, const QString targetPath = trashDir.filePath(filesDir) + uniqueTrashedName; const QFileSystemEntry target(targetPath); - QString infoPath; + QString pathForInfo; const QStorageInfo storageInfo(sourcePath); if (storageInfo.isValid() && storageInfo.rootPath() != rootPath() && storageInfo != QStorageInfo(QDir::home())) { - infoPath = sourcePath.mid(storageInfo.rootPath().length()); - if (infoPath.front() == u'/') - infoPath = infoPath.mid(1); + pathForInfo = sourcePath.mid(storageInfo.rootPath().length()); + if (pathForInfo.front() == u'/') + pathForInfo = pathForInfo.mid(1); } else { - infoPath = sourcePath; + pathForInfo = sourcePath; } /* @@ -1388,7 +1388,7 @@ bool QFileSystemEngine::moveFileToTrash(const QFileSystemEntry &source, QByteArray info = "[Trash Info]\n" - "Path=" + QUrl::toPercentEncoding(infoPath, "/") + "\n" + "Path=" + QUrl::toPercentEncoding(pathForInfo, "/") + "\n" "DeletionDate=" + QDateTime::currentDateTime().toString(Qt::ISODate).toUtf8() + "\n"; infoFile.write(info); |