From ec92e19193eb9d69a3cf18979d6434cf04764902 Mon Sep 17 00:00:00 2001 From: kh1 Date: Tue, 14 Oct 2014 16:48:05 +0200 Subject: Some more documentation fixes (removes more warnings). Change-Id: I1efb7f98ac4cccdc4dbd1784806cce286654af9f Reviewed-by: Leena Miettinen --- src/libs/installer/remotefileengine.cpp | 62 ++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 28 deletions(-) (limited to 'src/libs/installer/remotefileengine.cpp') diff --git a/src/libs/installer/remotefileengine.cpp b/src/libs/installer/remotefileengine.cpp index 02469be34..7feff87c0 100644 --- a/src/libs/installer/remotefileengine.cpp +++ b/src/libs/installer/remotefileengine.cpp @@ -79,43 +79,49 @@ public: RemoteFileEngineIterator(QDir::Filters filters, const QStringList &nameFilters, const QStringList &files) : QAbstractFileEngineIterator(filters, nameFilters) - , entries(files) , index(-1) + , entries(files) { } - /*! - \reimp - */ - bool hasNext() const - { - return index < entries.size() - 1; - } - - /*! - \reimp - */ - QString next() - { - if (!hasNext()) - return QString(); - ++index; - return currentFilePath(); - } - - /*! - \reimp - */ - QString currentFileName() const - { - return entries.at(index); - } + QString next(); + bool hasNext() const; + QString currentFileName() const; private: - const QStringList entries; int index; + QStringList entries; }; +/*! + Advances the iterator to the next entry, and returns the current file path of this new + entry. If hasNext() returns \c false, the function does nothing and returns an empty QString. +*/ +bool RemoteFileEngineIterator::hasNext() const +{ + return index < entries.size() - 1; +} + +/*! + Returns \c true if there is at least one more entry in the directory, otherwise returns + \c false. +*/ +QString RemoteFileEngineIterator::next() +{ + if (!hasNext()) + return QString(); + ++index; + return currentFilePath(); +} + +/*! + Returns the name of the current directory entry, excluding the path. +*/ +QString RemoteFileEngineIterator::currentFileName() const +{ + return entries.at(index); +} + // -- RemoteFileEngine -- cgit v1.2.3