53 const int nfreshneeded = 3 -
m_availEvts->freshEvents().count();
54 if (evts.count()>
m_availEvts->maxLocalFilesToKeep()+3&&nfreshneeded<=0) {
61 static unsigned ntmpdlcount = 0;
63 QList<VP1EventFile> freshEvtsInSource =
m_availEvts->freshEvents(evts.front(), evts);
67 bool changestmplocal(
false), changesad(
false);
68 if (!ad.isEmpty()&&!tmplocal.isEmpty()) {
71 QString fn = evt.fileName();
72 QString basefn = QFileInfo(fn).fileName();
73 QString target = tmplocal + basefn;
74 if (!QFile::exists(target)) {
75 QString tmptarget = ad+basefn+
"_"+QString::number(ntmpdlcount++);
76 if (!QFile::copy(fn,tmptarget)) {
77 m_availEvts->message(
"Problems copying "+fn+
" to "+tmptarget);
80 if (!QFile::rename(tmptarget,target)) {
81 m_availEvts->message(
"Problems moving "+tmptarget+
" to "+target+
" directory");
84 if (!QFile::exists(target)) {
85 m_availEvts->message(
"Inconsistent copy of "+basefn+
" to local tmp directory");
88 m_availEvts->messageDebug(
"Copied "+basefn+
" to local tmp directory");
89 changestmplocal =
true;
94 if (ncopied>=nfreshneeded) {
100 m_availEvts->message(
"Problems with temporary local directories.");