summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorWang Fei <wangfeia@uniontech.com>2021-10-13 09:37:43 +0800
committerWang Fei <wangfeia@uniontech.com>2021-11-03 00:42:50 +0800
commit62c2d990f90ec999de694c5ccf7c7e14d8965052 (patch)
treeb9fe68fa1a2151c2317a47e3ab099439b88463bc /src/corelib
parentd39b5f376db85a18b163e31bd25a8c9dc4a5292c (diff)
Rename LinkName to AbsoluteLinkTarget
The existing symLinkTarget() always resolves the symlink target to an absolute path; It will be clearer to change LinkName to AbsoluteLinkTarget. It is ready for the commit about add symLinkPath() to read the raw link path. Fixes: QTBUG-96761 Change-Id: I8da7e23b066c9ac1a16abb691aa1c4a5f1ff8361 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Wang Fei <wangfeia@uniontech.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qabstractfileengine.cpp4
-rw-r--r--src/corelib/io/qabstractfileengine_p.h2
-rw-r--r--src/corelib/io/qfile.cpp2
-rw-r--r--src/corelib/io/qfileinfo.cpp4
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp2
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp2
-rw-r--r--src/corelib/io/qtemporaryfile.cpp2
7 files changed, 9 insertions, 9 deletions
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index 0e2bd57cb6..6b02ad6fd5 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -262,9 +262,9 @@ QAbstractFileEngine *QAbstractFileEngine::create(const QString &fileName)
the base name).
\value AbsolutePathName The absolute path to the file (excluding
the base name).
- \value LinkName The full file name of the file that this file is a
+ \value AbsoluteLinkTarget The full file name of the file that this file is a
link to. (This will be empty if this file is not a link.)
- \value CanonicalName Often very similar to LinkName. Will return the true path to the file.
+ \value CanonicalName Often very similar to AbsoluteLinkTarget. Will return the true path to the file.
\value CanonicalPathName Same as CanonicalName, excluding the base name.
\value BundleName Returns the name of the bundle implies BundleType is set.
\value JunctionName The full name of the directory that this NTFS junction
diff --git a/src/corelib/io/qabstractfileengine_p.h b/src/corelib/io/qabstractfileengine_p.h
index bed4aa56d9..91b74bebd3 100644
--- a/src/corelib/io/qabstractfileengine_p.h
+++ b/src/corelib/io/qabstractfileengine_p.h
@@ -102,7 +102,7 @@ public:
PathName,
AbsoluteName,
AbsolutePathName,
- LinkName,
+ AbsoluteLinkTarget,
CanonicalName,
CanonicalPathName,
BundleName,
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 471d73fcb6..bdbc5d3e44 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -412,7 +412,7 @@ QFile::exists(const QString &fileName)
QString QFile::symLinkTarget() const
{
Q_D(const QFile);
- return d->engine()->fileName(QAbstractFileEngine::LinkName);
+ return d->engine()->fileName(QAbstractFileEngine::AbsoluteLinkTarget);
}
/*!
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 8ff8896aab..da19ba625c 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -67,7 +67,7 @@ QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const
ret = entry.path();
break;
}
- case QAbstractFileEngine::LinkName:
+ case QAbstractFileEngine::AbsoluteLinkTarget:
ret = QFileSystemEngine::getLinkTarget(fileEntry, metaData).filePath();
break;
case QAbstractFileEngine::JunctionName:
@@ -1224,7 +1224,7 @@ QString QFileInfo::symLinkTarget() const
Q_D(const QFileInfo);
if (d->isDefaultConstructed)
return QLatin1String("");
- return d->getFileName(QAbstractFileEngine::LinkName);
+ return d->getFileName(QAbstractFileEngine::AbsoluteLinkTarget);
}
/*!
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 484a60fb74..5815d6bc9c 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -470,7 +470,7 @@ QString QFSFileEngine::fileName(FileName file) const
QFileSystemEntry entry(QFileSystemEngine::canonicalName(d->fileEntry, d->metaData));
return file == CanonicalPathName ? entry.path() : entry.filePath();
}
- case LinkName:
+ case AbsoluteLinkTarget:
if (d->isSymlink()) {
QFileSystemEntry entry = QFileSystemEngine::getLinkTarget(d->fileEntry, d->metaData);
return entry.filePath();
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index e4c3520c44..394b4ab69e 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -646,7 +646,7 @@ QString QFSFileEngine::fileName(FileName file) const
return entry.path();
return entry.filePath();
}
- case LinkName:
+ case AbsoluteLinkTarget:
return QFileSystemEngine::getLinkTarget(d->fileEntry, d->metaData).filePath();
case BundleName:
return QString();
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 54d7462883..5ccb959288 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -439,7 +439,7 @@ bool QTemporaryFileEngine::close()
QString QTemporaryFileEngine::fileName(QAbstractFileEngine::FileName file) const
{
if (isUnnamedFile()) {
- if (file == LinkName) {
+ if (file == AbsoluteLinkTarget) {
// we know our file isn't (won't be) a symlink
return QString();
}