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

Method read

src/fileaccess.cpp:966–995  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

964}
965
966qint64 FileAccess::read(char* data, const qint64 maxlen)
967{
968 setStatusText("");
969
970 if(!isNormal())
971 {
972 //This is not an error special files should be skipped
973 return 0;
974 }
975
976 qint64 len = 0;
977 if(m_localCopy.isEmpty() && realFile != nullptr)
978 {
979 len = realFile->read(data, maxlen);
980 if(len != maxlen)
981 {
982 setStatusText(i18n("Error reading from %1. %2", absoluteFilePath(), realFile->errorString()));
983 }
984 }
985 else
986 {
987 len = tmpFile->read(data, maxlen);
988 if(len != maxlen)
989 {
990 setStatusText(i18n("Error reading from %1. %2", absoluteFilePath(), tmpFile->errorString()));
991 }
992 }
993
994 return len;
995}
996
997void FileAccess::close()
998{

Callers 2

detectEncodingMethod · 0.45
fastFileComparisonMethod · 0.45

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected