Fixes for minor issues found by static analysis
Mostly style issues. I used the following tools to find most of these: - lgtm.com - clang-tidy - cpplint - cppcheck
This commit is contained in:
committed by
Jonathan White
parent
c663b5d5fc
commit
f62e0534a2
@@ -35,6 +35,7 @@
|
||||
IconStruct::IconStruct()
|
||||
: uuid(QUuid())
|
||||
, number(0)
|
||||
, applyTo(ApplyIconToOptions::THIS_ONLY)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -214,9 +214,9 @@ MainWindow::MainWindow()
|
||||
setWindowIcon(filePath()->applicationIcon());
|
||||
m_ui->globalMessageWidget->setHidden(true);
|
||||
// clang-format off
|
||||
connect(m_ui->globalMessageWidget, &MessageWidget::linkActivated, &MessageWidget::openHttpUrl);
|
||||
connect(m_ui->globalMessageWidget, SIGNAL(showAnimationStarted()), m_ui->globalMessageWidgetContainer, SLOT(show()));
|
||||
connect(m_ui->globalMessageWidget, SIGNAL(hideAnimationFinished()), m_ui->globalMessageWidgetContainer, SLOT(hide()));
|
||||
connect(m_ui->globalMessageWidget, &MessageWidget::linkActivated, &MessageWidget::openHttpUrl);
|
||||
connect(m_ui->globalMessageWidget, SIGNAL(showAnimationStarted()), m_ui->globalMessageWidgetContainer, SLOT(show()));
|
||||
connect(m_ui->globalMessageWidget, SIGNAL(hideAnimationFinished()), m_ui->globalMessageWidgetContainer, SLOT(hide()));
|
||||
// clang-format on
|
||||
|
||||
m_clearHistoryAction = new QAction(tr("Clear history"), m_ui->menuFile);
|
||||
@@ -483,10 +483,8 @@ MainWindow::MainWindow()
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
connect(m_ui->tabWidget,
|
||||
SIGNAL(messageGlobal(QString,MessageWidget::MessageType)),
|
||||
this,
|
||||
SLOT(displayGlobalMessage(QString,MessageWidget::MessageType)));
|
||||
connect(m_ui->tabWidget, SIGNAL(messageGlobal(QString,MessageWidget::MessageType)),
|
||||
SLOT(displayGlobalMessage(QString,MessageWidget::MessageType)));
|
||||
// clang-format on
|
||||
|
||||
connect(m_ui->tabWidget, SIGNAL(messageDismissGlobal()), this, SLOT(hideGlobalMessage()));
|
||||
@@ -1322,7 +1320,7 @@ void MainWindow::toggleWindow()
|
||||
// see https://github.com/keepassxreboot/keepassxc/issues/271
|
||||
// and https://bugreports.qt.io/browse/QTBUG-58723
|
||||
// check for !isVisible(), because isNativeMenuBar() does not work with appmenu-qt5
|
||||
const static auto isDesktopSessionUnity = qgetenv("XDG_CURRENT_DESKTOP") == "Unity";
|
||||
static const auto isDesktopSessionUnity = qgetenv("XDG_CURRENT_DESKTOP") == "Unity";
|
||||
|
||||
if (isDesktopSessionUnity && Tools::qtRuntimeVersion() < QT_VERSION_CHECK(5, 9, 0)
|
||||
&& !m_ui->menubar->isVisible()) {
|
||||
|
||||
@@ -98,10 +98,10 @@ MessageBox::Button MessageBox::messageBox(QWidget* parent,
|
||||
|
||||
for (uint64_t b = First; b <= Last; b <<= 1) {
|
||||
if (b & buttons) {
|
||||
QString text = m_buttonDefs[static_cast<Button>(b)].first;
|
||||
QString buttonText = m_buttonDefs[static_cast<Button>(b)].first;
|
||||
QMessageBox::ButtonRole role = m_buttonDefs[static_cast<Button>(b)].second;
|
||||
|
||||
auto buttonPtr = msgBox.addButton(text, role);
|
||||
auto buttonPtr = msgBox.addButton(buttonText, role);
|
||||
m_addedButtonLookup.insert(buttonPtr, static_cast<Button>(b));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user