| 964 | } |
| 965 | |
| 966 | qint64 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 | |
| 997 | void FileAccess::close() |
| 998 | { |
no test coverage detected