UI: ApplicationsPage: Fix PVS-Studio warning.

V807 Decreased performance. Consider creating a pointer to avoid using the 'm_splitter->handle()' expression repeatedly. applicationspage.cpp 93
This commit is contained in:
Nodir Temirkhodjaev 2021-06-19 18:35:44 +03:00
parent 80ca97d41b
commit 92ee005d92

View File

@ -90,13 +90,12 @@ void ApplicationsPage::onRetranslateUi()
m_blockApps->labelTitle()->setText(tr("Block")); m_blockApps->labelTitle()->setText(tr("Block"));
m_allowApps->labelTitle()->setText(tr("Allow")); m_allowApps->labelTitle()->setText(tr("Allow"));
m_splitter->handle()->btMoveAllFrom1To2()->setToolTip(tr("Move All Lines to 'Allow'")); auto splitterHandle = m_splitter->handle();
m_splitter->handle()->btMoveAllFrom2To1()->setToolTip(tr("Move All Lines to 'Block'")); splitterHandle->btMoveAllFrom1To2()->setToolTip(tr("Move All Lines to 'Allow'"));
m_splitter->handle()->btInterchangeAll()->setToolTip(tr("Interchange All Lines")); splitterHandle->btMoveAllFrom2To1()->setToolTip(tr("Move All Lines to 'Block'"));
m_splitter->handle()->btMoveSelectedFrom1To2()->setToolTip( splitterHandle->btInterchangeAll()->setToolTip(tr("Interchange All Lines"));
tr("Move Selected Lines to 'Allow'")); splitterHandle->btMoveSelectedFrom1To2()->setToolTip(tr("Move Selected Lines to 'Allow'"));
m_splitter->handle()->btMoveSelectedFrom2To1()->setToolTip( splitterHandle->btMoveSelectedFrom2To1()->setToolTip(tr("Move Selected Lines to 'Block'"));
tr("Move Selected Lines to 'Block'"));
m_btSelectFile->setToolTip(tr("Select File")); m_btSelectFile->setToolTip(tr("Select File"));
retranslateAppsPlaceholderText(); retranslateAppsPlaceholderText();
@ -523,10 +522,11 @@ void ApplicationsPage::setupSplitter()
m_splitter->addWidget(m_blockApps); m_splitter->addWidget(m_blockApps);
m_splitter->addWidget(m_allowApps); m_splitter->addWidget(m_allowApps);
Q_ASSERT(m_splitter->handle()); auto splitterHandle = m_splitter->handle();
Q_ASSERT(splitterHandle);
m_splitter->handle()->setTextArea1(m_blockApps->editText()); splitterHandle->setTextArea1(m_blockApps->editText());
m_splitter->handle()->setTextArea2(m_allowApps->editText()); splitterHandle->setTextArea2(m_allowApps->editText());
} }
void ApplicationsPage::setupSplitterButtons() void ApplicationsPage::setupSplitterButtons()