source: ntrip/trunk/BNC/bncapp.cpp@ 149

Last change on this file since 149 was 149, checked in by mervart, 18 years ago

* empty log message *

File size: 1.4 KB
Line 
1
2/* -------------------------------------------------------------------------
3 * BKG NTRIP Client
4 * -------------------------------------------------------------------------
5 *
6 * Class: bncApp
7 *
8 * Purpose: This class implements the main application
9 *
10 * Author: L. Mervart
11 *
12 * Created: 29-Aug-2006
13 *
14 * Changes:
15 *
16 * -----------------------------------------------------------------------*/
17
18#include <iostream>
19#include <QSettings>
20
21#include "bncapp.h"
22
23using namespace std;
24
25// Constructor
26////////////////////////////////////////////////////////////////////////////
27bncApp::bncApp(int argc, char* argv[], bool GUIenabled) :
28 QApplication(argc, argv, GUIenabled) {
29
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 }
40}
41
42// Destructor
43////////////////////////////////////////////////////////////////////////////
44bncApp::~bncApp() {
45 delete _logStream;
46 delete _logFile;
47}
48
49// Write a Program Message
50////////////////////////////////////////////////////////////////////////////
51void bncApp::slotMessage(const QByteArray msg) {
52 if (_logStream) {
53 *_logStream << msg.data() << endl;
54 _logStream->flush();
55 }
56 else {
57 cerr << msg.data() << endl;
58 }
59}
Note: See TracBrowser for help on using the repository browser.