From 5ff28cb3a147e6a0cbf422a287f459ebe72dfae2 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 15 Nov 2014 01:18:35 +0100 Subject: [PATCH] refs #288, formatting, minor tweaks, utility methods, tabstops --- src/blackcore/context_settings.h | 1 + src/blackcore/vatsimdatafilereader.cpp | 15 +++++++------- .../components/infowindowcomponent.cpp | 3 ++- src/blackgui/components/logcomponent.h | 1 - .../components/mainkeypadareacomponent.ui | 20 +++++++++++++++++++ src/blackgui/infoarea.h | 4 ++-- src/blackmisc/setnetwork.cpp | 9 +++++++++ src/blackmisc/statusmessage.h | 3 +++ 8 files changed, 45 insertions(+), 11 deletions(-) diff --git a/src/blackcore/context_settings.h b/src/blackcore/context_settings.h index 74b5deab6..9c8bc100a 100644 --- a/src/blackcore/context_settings.h +++ b/src/blackcore/context_settings.h @@ -119,6 +119,7 @@ namespace BlackCore signals: //! Settings have been changed + //! \sa IContextSettings::SettingsType void changedSettings(uint type); public slots: diff --git a/src/blackcore/vatsimdatafilereader.cpp b/src/blackcore/vatsimdatafilereader.cpp index befe3cba4..4db4a8a32 100644 --- a/src/blackcore/vatsimdatafilereader.cpp +++ b/src/blackcore/vatsimdatafilereader.cpp @@ -230,7 +230,7 @@ namespace BlackCore { QMap clientPartsMap = clientPartsToMap(currentLine, clientSectionAttributes); CCallsign callsign = CCallsign(clientPartsMap["callsign"]); - if (callsign.isEmpty()) continue; + if (callsign.isEmpty()) break; BlackMisc::Network::CUser user(clientPartsMap["cid"], clientPartsMap["realname"], callsign); const QString clientType = clientPartsMap["clienttype"].toLower(); if (clientType.isEmpty()) break; // sometimes type is empty @@ -300,7 +300,7 @@ namespace BlackCore if (currentLine.contains("UPDATE")) { QStringList updateParts = currentLine.replace(" ", "").split('='); - if (updateParts.length() < 2) continue; + if (updateParts.length() < 2) break; QString dts = updateParts.at(1).trimmed(); updateTimestampFromFile = QDateTime::fromString(dts, "yyyyMMddHHmmss"); updateTimestampFromFile.setOffsetFromUtc(0); @@ -313,9 +313,10 @@ namespace BlackCore { // ident:hostname_or_IP:location:name:clients_connection_allowed: QStringList fsdServerParts = currentLine.split(':'); - if (fsdServerParts.size() < 4) continue; - if (!fsdServerParts.at(3).trimmed().contains('1')) continue; // allowed? - BlackMisc::Network::CServer fsdServer(fsdServerParts.at(0), fsdServerParts.at(2), fsdServerParts.at(1), 6809, CUser("id", "real name", "email", "password")); + if (fsdServerParts.size() < 5) break; + if (!fsdServerParts.at(4).trimmed().contains('1')) break; // allowed? + QString description(fsdServerParts.at(2)); // part(3) could be added + BlackMisc::Network::CServer fsdServer(fsdServerParts.at(0), description, fsdServerParts.at(1), 6809, CUser("id", "real name", "email", "password")); fsdServers.push_back(fsdServer); } break; @@ -323,8 +324,8 @@ namespace BlackCore { // hostname_or_IP:location:name:clients_connection_allowed:type_of_voice_server: QStringList voiceServerParts = currentLine.split(':'); - if (voiceServerParts.size() < 3) continue; - if (!voiceServerParts.at(3).trimmed().contains('1')) continue; // allowed? + if (voiceServerParts.size() < 3) break; + if (!voiceServerParts.at(3).trimmed().contains('1')) break; // allowed? BlackMisc::Network::CServer voiceServer(voiceServerParts.at(1), voiceServerParts.at(2), voiceServerParts.at(0), -1, CUser()); voiceServers.push_back(voiceServer); } diff --git a/src/blackgui/components/infowindowcomponent.cpp b/src/blackgui/components/infowindowcomponent.cpp index 00eaacda5..a911a7b4e 100644 --- a/src/blackgui/components/infowindowcomponent.cpp +++ b/src/blackgui/components/infowindowcomponent.cpp @@ -27,7 +27,8 @@ namespace BlackGui * Constructor */ CInfoWindowComponent::CInfoWindowComponent(QWidget *parent) : - QWizardPage(parent), ui(new Ui::InfoWindow) + QWizardPage(parent), + ui(new Ui::InfoWindow) { ui->setupUi(this); this->hide(); diff --git a/src/blackgui/components/logcomponent.h b/src/blackgui/components/logcomponent.h index 21bb0c0c4..c508ffd1e 100644 --- a/src/blackgui/components/logcomponent.h +++ b/src/blackgui/components/logcomponent.h @@ -49,7 +49,6 @@ namespace BlackGui //! Append status message to list void appendStatusMessageToList(const BlackMisc::CStatusMessage &statusMessage); - private: QScopedPointer ui; }; diff --git a/src/blackgui/components/mainkeypadareacomponent.ui b/src/blackgui/components/mainkeypadareacomponent.ui index 0e9ab297e..7840210e1 100644 --- a/src/blackgui/components/mainkeypadareacomponent.ui +++ b/src/blackgui/components/mainkeypadareacomponent.ui @@ -427,6 +427,26 @@ + + le_CommandLineInput + pb_Connect + pb_MainAircrafts + pb_MainAtc + pb_MainUsers + pb_MainTextMessages + pb_MainSimulator + pb_MainFlightplan + pb_MainWeather + pb_MainMappings + pb_MainLog + pb_MainSettings + pb_MainCockpit + pb_CockpitIdent + pb_Opacity100 + pb_Opacity050 + pb_SoundMute + pb_SoundMaxVolume + diff --git a/src/blackgui/infoarea.h b/src/blackgui/infoarea.h index c635c52d8..83abad83b 100644 --- a/src/blackgui/infoarea.h +++ b/src/blackgui/infoarea.h @@ -94,10 +94,10 @@ namespace BlackGui //! Select next right tab void selectRightTab(); - //! Display status message + //! Display status message in all info areas (according their state) void displayStatusMessage(const BlackMisc::CStatusMessage &statusMessage); - //! Display status messages + //! Display status messages in all info areas (according their state) void displayStatusMessages(const BlackMisc::CStatusMessageList &statusMessages); protected: diff --git a/src/blackmisc/setnetwork.cpp b/src/blackmisc/setnetwork.cpp index 7aa736e4e..7b0d26feb 100644 --- a/src/blackmisc/setnetwork.cpp +++ b/src/blackmisc/setnetwork.cpp @@ -1,3 +1,12 @@ +/* Copyright (C) 2013 + * swift Project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + #include "setnetwork.h" #include "blackcore/dbus_server.h" #include "blackmisc/blackmiscfreefunctions.h" diff --git a/src/blackmisc/statusmessage.h b/src/blackmisc/statusmessage.h index 14fbfcd52..99655688e 100644 --- a/src/blackmisc/statusmessage.h +++ b/src/blackmisc/statusmessage.h @@ -81,6 +81,9 @@ namespace BlackMisc //! Message may already have been handled directly bool isRedundant() const { return this->m_redundant; } + //! Info or debug, no warning or error + bool isSeverityInfoOrLess() const { return this->m_severity == SeverityInfo || this->m_severity == SeverityDebug; } + //! Mark the message as having been handled by the given object void markAsHandledBy(const QObject *object) const;