Changeset 150 in ntrip
- Timestamp:
- Sep 8, 2006, 9:19:59 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncapp.cpp
r149 r150 18 18 #include <iostream> 19 19 #include <QSettings> 20 #include <QMessageBox> 20 21 21 22 #include "bncapp.h" … … 28 29 QApplication(argc, argv, GUIenabled) { 29 30 30 _logFile = 0; 31 _logStream = 0; 32 QSettings settings; 33 QString logFileName = settings.value("logFile").toString(); 34 if ( !logFileName.isEmpty() ) { 35 _logFile = new QFile(logFileName); 36 _logFile->open(QIODevice::WriteOnly); 37 _logStream = new QTextStream(); 38 _logStream->setDevice(_logFile); 39 } 31 _logFileFlag = 0; 32 _logFile = 0; 33 _logStream = 0; 40 34 } 41 35 … … 50 44 //////////////////////////////////////////////////////////////////////////// 51 45 void bncApp::slotMessage(const QByteArray msg) { 46 47 // First time resolve the log file name 48 // ------------------------------------ 49 if (_logFileFlag == 0) { 50 _logFileFlag = 1; 51 QSettings settings; 52 QString logFileName = settings.value("logFile").toString(); 53 if ( !logFileName.isEmpty() ) { 54 _logFile = new QFile(logFileName); 55 _logFile->open(QIODevice::WriteOnly); 56 _logStream = new QTextStream(); 57 _logStream->setDevice(_logFile); 58 } 59 } 60 52 61 if (_logStream) { 53 62 *_logStream << msg.data() << endl;
Note:
See TracChangeset
for help on using the changeset viewer.