Changeset 5528 in ntrip for trunk/BNC/src/bnccaster.cpp
- Timestamp:
- Nov 6, 2013, 2:57:57 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bnccaster.cpp
r5527 r5528 60 60 // Constructor 61 61 //////////////////////////////////////////////////////////////////////////// 62 bncCaster::bncCaster( const QString& outFileName, int port) {62 bncCaster::bncCaster() { 63 63 64 64 bncSettings settings; … … 67 67 BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 68 68 69 if ( !outFileName.isEmpty() ) { 70 QString lName = outFileName; 71 expandEnvVar(lName); 72 _outFile = new QFile(lName); 73 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) { 74 _outFile->open(QIODevice::WriteOnly | QIODevice::Append); 75 } 76 else { 77 _outFile->open(QIODevice::WriteOnly); 78 } 79 _out = new QTextStream(_outFile); 80 _out->setRealNumberNotation(QTextStream::FixedNotation); 81 } 82 else { 83 _outFile = 0; 84 _out = 0; 85 } 86 87 _port = port; 69 _outFile = 0; 70 _out = 0; 71 reopenOutFile(); 72 73 _port = settings.value("outPort").toInt(); 88 74 89 75 if (_port != 0) { … … 178 164 179 165 QMutexLocker locker(&_mutex); 166 167 reopenOutFile(); 180 168 181 169 unsigned index = 0; … … 561 549 } 562 550 } 551 552 // 553 //////////////////////////////////////////////////////////////////////////// 554 void bncCaster::reopenOutFile() { 555 556 bncSettings settings; 557 558 QString outFileName = settings.value("outFile").toString(); 559 if ( !outFileName.isEmpty() ) { 560 expandEnvVar(outFileName); 561 if (!_outFile || _outFile->fileName() != outFileName) { 562 delete _out; 563 delete _outFile; 564 _outFile = new QFile(outFileName); 565 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) { 566 _outFile->open(QIODevice::WriteOnly | QIODevice::Append); 567 } 568 else { 569 _outFile->open(QIODevice::WriteOnly); 570 } 571 _out = new QTextStream(_outFile); 572 _out->setRealNumberNotation(QTextStream::FixedNotation); 573 } 574 } 575 else { 576 delete _out; _out = 0; 577 delete _outFile; _outFile = 0; 578 } 579 } 580
Note:
See TracChangeset
for help on using the changeset viewer.