Commit a7aab696 authored by Michael Reeves's avatar Michael Reeves

add base dir

parent 15deb268
......@@ -86,18 +86,18 @@ FileAccess::~FileAccess()
// Two kinds of optimization are applied here:
// 1. Speed: don't ask for data as long as it is not needed or cheap to get.
// When opening a file it is easy enough to ask for details.
// 2. Memory usage: Don't store data that is not needed, and avoid redundancy.
// For recursive directory trees don't store the full path if a parent is available.
// Store urls only if files are not local.
void FileAccess::setFilePrivate(FileAccess* pParent)
{
//This is an internal function which requires a seprate reset call prior to use.
m_fileInfo.setCaching(true);
//convert to absolute path that doesn't depend on the current directory.
if(pParent == nullptr)
m_baseDir = m_fileInfo.absoluteFilePath();
else
m_baseDir = pParent->m_baseDir;
m_fileInfo.makeAbsolute();
m_filePath = pParent == nullptr ? m_fileInfo.absoluteFilePath() : m_fileInfo.fileName();
m_bSymLink = m_fileInfo.isSymLink();
m_pParent = pParent;
......
......@@ -13,6 +13,7 @@
#include "progress.h"
#include <QDir>
#include <QFileInfo>
#include <QDateTime>
#include <QSharedPointer>
......@@ -111,7 +112,8 @@ private:
//long m_fileType; // for testing only
FileAccess* m_pParent;
QFileInfo m_fileInfo;
QDir m_baseDir;
QFileInfo m_fileInfo;
QString m_linkTarget;
QString m_name;
QString m_localCopy;
......
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