From 20436c7b5884b173f9468590c361eebb32906298 Mon Sep 17 00:00:00 2001 From: Jesse Litton Date: Sat, 17 Mar 2018 11:32:56 -0500 Subject: [PATCH] v0.9.7.1 Fixed playing a sound at double volume (actually playing it twice overlapping) when you have two chars in local seeing the same alert. Fixed misparsing of questions that included 'clear' in them, such as "Is KBP clr?". BTW, KBP is never clear. Fixed "*DEBUGGING*" entries accidentally inserted in channel list. --- data/dictionaries/common | 1 + docs/JUMPBRIDGES | 25 +++ docs/RELEASES | 10 + src/eventthread.cpp | 95 ++++++++++ src/eventthread.h | 43 +++++ src/imp.pro | 12 +- src/mainwindow.cpp | 401 +++++++++++++++++++++------------------ src/mainwindow.h | 6 + src/meta.h | 4 +- src/msg.h | 50 +++++ src/options.cpp | 2 +- src/parser.h | 47 +---- 12 files changed, 460 insertions(+), 236 deletions(-) create mode 100644 docs/JUMPBRIDGES create mode 100644 src/eventthread.cpp create mode 100644 src/eventthread.h create mode 100644 src/msg.h diff --git a/data/dictionaries/common b/data/dictionaries/common index d568c38..e95c0ae 100755 --- a/data/dictionaries/common +++ b/data/dictionaries/common @@ -10,6 +10,7 @@ in is no on +pi ship ships shiptype diff --git a/docs/JUMPBRIDGES b/docs/JUMPBRIDGES new file mode 100644 index 0000000..a60747f --- /dev/null +++ b/docs/JUMPBRIDGES @@ -0,0 +1,25 @@ +Jumpbridge data should be stored in a plain text file, named the same as the +map (except all lowercase). The file should be placed in the directory +pointed to in settings|options|map(tab)|"Bridge Data". + +For instance, if your bridge data directory is set to +"http://eternaldusk.com/imp/jb/", a map for Providence would be located in +the file at "http://eternaldusk.com/imp/jb/providence". + +The contents of the file should follow this format: + +FirstSystem=SecondSystem:#RGBcolorInHex + + +Example: + +3D-CQU=9UY4-H:#0F00FF +3KB-J0=AY-YCU:#804030 +49GC-R=8B-VLX:#1F00EF +5KG-PY=QBL-BV:#2F00DF +7YWV-S=N8XA-L:#3F00CF +... + +You can "comment-out" bridges that are temporarily down by replacing the +'=' with another character, like '?'. For instance "3D-CQU?9UY4-H:#0F00FF" +would not be shown on the map and would be ignored. diff --git a/docs/RELEASES b/docs/RELEASES index 1459b9f..97b3b0c 100644 --- a/docs/RELEASES +++ b/docs/RELEASES @@ -1,3 +1,13 @@ +0.9.7.1 - Fixed playing a sound at double volume (actually + playing it twice overlapping) when you have two chars + in local seeing the same alert. + + Fixed misparsing of questions that included 'clear' in + them, such as "Is KBP clr?". BTW, KBP is never clear. + + Fixed "*DEBUGGING*" entries accidentally inserted in + channel list. + 0.9.7 - Changed log watching logic to further work around the post-Vista behavior where NTFS does not update file modification times until the handle is closed. Hopefully diff --git a/src/eventthread.cpp b/src/eventthread.cpp new file mode 100644 index 0000000..75e8234 --- /dev/null +++ b/src/eventthread.cpp @@ -0,0 +1,95 @@ +#include "eventthread.h" + +EventThread::EventThread(QObject *parent) : QThread(parent) +{ + messagesReady = false; + abort = false; +} + +EventThread::~EventThread() +{ + mutex.lock(); + abort = true; + condition.wakeOne(); + mutex.unlock(); + + wait(); +} + +void EventThread::run() +{ + forever { + mutex.lock(); + QList messages = this->messages; + this->messages.clear(); + mutex.unlock(); + + foreach (MessageInfo message, messages) + { + + } + + mutex.lock(); + if (!messagesReady) + condition.wait(&mutex); + messagesReady = false; + mutex.unlock(); + } +} + + +void EventThread::handleEvents(QList messages) +{ + QMutexLocker locker(&mutex); + + this->messages.append(messages); + + if (!isRunning()) { + start(LowPriority); + } + else { + messagesReady = true; + condition.wakeOne(); + } +} + +/* +void EventThread::initParsing() +{ + chatModel->removeRows(0,chatModel->rowCount()); + + if(parser != NULL) + { + parser->deleteLater(); + } + parser = new Parser(++parserGeneration, this); + parser->setMap(*regionMap); + connect(parser, &Parser::newMessages, this, &MainWindow::receiveMessages); + + if(lc != NULL) + { + lc->deleteLater(); + } + lc = new LogCatcher(&options); + + lc->setLogDir(options.getLogPath()); +#ifdef USE_FALLBACK_POLLER + lc->setPollerRefresh(options.getPollerRefresh()); +#endif + + connect(lc, &LogCatcher::fileChanged, + this, &MainWindow::fileChanged); + + // Initialize with last session if not old... + foreach(QString absoluteFilePath, lc->files()) + { + if((options.getIntelChannels().contains(shortName(absoluteFilePath)) && + options.getInitOldIntel()) || + parser->getLocalChannels().contains(shortName(absoluteFilePath))) + { + fileChanged(absoluteFilePath); + } + } + +} +*/ diff --git a/src/eventthread.h b/src/eventthread.h new file mode 100644 index 0000000..521edae --- /dev/null +++ b/src/eventthread.h @@ -0,0 +1,43 @@ +#ifndef EVENTTHREAD_H +#define EVENTTHREAD_H + +#include +#include +#include +#include +#include +#include +#include + +#include "msg.h" // MessageInfo definition + +class EventThread : public QThread +{ + Q_OBJECT +public: + explicit EventThread(QObject *parent = nullptr); + ~EventThread(); + + void handleEvents(QList messages); + void initParsing(); + +signals: + +public slots: + +protected: + void run() override; + +private: + + // Thread Control + bool abort; + bool messagesReady; + QMutex mutex; + QWaitCondition condition; + + QList messages; + QMap soundLastPlayed; +}; + +#endif // EVENTTHREAD_H diff --git a/src/imp.pro b/src/imp.pro index a376881..6f419fa 100644 --- a/src/imp.pro +++ b/src/imp.pro @@ -13,7 +13,7 @@ QT += xml xmlpatterns svg widgets TARGET = imp TEMPLATE = app -VERSION = 0.9.7 +VERSION = 0.9.7.2 QMAKE_TARGET_COMPANY = EternalDusk QMAKE_TARGET_DESCRIPTION = Eve Online Intelligence Management Program QMAKE_TARGET_COPYRIGHT = (c) Copyright 2016-2017 Jesse Litton @@ -69,7 +69,8 @@ SOURCES += \ combodelegate.cpp \ volumedelegate.cpp \ playdelegate.cpp \ - debugmessage.cpp + debugmessage.cpp \ + eventthread.cpp HEADERS += \ mainwindow.h \ @@ -102,7 +103,9 @@ HEADERS += \ combodelegate.h \ volumedelegate.h \ playdelegate.h \ - debugmessage.h + debugmessage.h \ + eventthread.h \ + msg.h FORMS += \ mainwindow.ui \ @@ -135,7 +138,8 @@ DISTFILES += \ ../docs/THEMES \ ../docs/CREDITS \ ../docs/DICTIONARIES \ - ../INSTALL.md + ../INSTALL.md \ + ../docs/JUMPBRIDGES RESOURCES += \ resources.qrc diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4d20c0a..f836bfa 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -533,7 +533,7 @@ void MainWindow::gotRblReply(QString name, bool rbl, int corpNum) if(rbl) { - audio.playLocalFile(options.getSoundIsKos()); + playLocalFileDeduped(options.getSoundIsKos()); kosSoundPlayed = true; MessageInfo info; @@ -565,7 +565,7 @@ void MainWindow::gotRblReply(QString name, bool rbl, int corpNum) } else { - audio.playLocalFile(options.getSoundNoKos()); + playLocalFileDeduped(options.getSoundNoKos()); } } } @@ -575,7 +575,7 @@ void MainWindow::gotKosError(const QString& pilotNames) QSet pilots = pilotNames.split(',').toSet(); pilotsBeingChecked -= pilots.count(); - audio.playLocalFile(options.getSoundIncompleteKos()); + playLocalFileDeduped(options.getSoundIncompleteKos()); } void MainWindow::gotKosReply(const QString& pilotNames, const QList& entries) @@ -641,12 +641,12 @@ void MainWindow::gotKosReply(const QString& pilotNames, const QList& e if(playKos && kosSoundPlayed != true) { - audio.playLocalFile(options.getSoundIsKos()); + playLocalFileDeduped(options.getSoundIsKos()); kosSoundPlayed = true; } else if(pilotsBeingChecked == 0) { - audio.playLocalFile(options.getSoundNoKos()); + playLocalFileDeduped(options.getSoundNoKos()); } } @@ -670,7 +670,7 @@ void MainWindow::gotEssReply(const QString&, const QList& entries) } if(playKos) { - audio.playLocalFile(options.getSoundEss()); + playLocalFileDeduped(options.getSoundEss()); } } @@ -1008,247 +1008,279 @@ QString MainWindow::shortName(const QString &absoluteFilePath) return fileName.left(fileName.length()-20); } -void MainWindow::receiveMessages(QList messages) +void MainWindow::playLocalFileDeduped(const QString &fileName, float volume) { - foreach (MessageInfo message, messages) + qint64 currentTime = QDateTime::currentDateTime().toMSecsSinceEpoch(); + if(!soundLastPlayed.contains(fileName)) { - // If they switch regions while parsing messages, - // discard the ones on the queue. - if(message.parserGeneration != parserGeneration) - break; + audio.playLocalFile(fileName, volume); + } + else + { + qint64 cutoffTime = soundLastPlayed[fileName] + 500; + if(cutoffTime < currentTime) + { + audio.playLocalFile(fileName, volume); + } + } - if(!mapLoading) - doUserActions(message); + soundLastPlayed[fileName] = currentTime; +} + +void MainWindow::processMessage(MessageInfo message) +{ + // If they switch regions while parsing messages, + // discard the ones on the queue. + if(message.parserGeneration != parserGeneration) + return; + + if(!mapLoading) + doUserActions(message); - bool toBeAddedToList = false; - foreach(MessageFlag flag, message.flags) + bool toBeAddedToList = false; + foreach(MessageFlag flag, message.flags) + { + switch(flag) { - switch(flag) + + case MessageFlag::CLEAR: + if (!options.getIntelChannels().contains(message.logInfo->channel)) { + // Only accept clear messages from intel channels. + break; + } - case MessageFlag::CLEAR: - if (!options.getIntelChannels().contains(message.logInfo->channel)) - { - // Only accept clear messages from intel channels. - break; - } + if (message.flags.contains(MessageFlag::QUERY)) + { + // "Is jeiv clr?" + break; + } - // Someone may respond to a status message without naming the system - // i.e. "soandso > clr" - if(message.systems.length() == 0 && message.text.trimmed().count(" ") == 0) - { - message.systems.append(message.logInfo->systemLastMentioned); - } + // Someone may respond to a status message without naming the system + // i.e. "soandso > clr" + if(message.systems.length() == 0 && message.text.trimmed().count(" ") == 0) + { + message.systems.append(message.logInfo->systemLastMentioned); + } - foreach (QString system, message.systems) - { - changeImpStatus("Clearing " + system + "..."); - regionMap->setSystemStatus(system, SystemStatus::clear, message.dateTime); + foreach (QString system, message.systems) + { + changeImpStatus("Clearing " + system + "..."); + regionMap->setSystemStatus(system, SystemStatus::clear, message.dateTime); - if(system == lastAlertSystem) - { - lastAlertSystem = ""; - } + if(system == lastAlertSystem) + { + lastAlertSystem = ""; } - toBeAddedToList = true; + } + toBeAddedToList = true; - break; + break; - case MessageFlag::ESS: + case MessageFlag::ESS: + { + QString pilot = message.logInfo->pilot; + if(pilotIsEnabled(pilot)) { - QString pilot = message.logInfo->pilot; - if(pilotIsEnabled(pilot)) + if(options.getEssAndKos()) { - if(options.getEssAndKos()) - { - AsyncInfo* kosInfo = new AsyncInfo(manager, this); - connect(kosInfo, &AsyncInfo::kosResultReady, - this, &MainWindow::gotEssReply); - kosInfo->kosCheck(message.related[0]); - } - else - { - audio.playLocalFile(options.getSoundEss()); - } - break; + AsyncInfo* kosInfo = new AsyncInfo(manager, this); + connect(kosInfo, &AsyncInfo::kosResultReady, + this, &MainWindow::gotEssReply); + kosInfo->kosCheck(message.related[0]); + } + else + { + playLocalFileDeduped(options.getSoundEss()); } break; } + break; + } - case MessageFlag::LEFT: - break; + case MessageFlag::LEFT: + break; - case MessageFlag::LOCATION: - break; + case MessageFlag::LOCATION: + break; - case MessageFlag::MOTD: - break; + case MessageFlag::MOTD: + break; - case MessageFlag::POCKET: - // Handled by STATUS. - break; + case MessageFlag::POCKET: + // Handled by STATUS. + break; - case MessageFlag::QUERY: - case MessageFlag::STATUS: + case MessageFlag::QUERY: + case MessageFlag::STATUS: + { + if (!options.getIntelChannels().contains(message.logInfo->channel)) { - if (!options.getIntelChannels().contains(message.logInfo->channel)) - { - break; - } + break; + } - // Expand pockets, if necessary - if (message.flags.contains(MessageFlag::POCKET) && - message.systems.count() >= 1 && - pockets.contains(message.systems[0])) - { - message.systems.append(pockets[message.systems[0]]); - } + // Expand pockets, if necessary + if (message.flags.contains(MessageFlag::POCKET) && + message.systems.count() >= 1 && + pockets.contains(message.systems[0])) + { + message.systems.append(pockets[message.systems[0]]); + } - bool play = false; - foreach (QString system, message.systems) + bool play = false; + foreach (QString system, message.systems) + { + qint64 secondsDiff = message.dateTime.msecsTo( + QDateTime::currentDateTimeUtc() + ) / 1000; + if(secondsDiff < 10) { - qint64 secondsDiff = message.dateTime.msecsTo( - QDateTime::currentDateTimeUtc() - ) / 1000; - if(secondsDiff < 10) + // Test each pilot's location to see if we're in one of the systems. + QStringList pilots = regionMap->pilotsIn(system); + foreach(QString pilot, pilots) { - // Test each pilot's location to see if we're in one of the systems. - QStringList pilots = regionMap->pilotsIn(system); - foreach(QString pilot, pilots) + if(pilotIsEnabled(pilot)) { - if(pilotIsEnabled(pilot)) - { - changeImpStatus("Status requested for " + system + "."); - play = true; - } + changeImpStatus("Status requested for " + system + "."); + play = true; } } } - if (play) - { - audio.playLocalFile(options.getSoundStatus()); - } } - break; + if (play) + { + playLocalFileDeduped(options.getSoundStatus()); + } + } + break; - case MessageFlag::SYSTEM_CHANGE: - if(regionMap->pilotsIn(message.systems[0]).contains(message.logInfo->pilot)) - { - break; + case MessageFlag::SYSTEM_CHANGE: + if(regionMap->pilotsIn(message.systems[0]).contains(message.logInfo->pilot)) + { + break; - // We were already in that system - this is probably just a log file update. - } - changeImpStatus("Updating local system to " + message.systems[0] + "..."); + // We were already in that system - this is probably just a log file update. + } + changeImpStatus("Updating local system to " + message.systems[0] + "..."); - regionMap->setPilotLocation(message.logInfo->pilot, message.systems[0]); + regionMap->setPilotLocation(message.logInfo->pilot, message.systems[0]); - if(!pilotIsEnabled(message.logInfo->pilot)) - { - break; - } + if(!pilotIsEnabled(message.logInfo->pilot)) + { + break; + } - if(options.getAutofollow()) - { - positionTo(message.systems[0]); - } + if(options.getAutofollow()) + { + positionTo(message.systems[0]); + } - if(!mapLoading) - regionMap->update(); - break; + if(!mapLoading) + regionMap->update(); + break; - case MessageFlag::WORMHOLE: + case MessageFlag::WORMHOLE: // if (options.getIntelChannels().contains(message.logInfo->channel)) // toBeAddedToList = true; - if(message.systems.count() > 0 and !message.flags.contains(MessageFlag::QUERY)) + if(message.systems.count() > 0 and !message.flags.contains(MessageFlag::QUERY)) + { + if(message.flags.contains(MessageFlag::CLOSED)) { - if(message.flags.contains(MessageFlag::CLOSED)) - { - ui->mapView->closeWormhole(message.systems[0]); - } - else - { - ui->mapView->openWormhole(message.systems[0]); - } + ui->mapView->closeWormhole(message.systems[0]); } - break; + else + { + ui->mapView->openWormhole(message.systems[0]); + } + } + break; - case MessageFlag::WARNING: - if (options.getIntelChannels().contains(message.logInfo->channel)) + case MessageFlag::WARNING: + if (options.getIntelChannels().contains(message.logInfo->channel)) + { + foreach (QString system, message.systems) { - foreach (QString system, message.systems) + regionMap->setSystemStatus(system, SystemStatus::red, message.dateTime); + qint64 secondsDiff = message.dateTime.msecsTo( + QDateTime::currentDateTimeUtc() + ) / 1000; + if(secondsDiff < 10) { - regionMap->setSystemStatus(system, SystemStatus::red, message.dateTime); - qint64 secondsDiff = message.dateTime.msecsTo( - QDateTime::currentDateTimeUtc() - ) / 1000; - if(secondsDiff < 10) + foreach(QString system, message.systems) { - foreach(QString system, message.systems) + // Test each pilot location to see if it is near affected system + foreach(QString pilot, regionMap->pilotsAndLocation().keys()) { - // Test each pilot location to see if it is near affected system - foreach(QString pilot, regionMap->pilotsAndLocation().keys()) + // Skip pilots that have been disabled from menu. + if(!pilotIsEnabled(pilot)) + continue; + + QString pilotLoc = regionMap->pilotsSystem(pilot); + if(regionMap->contains(pilotLoc) && + options.withinAlarmDistance(regionMap->distanceBetween(pilotLoc, system)) + ) { - // Skip pilots that have been disabled from menu. - if(!pilotIsEnabled(pilot)) - continue; - - QString pilotLoc = regionMap->pilotsSystem(pilot); - if(regionMap->contains(pilotLoc) && - options.withinAlarmDistance(regionMap->distanceBetween(pilotLoc, system)) - ) + changeImpStatus("Setting " + system + " to red."); + + secondsDiff = lastAlertTime.msecsTo( + QDateTime::currentDateTimeUtc() + ) / 1000; + if(!(regionMap->ourCurrentPilots().contains(message.sender) && + options.getSelfSuppress() == true) && + (secondsDiff > options.getRedundantSuppress() || + system != lastAlertSystem)) { - changeImpStatus("Setting " + system + " to red."); - - secondsDiff = lastAlertTime.msecsTo( - QDateTime::currentDateTimeUtc() - ) / 1000; - if(!(regionMap->ourCurrentPilots().contains(message.sender) && - options.getSelfSuppress() == true) && - (secondsDiff > options.getRedundantSuppress() || - system != lastAlertSystem)) - { - qDebug() << "-Alarming for: " << message.originalLine; - qDebug() << "-pilotLoc: " << pilotLoc << " system: " << system; - lastAlertTime = QDateTime::currentDateTimeUtc(); - lastAlertSystem = system; - - Alarm alarm = options.getAlarmForDistance(regionMap->distanceBetween(pilotLoc, system)); - audio.playLocalFile(alarm.file, alarm.volume); - } - - // If this is within alarm distance, let's update the map NOW. - if(!mapLoading) - regionMap->update(); + qDebug() << "-Alarming for: " << message.originalLine; + qDebug() << "-pilotLoc: " << pilotLoc << " system: " << system; + lastAlertTime = QDateTime::currentDateTimeUtc(); + lastAlertSystem = system; + + Alarm alarm = options.getAlarmForDistance(regionMap->distanceBetween(pilotLoc, system)); + playLocalFileDeduped(alarm.file, alarm.volume); } + + // If this is within alarm distance, let's update the map NOW. + if(!mapLoading) + regionMap->update(); } } } } - toBeAddedToList = true; } - break; + toBeAddedToList = true; + } + break; - case MessageFlag::LINK: - if (options.getIntelChannels().contains(message.logInfo->channel)) - toBeAddedToList = true; - break; + case MessageFlag::LINK: + if (options.getIntelChannels().contains(message.logInfo->channel)) + toBeAddedToList = true; + break; - default: - qDebug() << "Unhandled flag " << flag << " found for message: " << message.text; - break; + default: + qDebug() << "Unhandled flag " << flag << " found for message: " << message.text; + break; - } - } - if(toBeAddedToList && message.skipOutput != true) - { - addMessage(message); } + } + if(toBeAddedToList && message.skipOutput != true) + { + addMessage(message); + } +} + +void MainWindow::receiveMessages(QList messages) +{ + // This processes a single parsed log line, which may have been broken into + // multiple messages. - // If we just reloaded, there may be a lot of these, so let's process other - // events to keep the gui responsive until we rewrite multi-threaded. - QCoreApplication::processEvents(QEventLoop::AllEvents, 10); + foreach (MessageInfo message, messages) + { + processMessage(message); } + // If we just reloaded, there may be a lot of these, so let's process other + // events to keep the gui responsive until we rewrite multi-threaded. + QCoreApplication::processEvents(QEventLoop::AllEvents, 10); } void MainWindow::fileChanged(const QString &absoluteFilePath) @@ -1288,6 +1320,7 @@ void MainWindow::fileChanged(const QString &absoluteFilePath) ui->mapView->setLoadText(status); receiveMessages(messages); + //eventThread.handleEvents(messages); } void MainWindow::doUserActions(const MessageInfo& message) @@ -1320,7 +1353,7 @@ void MainWindow::doUserActions(const MessageInfo& message) if(playExp.indexIn(rule.action) != -1) { // This is a sound-playing rule. - audio.playLocalFile(playExp.cap(1).trimmed()); + playLocalFileDeduped(playExp.cap(1).trimmed()); } else { QRegExp launchExp("^launch ([^ ]+) *(.*)$"); diff --git a/src/mainwindow.h b/src/mainwindow.h index 6c2b417..7d1b1e9 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -35,6 +35,7 @@ #include "chatitemdelegate.h" #include "chatmodel.h" #include "debugmessage.h" +//#include "eventthread.h" #include "info.h" #include "finddialog.h" #include "logcatcher.h" @@ -116,6 +117,7 @@ private slots: void on_listView_doubleClicked(const QModelIndex &index); void onPilotLocation(const QString &pilotName, const QString &systemName); void pilotSelected(); + void processMessage(MessageInfo message); void receiveMessages(QList messages); void themeSelected(); void updateChangelog (const QString& url); @@ -230,6 +232,10 @@ private slots: // how to pull it out of the transform matrix and level systems at // restart. qreal m_savedSystemRotation = 0; + + //EventThread eventThread; // Not currently used + QMap soundLastPlayed; + void playLocalFileDeduped(const QString &fileName, float volume = 1.0); }; #endif // MAINWINDOW_H diff --git a/src/meta.h b/src/meta.h index 4d53a94..86c1331 100644 --- a/src/meta.h +++ b/src/meta.h @@ -27,8 +27,8 @@ static const struct Version { Version(){} - QString release = "0.9.7"; //VERSION; - QString name = "Black Exoplanet"; + QString release = "0.9.7.2"; //VERSION; + QString name = "Fool Mental Cookie Crisp"; QString styleHeader1 = ""; QString styleFooter1 = ""; diff --git a/src/msg.h b/src/msg.h new file mode 100644 index 0000000..b96ff8a --- /dev/null +++ b/src/msg.h @@ -0,0 +1,50 @@ +#ifndef MSG_H +#define MSG_H + +#include +#include +#include + +enum MessageFlag { UNKNOWN = 0, + CLEAR, CLOSED, + ESS, + LEFT, LINK, LOCATION, + MOTD, OPEN, POCKET, QUERY, + STATUS, SYSTEM_CHANGE, + WARNING, WORMHOLE + }; + +struct LogInfo +{ + QString channel; + QFileInfo fileInfo; + QString pilot; + QString systemLastMentioned; + qint64 position; +}; + +struct MessageInfo +{ + uint parserGeneration = 0; + bool skipOutput = false; + + QString originalLine; + bool indecipherable = false; + + LogInfo* logInfo; + + QString sender; + QDateTime dateTime; + QString text; + QString markedUpText; + + QStringList systems; + QStringList gates; + QStringList ships; + QStringList related; + QStringList possiblePilots; + + QList flags; +}; + +#endif // MSG_H diff --git a/src/options.cpp b/src/options.cpp index d890e0c..048877f 100755 --- a/src/options.cpp +++ b/src/options.cpp @@ -738,7 +738,7 @@ int Options::getFontSize() QStringList Options::getIntelChannels() { QStringList channels = _intelChannels; - channels.append("*Debugging*"); + //channels.append("*Debugging*"); return channels; } diff --git a/src/parser.h b/src/parser.h index 3ccd25c..bd44100 100755 --- a/src/parser.h +++ b/src/parser.h @@ -33,48 +33,7 @@ #include #include "map.h" - -enum MessageFlag { UNKNOWN = 0, - CLEAR, CLOSED, - ESS, - LEFT, LINK, LOCATION, - MOTD, OPEN, POCKET, QUERY, - STATUS, SYSTEM_CHANGE, - WARNING, WORMHOLE - }; - -struct LogInfo -{ - QString channel; - QFileInfo fileInfo; - QString pilot; - QString systemLastMentioned; - qint64 position; -}; - -struct MessageInfo -{ - uint parserGeneration = 0; - bool skipOutput = false; - - QString originalLine; - bool indecipherable = false; - - LogInfo* logInfo; - - QString sender; - QDateTime dateTime; - QString text; - QString markedUpText; - - QStringList systems; - QStringList gates; - QStringList ships; - QStringList related; - QStringList possiblePilots; - - QList flags; -}; +#include "msg.h" struct ImpWord { @@ -96,11 +55,9 @@ class Parser : public QObject QSet getLocalChannels(); signals: - // This class has been backported to QObject inheritance. - // Maybe I should now look at using signals to fire off the - // messages in a more timely manner. void newMessages(QList messageInfoList); + public slots: void processLine(const QString& line); // For the debugging option