OSDN Git Service

various cleanups
authorIvailo Monev <xakepa10@gmail.com>
Tue, 31 May 2016 19:27:38 +0000 (19:27 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Tue, 31 May 2016 19:27:38 +0000 (19:27 +0000)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
14 files changed:
src/core/io/qbuffer.cpp
src/core/io/qbuffer.h
src/core/io/qfile.cpp
src/core/io/qfile.h
src/core/io/qfileinfo.cpp
src/core/io/qfileinfo.h
src/core/io/qfilesystemengine.cpp
src/core/kernel/qsharedmemory.cpp
src/core/tools/qcryptographichash.h
src/designer/shared/pluginmanager.cpp
src/gui/dialogs/qfileinfogatherer.cpp
src/gui/itemviews/qdirmodel.cpp
src/gui/kernel/qapplication_x11.cpp
src/gui/widgets/qabstractspinbox.cpp

index 52e0869..8de43ac 100644 (file)
@@ -350,22 +350,6 @@ bool QBuffer::open(OpenMode flags)
 /*!
     \reimp
 */
-void QBuffer::close()
-{
-    QIODevice::close();
-}
-
-/*!
-    \reimp
-*/
-qint64 QBuffer::pos() const
-{
-    return QIODevice::pos();
-}
-
-/*!
-    \reimp
-*/
 qint64 QBuffer::size() const
 {
     Q_D(const QBuffer);
@@ -397,14 +381,6 @@ bool QBuffer::seek(qint64 pos)
 }
 
 /*!
-    \reimp
-*/
-bool QBuffer::atEnd() const
-{
-    return QIODevice::atEnd();
-}
-
-/*!
    \reimp
 */
 bool QBuffer::canReadLine() const
index 2e5847f..1dc5777 100644 (file)
@@ -77,11 +77,8 @@ public:
 
     bool open(OpenMode openMode);
 
-    void close();
     qint64 size() const;
-    qint64 pos() const;
     bool seek(qint64 off);
-    bool atEnd() const;
     bool canReadLine() const;
 
 protected:
index 9201c20..f301774 100644 (file)
@@ -1445,15 +1445,6 @@ qint64 QFile::size() const
 }
 
 /*!
-  \reimp
-*/
-
-qint64 QFile::pos() const
-{
-    return QIODevice::pos();
-}
-
-/*!
   Returns true if the end of the file has been reached; otherwise returns
   false.
 
index f9df947..83ef01b 100644 (file)
@@ -147,7 +147,6 @@ public:
     virtual void close();
 
     qint64 size() const;
-    qint64 pos() const;
     bool seek(qint64 offset);
     bool atEnd() const;
     bool flush();
index d578778..000d77e 100644 (file)
@@ -236,7 +236,7 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request)
     size() to get its size.
 
     The file's type is obtained with isFile(), isDir() and
-    isSymLink(). The symLinkTarget() function provides the name of the file
+    isSymLink(). The readLink() function provides the name of the file
     the symlink points to.
 
     On Unix (including Mac OS X), the symlink has the same size() has
@@ -380,7 +380,19 @@ QFileInfo::~QFileInfo()
 */
 
 /*!
-    \overload
+    Returns true if this QFileInfo object refers to a file in the same
+    location as \a fileinfo; otherwise returns false.
+
+    Note that the result of comparing two empty QFileInfo objects,
+    containing no file references, is undefined.
+
+    \warning This will not compare two different symbolic links
+    pointing to the same file.
+
+    \warning Long and short file names that refer to the same file on Windows
+    are treated as if they referred to different files.
+
+    \sa operator!=()
 */
 bool QFileInfo::operator==(const QFileInfo &fileinfo) const
 {
@@ -416,26 +428,6 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo) const
 }
 
 /*!
-    Returns true if this QFileInfo object refers to a file in the same
-    location as \a fileinfo; otherwise returns false.
-
-    Note that the result of comparing two empty QFileInfo objects,
-    containing no file references, is undefined.
-
-    \warning This will not compare two different symbolic links
-    pointing to the same file.
-
-    \warning Long and short file names that refer to the same file on Windows
-    are treated as if they referred to different files.
-
-    \sa operator!=()
-*/
-bool QFileInfo::operator==(const QFileInfo &fileinfo)
-{
-    return const_cast<const QFileInfo *>(this)->operator==(fileinfo);
-}
-
-/*!
     Makes a copy of the given \a fileinfo and assigns it to this QFileInfo.
 */
 QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo)
@@ -996,7 +988,7 @@ bool QFileInfo::isBundle() const
     shortcut on Windows); otherwise returns false.
 
     On Unix (including Mac OS X), opening a symlink effectively opens
