commit
e833b49209
|
@ -26,10 +26,17 @@ quint64 CBoxMonitor::CounDirSize(const QString& Directory, SBox* Box)
|
||||||
return TotalSize;
|
return TotalSize;
|
||||||
|
|
||||||
QDir Dir(Directory);
|
QDir Dir(Directory);
|
||||||
foreach(const QFileInfo & Info, Dir.entryInfoList(QDir::Files | QDir::Dirs | QDir::Hidden | QDir::NoDotAndDotDot))
|
foreach(const QFileInfo & Info, Dir.entryInfoList(QDir::Files | QDir::Dirs | QDir::Hidden | QDir::System | QDir::NoDotAndDotDot))
|
||||||
{
|
{
|
||||||
if (Info.isDir())
|
if (Info.isDir())
|
||||||
TotalSize += CounDirSize(Info.filePath(), Box);
|
TotalSize += CounDirSize(Info.filePath(), Box);
|
||||||
|
else if (Info.isShortcut())
|
||||||
|
{
|
||||||
|
QFile File(Info.filePath());
|
||||||
|
if (File.open(QFile::ReadOnly))
|
||||||
|
TotalSize += File.size();
|
||||||
|
File.close();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
TotalSize += QFile(Info.filePath()).size();
|
TotalSize += QFile(Info.filePath()).size();
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,6 +166,19 @@ public:
|
||||||
return QFile::open(flags);
|
return QFile::open(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qint64 size() const override
|
||||||
|
{
|
||||||
|
qint64 Size = QFile::size();
|
||||||
|
if (QFileInfo(fileName()).isShortcut())
|
||||||
|
{
|
||||||
|
QFile File(fileName());
|
||||||
|
if (File.open(QFile::ReadOnly))
|
||||||
|
Size = File.size();
|
||||||
|
File.close();
|
||||||
|
}
|
||||||
|
return Size;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CSbieProgressPtr m_pProgress;
|
CSbieProgressPtr m_pProgress;
|
||||||
CArchive* m_pArchive;
|
CArchive* m_pArchive;
|
||||||
|
@ -974,4 +987,4 @@ QString CSandBoxPlus::GetCommandFile(const QString& Command)
|
||||||
Path.prepend(m_FilePath);
|
Path.prepend(m_FilePath);
|
||||||
|
|
||||||
return Path;
|
return Path;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue