response = FileOperator::IGNORE; \
} else { \
char buf[255]; \
- char *realBuf = strerror_r(errno, buf, 255); \
+ char *realBuf = buf; \
+ if (errno == 255) { \
+ strcpy(buf, tr("File is sequential").toStdString().c_str()); \
+ } else { \
+ realBuf = strerror_r(errno, buf, 255); \
+ } \
emit showErrorPrompt(this, promptString + " " + realBuf + ".", fileName, errno); \
waitOnCond(); \
}
return;
}
- SPECIAL_COPY_ERROR_PROMPT(engine.isSequential(), tr("Cannot copy sequential file %1."), path)
+ SPECIAL_COPY_ERROR_PROMPT(checkSequentialFile(engine), tr("Cannot copy file %1."), path)
if (newFile.exists() && newFile.isDir()) {
SPECIAL_COPY_ERROR_PROMPT(!remove(newPath),
}
+bool FileManipulatorThread::checkSequentialFile(const QFSFileEngine &engine) {
+ errno = 0;
+ if (engine.isSequential()) {
+ if (!errno) errno = 255;
+ return true;
+ }
+
+ return false;
+}
+
+
void FileManipulatorThread::wake() {
startTime += time(0) - waitTime;
waitCond.wakeAll();
#include <QMutex>
#include <QWaitCondition>
#include <QDir>
+#include <QFSFileEngine>
#include <QMap>
#include <QSet>
void waitOnCond();
+ bool checkSequentialFile(const QFSFileEngine &engine);
+
QWaitCondition waitCond;
// files to process by the operation