-    the \l{symLinkTarget()}{link's target}. On Windows, it opens the \c
+    the \l{readLink()}{link's target}. On Windows, it opens the \c
     .lnk file itself.
 
     Example:
@@ -1006,7 +998,7 @@ bool QFileInfo::isBundle() const
     \note If the symlink points to a non existing file, exists() returns
      false.
 
-    \sa isFile(), isDir(), symLinkTarget()
+    \sa isFile(), isDir(), readLink()
 */
 bool QFileInfo::isSymLink() const
 {
index 8cd6c6c..3011c69 100644 (file)
@@ -73,9 +73,7 @@ public:
     inline QFileInfo&operator=(QFileInfo &&other)
     { qSwap(d_ptr, other.d_ptr); return *this; }
 #endif
-    bool operator==(const QFileInfo &fileinfo); // 5.0 - remove me
     bool operator==(const QFileInfo &fileinfo) const;
-    inline bool operator!=(const QFileInfo &fileinfo) { return !(operator==(fileinfo)); } // 5.0 - remove me
     inline bool operator!=(const QFileInfo &fileinfo) const { return !(operator==(fileinfo)); }
 
     void setFile(const QString &file);
@@ -116,7 +114,6 @@ public:
     bool isBundle() const;
 
     QString readLink() const;
-    inline QString symLinkTarget() const { return readLink(); }
 
     QString owner() const;
     uint ownerId() const;
index 6c8375a..7d438e4 100644 (file)
@@ -88,7 +88,7 @@ QString QFileSystemEngine::slowCanonicalized(const QString &path)
             !nonSymlinks.contains(prefix)) {
             fi.setFile(prefix);
             if (fi.isSymLink()) {
-                QString target = fi.symLinkTarget();
+                QString target = fi.readLink();
                 if(QFileInfo(target).isRelative())
                     target = fi.absolutePath() + slash + target;
                 if (separatorPos != -1) {
index ff8d94c..d9a6ef7 100644 (file)
@@ -56,7 +56,6 @@ QT_BEGIN_NAMESPACE
     the subset that the win/unix kernel allows.
 
     On Unix this will be a file name
-    On Symbian key will be truncated to 80 characters
   */
 QString
 QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
index e2aa234..cd0f78a 100644 (file)
@@ -58,7 +58,7 @@ public:
     enum Algorithm {
         Md4,
         Md5,
-        Sha1 = 2,
+        Sha1,
         Sha224,
         Sha256,
         Sha384,
index 7c56f1e..4fccff6 100644 (file)
@@ -595,7 +595,7 @@ QStringList QDesignerPluginManager::findPlugins(const QString &path)
     for (QFileInfoList::const_iterator it = infoList.constBegin(); it != icend; ++it) {
         QString fileName;
         if (it->isSymLink()) {
-            const QFileInfo linkTarget = QFileInfo(it->symLinkTarget());
+            const QFileInfo linkTarget = QFileInfo(it->readLink());
             if (linkTarget.exists() && linkTarget.isFile())
                 fileName = linkTarget.absoluteFilePath();
         } else {
index 14554da..f2654b6 100644 (file)
@@ -249,7 +249,7 @@ QExtendedInformation QFileInfoGatherer::getInfo(const QFileInfo &fileInfo) const
 #endif
 
     if (m_resolveSymlinks && info.isSymLink(/* ignoreNtfsSymLinks = */ true)) {
-        QFileInfo resolvedInfo(fileInfo.symLinkTarget());
+        QFileInfo resolvedInfo(fileInfo.readLink());
         resolvedInfo = resolvedInfo.canonicalFilePath();
         if (resolvedInfo.exists()) {
             emit nameResolved(fileInfo.filePath(), resolvedInfo.fileName());
index b1b414a..cc956a5 100644 (file)
@@ -1140,7 +1140,7 @@ QIcon QDirModel::fileIcon(const QModelIndex &index) const
   information about the symbolic link itself, regardless of whether
   resolveSymlinks is enabled or not.
 
-  \sa QFileInfo::symLinkTarget()
+  \sa QFileInfo::readLink()
 */
 
 QFileInfo QDirModel::fileInfo(const QModelIndex &index) const
@@ -1205,7 +1205,7 @@ QVector<QDirModelPrivate::QDirNode> QDirModelPrivate::children(QDirNode *parent,
     } else if (parent->info.isDir()) {
         //resolve directory links only if requested.
         if (parent->info.isSymLink() && resolveSymlinks) {
-            QString link = parent->info.symLinkTarget();
+            QString link = parent->info.readLink();
             if (link.size() > 1 && link.at(link.size() - 1) == QDir::separator())
                 link.chop(1);
             if (stat)
@@ -1382,11 +1382,11 @@ QFileInfo QDirModelPrivate::resolvedInfo(QFileInfo info)
 {
 #ifdef Q_OS_WIN
     // On windows, we cannot create a shortcut to a shortcut.
-    return QFileInfo(info.symLinkTarget());
+    return QFileInfo(info.readLink());
 #else
     QStringList paths;
     do {
-        QFileInfo link(info.symLinkTarget());
+        QFileInfo link(info.readLink());
         if (link.isRelative())
             info.setFile(info.absolutePath(), link.filePath());
         else
index b92ef62..8986471 100644 (file)
@@ -1644,7 +1644,7 @@ bool runningUnderDebugger()
     const QString parentProc = QLatin1String("/proc/") + QString::number(getppid());
     const QFileInfo parentProcExe(parentProc + QLatin1String("/exe"));
     if (parentProcExe.isSymLink())
-        return parentProcExe.symLinkTarget().endsWith(QLatin1String("/gdb"));
+        return parentProcExe.readLink().endsWith(QLatin1String("/gdb"));
     QFile f(parentProc + QLatin1String("/cmdline"));
     if (!f.open(QIODevice::ReadOnly))
         return false;
index 0a3a42b..4c53184 100644 (file)
@@ -41,7 +41,6 @@
 
 #include <qplatformdefs.h>
 #include <qabstractspinbox_p.h>
-#include <qdatetime_p.h>
 #include <qlineedit_p.h>
 #include <qabstractspinbox.h>