void LogData::attachFile( const QString& fileName ) { LOG(logDEBUG) << "LogData::attachFile " << fileName.toStdString(); if ( attached_file_ ) { // We cannot reattach throw CantReattachErr(); } attached_file_.reset( new QFile( fileName ) ); attached_file_->open( QIODevice::ReadOnly ); std::shared_ptr<const LogDataOperation> operation( new AttachOperation( fileName ) ); enqueueOperation( std::move( operation ) ); }
void LogData::attachFile( const QString& fileName ) { LOG(logDEBUG) << "LogData::attachFile " << fileName.toStdString(); if ( attached_file_ ) { // We cannot reattach throw CantReattachErr(); } indexingFileName_ = fileName; attached_file_.reset( new QFile( fileName ) ); openFileByHandle( attached_file_.get() ); attached_file_id_ = getFileId( indexingFileName_ ); std::shared_ptr<const LogDataOperation> operation( new AttachOperation( fileName ) ); enqueueOperation( std::move( operation ) ); }