mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
Fix cppcheck warnings and cleanup suppression config
- redundantAssignment - knownConditionTrueFalse
This commit is contained in:
committed by
Klaus Basan
parent
000bdee457
commit
3774f2b60f
@@ -237,9 +237,10 @@ namespace BlackGui
|
||||
const int all = models.size();
|
||||
|
||||
// maximum
|
||||
int max = CDbStashComponent::MaxModelPublished;
|
||||
const QString maxStr(ui->le_MaxModelsStashed->text());
|
||||
bool okMaxStr = true;
|
||||
int max = maxStr.isEmpty() ? CDbStashComponent::MaxModelPublished : maxStr.toInt(&okMaxStr);
|
||||
if (!maxStr.isEmpty()) { max = maxStr.toInt(&okMaxStr); }
|
||||
if (!okMaxStr || max > all) { max = all; }
|
||||
|
||||
// override description
|
||||
|
||||
@@ -74,8 +74,7 @@ namespace BlackGui
|
||||
|
||||
void CSettingsComponent::initActions()
|
||||
{
|
||||
QAction *a = nullptr;
|
||||
a = new QAction(this);
|
||||
QAction *a = new QAction(this);
|
||||
a->setObjectName("overview");
|
||||
a->setShortcut(QKeySequence(Qt::ALT + Qt::Key_S, Qt::Key_O));
|
||||
connect(a, &QAction::triggered, this, &CSettingsComponent::onActionTriggered);
|
||||
|
||||
@@ -23,12 +23,13 @@ namespace BlackGui
|
||||
{
|
||||
IWindowFinder *IWindowFinder::create()
|
||||
{
|
||||
IWindowFinder *finder = nullptr;
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
finder = new CWindowFinderWindows();
|
||||
IWindowFinder *finder = new CWindowFinderWindows();
|
||||
#elif defined(Q_OS_LINUX)
|
||||
IWindowFinder *finder = nullptr;
|
||||
#elif defined(Q_OS_MACOS)
|
||||
IWindowFinder *finder = nullptr;
|
||||
#endif
|
||||
|
||||
return finder;
|
||||
|
||||
@@ -614,6 +614,7 @@ namespace BlackMisc
|
||||
constexpr bool globalOffsetTest = false;
|
||||
|
||||
const CCallsign cs(situation.getCallsign());
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (!globalOffsetTest && !this->hasTestAltitudeOffset(cs)) { return situation; }
|
||||
CLength os;
|
||||
if (globalOffsetTest)
|
||||
|
||||
@@ -53,8 +53,7 @@ namespace XSwiftBus
|
||||
|
||||
std::string CDBusMessage::getSender() const
|
||||
{
|
||||
const char *sender = nullptr;
|
||||
sender = dbus_message_get_sender(m_message);
|
||||
const char *sender = dbus_message_get_sender(m_message);
|
||||
return sender ? std::string(sender) : std::string();
|
||||
}
|
||||
|
||||
|
||||
Submodule src/xswiftbus/libxplanemp updated: 860edd58f0...ef11f55adc
Reference in New Issue
Block a user