From 5cf50d9fae914cb87aca3a553cfc268015609934 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Fri, 22 Feb 2019 15:46:01 -0500 Subject: [PATCH] Multiple code improvements * Fixed unending timer in BulkFileWatcher causing high CPU usage after first save * Fix multiple SIGNAL connections found with GammaRay * Remove horizontal scrollbar from EditWidget due to ghosting (maybe Qt bug) --- src/core/FileWatcher.cpp | 1 + src/gui/EditWidget.cpp | 1 + src/gui/EditWidgetIcons.cpp | 1 - src/gui/entry/EditEntryWidget.cpp | 2 +- 4 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/FileWatcher.cpp b/src/core/FileWatcher.cpp index d7056f9c7..64e86c3fa 100644 --- a/src/core/FileWatcher.cpp +++ b/src/core/FileWatcher.cpp @@ -123,6 +123,7 @@ BulkFileWatcher::BulkFileWatcher(QObject* parent) connect(&m_fileWatchUnblockTimer, SIGNAL(timeout()), this, SLOT(observeFileChanges())); connect(&m_pendingSignalsTimer, SIGNAL(timeout()), this, SLOT(emitSignals())); m_fileWatchUnblockTimer.setSingleShot(true); + m_pendingSignalsTimer.setSingleShot(true); } void BulkFileWatcher::clear() diff --git a/src/gui/EditWidget.cpp b/src/gui/EditWidget.cpp index 6a5765933..be7ea01df 100644 --- a/src/gui/EditWidget.cpp +++ b/src/gui/EditWidget.cpp @@ -59,6 +59,7 @@ void EditWidget::addPage(const QString& labelText, const QIcon& icon, QWidget* w */ auto* scrollArea = new QScrollArea(m_ui->stackedWidget); scrollArea->setFrameShape(QFrame::NoFrame); + scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); scrollArea->setWidget(widget); scrollArea->setWidgetResizable(true); m_ui->stackedWidget->addWidget(scrollArea); diff --git a/src/gui/EditWidgetIcons.cpp b/src/gui/EditWidgetIcons.cpp index 990e480ee..f99fd7b5d 100644 --- a/src/gui/EditWidgetIcons.cpp +++ b/src/gui/EditWidgetIcons.cpp @@ -65,7 +65,6 @@ EditWidgetIcons::EditWidgetIcons(QWidget* parent) connect(m_ui->deleteButton, SIGNAL(clicked()), SLOT(removeCustomIcon())); connect(m_ui->faviconButton, SIGNAL(clicked()), SLOT(downloadFavicon())); - connect(m_ui->defaultIconsRadio, SIGNAL(toggled(bool)), this, SIGNAL(widgetUpdated())); connect(m_ui->defaultIconsRadio, SIGNAL(toggled(bool)), this, SIGNAL(widgetUpdated())); connect(m_ui->defaultIconsView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SIGNAL(widgetUpdated())); diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index c85dbdfa0..d71b3e39e 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -142,6 +142,7 @@ void EditEntryWidget::setupMain() connect(m_mainUi->togglePasswordGeneratorButton, SIGNAL(toggled(bool)), SLOT(togglePasswordGeneratorButton(bool))); #ifdef WITH_XC_NETWORKING connect(m_mainUi->fetchFaviconButton, SIGNAL(clicked()), m_iconsWidget, SLOT(downloadFavicon())); + connect(m_mainUi->urlEdit, SIGNAL(textChanged(QString)), m_iconsWidget, SLOT(setUrl(QString))); #endif connect(m_mainUi->expireCheck, SIGNAL(toggled(bool)), m_mainUi->expireDatePicker, SLOT(setEnabled(bool))); connect(m_mainUi->notesEnabled, SIGNAL(toggled(bool)), this, SLOT(toggleHideNotes(bool))); @@ -764,7 +765,6 @@ void EditEntryWidget::setForms(Entry* entry, bool restore) iconStruct.uuid = entry->iconUuid(); iconStruct.number = entry->iconNumber(); m_iconsWidget->load(entry->uuid(), m_db, iconStruct, entry->webUrl()); - connect(m_mainUi->urlEdit, SIGNAL(textChanged(QString)), m_iconsWidget, SLOT(setUrl(QString))); m_autoTypeUi->enableButton->setChecked(entry->autoTypeEnabled()); if (entry->defaultAutoTypeSequence().isEmpty()) {