Changeset 150 in ntrip


Ignore:
Timestamp:
Sep 8, 2006, 9:19:59 PM (18 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncapp.cpp

    r149 r150  
    1818#include <iostream>
    1919#include <QSettings>
     20#include <QMessageBox>
    2021
    2122#include "bncapp.h"
     
    2829  QApplication(argc, argv, GUIenabled) {
    2930
    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;
    4034}
    4135
     
    5044////////////////////////////////////////////////////////////////////////////
    5145void 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
    5261  if (_logStream) {
    5362    *_logStream << msg.data() << endl;
Note: See TracChangeset for help on using the changeset viewer.