MCPcopy Create free account
hub / github.com/KDE/kdiff3 / sizeForReading

Method sizeForReading

src/fileaccess.cpp:1056–1077  ·  view source on GitHub ↗

If the size couldn't be determined by stat() then the file is copied to a local temp file.

Source from the content-addressed store, hash-verified

1054
1055// If the size couldn't be determined by stat() then the file is copied to a local temp file.
1056qint64 FileAccess::sizeForReading()
1057{
1058 if(!isLocal() && m_size == 0 && mPhysicalPath.isEmpty())
1059 {
1060 // Size couldn't be determined. Copy the file to a local temp place.
1061 if(createLocalCopy())
1062 {
1063 const QString localCopy = tmpFile->fileName();
1064 const QFileInfo fi(localCopy);
1065
1066 m_size = fi.size();
1067 m_localCopy = localCopy;
1068 return m_size;
1069 }
1070 else
1071 {
1072 return 0;
1073 }
1074 }
1075 else
1076 return size();
1077}
1078
1079const QString& FileAccess::getStatusText() const
1080{

Callers 1

readFileMethod · 0.45

Calls 3

fileNameMethod · 0.80
isEmptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected