Commit 906e03f3 authored by Michael Reeves's avatar Michael Reeves

remove m_filepath

parent a7aab696
......@@ -156,7 +156,7 @@ class MergeFileInfos
//bool operator>( const MergeFileInfos& );
QString subPath() const
{
return m_pFileInfoA && m_pFileInfoA->exists() ? m_pFileInfoA->filePath() : m_pFileInfoB && m_pFileInfoB->exists() ? m_pFileInfoB->filePath() : m_pFileInfoC && m_pFileInfoC->exists() ? m_pFileInfoC->filePath() : QString("");
return m_pFileInfoA && m_pFileInfoA->exists() ? m_pFileInfoA->fileRelPath() : m_pFileInfoB && m_pFileInfoB->exists() ? m_pFileInfoB->fileRelPath() : m_pFileInfoC && m_pFileInfoC->exists() ? m_pFileInfoC->fileRelPath() : QString("");
}
QString fileName() const
{
......
......@@ -57,7 +57,6 @@ FileAccess::FileAccess()
void FileAccess::reset(void)
{
m_fileInfo = QFileInfo();
m_filePath = "";
m_bExists = false;
m_bFile = false;
m_bDir = false;
......@@ -173,7 +172,6 @@ void FileAccess::setFile(const QString& name, bool bWantToWrite)
FileAccessJobHandler jh(this); // A friend, which writes to the parameters of this class!
jh.stat(2 /*all details*/, bWantToWrite); // returns bSuccess, ignored
m_filePath = name;
m_bValidData = true; // After running stat() the variables are initialised
// and valid even if the file doesn't exist and the stat
// query failed.
......@@ -227,6 +225,8 @@ void FileAccess::setUdsEntry(const KIO::UDSEntry& e)
long acc = 0;
long fileType = 0;
QVector<uint> fields = e.fields();
QString filePath;
for(QVector<uint>::ConstIterator ei = fields.constBegin(); ei != fields.constEnd(); ++ei)
{
uint f = *ei;
......@@ -236,7 +236,7 @@ void FileAccess::setUdsEntry(const KIO::UDSEntry& e)
m_size = e.numberValue(f);
break;
case KIO::UDSEntry::UDS_NAME:
m_filePath = e.stringValue(f);
filePath = e.stringValue(f);
break; // During listDir the relative path is given here.
case KIO::UDSEntry::UDS_MODIFICATION_TIME:
m_modificationTime = QDateTime::fromMSecsSinceEpoch(e.numberValue(f));
......@@ -278,7 +278,7 @@ void FileAccess::setUdsEntry(const KIO::UDSEntry& e)
}
}
m_fileInfo = QFileInfo(m_filePath);
m_fileInfo = QFileInfo(filePath);
m_fileInfo.setCaching(true);
if(m_url.isEmpty())
m_url = QUrl::fromUserInput(m_fileInfo.absoluteFilePath());
......@@ -304,7 +304,7 @@ void FileAccess::setUdsEntry(const KIO::UDSEntry& e)
bool FileAccess::isValid() const
{
return !m_filePath.isEmpty() || m_bValidData;
return m_bValidData;
}
bool FileAccess::isNormal() const
......@@ -425,12 +425,13 @@ QString FileAccess::fileName(bool needTmp) const
return m_fileInfo.fileName();
}
QString FileAccess::filePath() const
QString FileAccess::fileRelPath() const
{
if(parent() && parent()->parent())
return parent()->filePath() + "/" + m_filePath;
else
return m_filePath; // The path-string that was used during construction
QString basePath = m_baseDir.canonicalPath();
QString filePath = m_fileInfo.canonicalFilePath();
QString path = filePath.replace(basePath + "/", QLatin1String(""));
return path;
}
FileAccess* FileAccess::parent() const
......@@ -1227,14 +1228,7 @@ bool FileAccessJobHandler::listDir(t_DirectoryList* pDirList, bool bRecursive, b
t_DirectoryList dirList;
i->listDir(&dirList, bRecursive, bFindHidden,
filePattern, fileAntiPattern, dirAntiPattern, bFollowDirLinks, bUseCvsIgnore);
t_DirectoryList::iterator j;
for(j = dirList.begin(); j != dirList.end(); ++j)
{
if(j->parent() == nullptr)
j->m_filePath = i->fileName() + "/" + j->m_filePath;
}
// append data onto the main list
subDirsList.splice(subDirsList.end(), dirList);
}
......
......@@ -65,7 +65,7 @@ public:
QDateTime lastModified() const;
QString fileName(bool needTmp = false) const; // Just the name-part of the path, without parent directories
QString filePath() const; // The path-string that was used during construction
QString fileRelPath() const; // The path relitive to base comparison directory
QString prettyAbsPath() const;
QUrl url() const;
QString absoluteFilePath() const;
......@@ -119,7 +119,6 @@ private:
QString m_localCopy;
QSharedPointer<QTemporaryFile> tmpFile;
QString m_filePath; // might be absolute or relative if m_pParent!=0
qint64 m_size;
QDateTime m_modificationTime;
bool m_bSymLink : 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment