bool ReadThread::internalReopen() { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+QString::number(id)+"] start"); stopIt=false; file.close(); if(size_at_open!=file.size() && mtime_at_open!=QFileInfo(file).lastModified()) { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+QString::number(id)+"] source file have changed since the last open, restart all"); //fix this function like the close function if(internalOpen(true)) { emit resumeAfterErrorByRestartAll(); return true; } else return false; } else { //fix this function like the close function if(internalOpen(false)) { emit resumeAfterErrorByRestartAtTheLastPosition(); return true; } else return false; } }
void XMLHttpRequest::open(const String& method, const String& url, bool async, const String& user, ExceptionCode& ec) { KURL urlWithCredentials(scriptExecutionContext()->completeURL(url)); urlWithCredentials.setUser(user); internalOpen(method, urlWithCredentials, async, ec); }
Interface::Holder Module::internalOpen(const char *uri, Error &error) { char buffer[MaxSchemaLength] = { 'f', 'i', 'l', 'e' }; Interface::Holder res; if (const char *delim = strstr(uri, SchemaDelimiter)) if (delim - uri < MaxSchemaLength) { memcpy(buffer, uri, delim - uri); buffer[delim - uri] = 0; uri = delim + SchemaDelimiterLength; } else return res; auto root = m_protocolPlugins.find(buffer); if (root == m_protocolPlugins.end()) return res; else for (auto i : (*root).second) { res = i->open(uri); if (res.isValid()) break; } if (res.isValid()) res = internalOpen(res); return res; }
AREXPORT bool ArSerialConnection::openSimple(void) { if (internalOpen() == 0) return true; else return false; }
void WriteThread::internalReopen() { ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); internalClose(false); flushBuffer(); stopIt=false; CurentCopiedSize=0; if(internalOpen()) emit reopened(); }
void WriteThread::run() { connect(this,SIGNAL(internalStartOpen()), this,SLOT(internalOpen()), Qt::QueuedConnection); connect(this,SIGNAL(internalStartReopen()), this,SLOT(internalReopen()), Qt::QueuedConnection); connect(this,SIGNAL(internalStartWrite()), this,SLOT(internalWrite()), Qt::QueuedConnection); connect(this,SIGNAL(internalStartClose()), this,SLOT(internalClose()), Qt::QueuedConnection); connect(this,SIGNAL(internalStartEndOfFile()), this,SLOT(internalEndOfFile()), Qt::QueuedConnection); connect(this,SIGNAL(internalStartFlushAndSeekToZero()), this,SLOT(internalFlushAndSeekToZero()),Qt::QueuedConnection); connect(this,SIGNAL(internalStartChecksum()), this,SLOT(checkSum()), Qt::QueuedConnection); exec(); }
void WriteThread::internalReopen() { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start"); std::string tempFile=fileName; internalClose(false); flushBuffer(); stopIt=false; lastGoodPosition=0; fileName=tempFile; if(internalOpen()) emit reopened(); }
void WriteThread::internalReopen() { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); QString tempFile=file.fileName(); internalClose(false); flushBuffer(); stopIt=false; lastGoodPosition=0; file.setFileName(tempFile); if(internalOpen()) emit reopened(); }
void ReadThread::isInWait() { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+QString::number(id)+"] start"); if(seekToZero) { seekToZero=false; if(file.isOpen()) seek(0); else internalOpen(true); emit isSeekToZeroAndWait(); } }
void GeoPackageWriter::open() { log()->get(LogLevel::Debug) << "GeoPackageWriter::open" << std::endl; internalOpen(true); verifyTableExists("gpkg_spatial_ref_sys"); verifyTableExists("gpkg_contents"); verifyTableExists("gpkg_pctile_matrix"); verifyTableExists("gpkg_pctile_matrix_set"); verifyTableExists("gpkg_extensions"); verifyTableExists("gpkg_metadata"); verifyTableExists("gpkg_metadata_reference"); verifyTableExists("gpkg_pctile_dimension_set"); }
QOggSimplePlayer::QOggSimplePlayer(const QString &filePath, QThread *audioThread) { if(audioThread!=NULL) moveToThread(audioThread); needPlay=false; volume=0; output=NULL; loop=false; buffer.open(QIODevice::ReadWrite|QIODevice::Unbuffered); this->filePath=filePath; connect(&buffer,&QOggAudioBuffer::readDone,this,&QOggSimplePlayer::readDone,Qt::QueuedConnection); connect(this,&QOggSimplePlayer::internalOpen,this,&QOggSimplePlayer::open,Qt::QueuedConnection); connect(this,&QOggSimplePlayer::emitInternalStart,this,&QOggSimplePlayer::internalStart,Qt::QueuedConnection); connect(this,&QOggSimplePlayer::emitInternalStop,this,&QOggSimplePlayer::internalStop,Qt::QueuedConnection); if(audioThread!=NULL) connect(this,&QOggSimplePlayer::internalClose,this,&QOggSimplePlayer::close,Qt::BlockingQueuedConnection); else connect(this,&QOggSimplePlayer::internalClose,this,&QOggSimplePlayer::close,Qt::DirectConnection); emit internalOpen(); }
void XMLHttpRequest::open(const String& method, const String& url, bool async, ExceptionCode& ec) { internalOpen(method, scriptExecutionContext()->completeURL(url), async, ec); }
/** @param host the host to connect to, if NULL (default) then localhost @param port the port to connect to @return 0 for success, otherwise one of the open enums @see getOpenMessage */ AREXPORT int ArTcpConnection::open(const char *host, int port) { setPort(host, port); return internalOpen(); }
bool File::Create(bool overwrite) { return internalOpen(overwrite ? CREATE_ALWAYS : CREATE_NEW); }
bool File::Open() { return internalOpen(OPEN_EXISTING); }
bool ReadThread::internalOpenSlot() { return internalOpen(); }
/** @param port The serial port to connect to, or NULL which defaults to COM1 for windows and /dev/ttyS0 for linux @return 0 for success, otherwise one of the open enums @see getOpenMessage */ AREXPORT int ArSerialConnection::open(const char *port) { setPort(port); return internalOpen(); }
/** @param fname the file to connect to, if NULL (default) then robot.log @return 0 for success, otherwise one of the open enums @see getOpenMessage */ AREXPORT int ArLogFileConnection::open(const char *fname) { setLogFile(fname); return internalOpen(); }