Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan White <support@dmapps.us>2022-10-25 06:46:44 +0300
committerJonathan White <support@dmapps.us>2022-10-28 00:18:31 +0300
commit03f11ce5168c9fef65e736ff8f7fbd03651d5953 (patch)
tree9b70f9331d0d60246aee77f44b683139552d64f1
parent2583cc4aa4fe5c05639d48ee579925af0ff170ce (diff)
Fix clicking links in entry preview panel
* Fixes #8636
-rw-r--r--src/gui/DatabaseWidget.cpp1
-rw-r--r--src/gui/EntryPreviewWidget.cpp23
-rw-r--r--src/gui/EntryPreviewWidget.h1
3 files changed, 16 insertions, 9 deletions
diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp
index d08f1e64e..751aa8847 100644
--- a/src/gui/DatabaseWidget.cpp
+++ b/src/gui/DatabaseWidget.cpp
@@ -197,7 +197,6 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
connect(m_groupSplitter, SIGNAL(splitterMoved(int,int)), SIGNAL(splitterSizesChanged()));
connect(m_previewSplitter, SIGNAL(splitterMoved(int,int)), SIGNAL(splitterSizesChanged()));
connect(this, SIGNAL(currentModeChanged(DatabaseWidget::Mode)), m_previewView, SLOT(setDatabaseMode(DatabaseWidget::Mode)));
- connect(m_previewView, SIGNAL(errorOccurred(QString)), SLOT(showErrorMessage(QString)));
connect(m_previewView, SIGNAL(entryUrlActivated(Entry*)), SLOT(openUrlForEntry(Entry*)));
connect(m_entryView, SIGNAL(viewStateChanged()), SIGNAL(entryViewStateChanged()));
connect(m_groupView, SIGNAL(groupSelectionChanged()), SLOT(onGroupChanged()));
diff --git a/src/gui/EntryPreviewWidget.cpp b/src/gui/EntryPreviewWidget.cpp
index 11de4a60f..d864560dd 100644
--- a/src/gui/EntryPreviewWidget.cpp
+++ b/src/gui/EntryPreviewWidget.cpp
@@ -66,8 +66,6 @@ EntryPreviewWidget::EntryPreviewWidget(QWidget* parent)
m_ui->entryNotesTextEdit->document()->setDocumentMargin(0);
m_ui->groupNotesTextEdit->document()->setDocumentMargin(0);
- connect(m_ui->entryUrlLabel, SIGNAL(linkActivated(QString)), SLOT(openEntryUrl()));
-
connect(m_ui->entryTotpButton, SIGNAL(toggled(bool)), m_ui->entryTotpLabel, SLOT(setVisible(bool)));
connect(m_ui->entryTotpButton, SIGNAL(toggled(bool)), m_ui->entryTotpProgress, SLOT(setVisible(bool)));
connect(m_ui->entryCloseButton, SIGNAL(clicked()), SLOT(hide()));
@@ -77,7 +75,10 @@ EntryPreviewWidget::EntryPreviewWidget(QWidget* parent)
connect(m_ui->toggleGroupNotesButton, SIGNAL(clicked(bool)), SLOT(setGroupNotesVisible(bool)));
connect(m_ui->entryTabWidget, SIGNAL(tabBarClicked(int)), SLOT(updateTabIndexes()), Qt::QueuedConnection);
// Prevent the url from being focused after clicked to allow the Copy Password button to work properly
- connect(m_ui->entryUrlLabel, &QLabel::linkActivated, this, [this] { m_ui->entryTabWidget->setFocus(); });
+ connect(m_ui->entryUrlLabel, &QLabel::linkActivated, this, [this] {
+ openEntryUrl();
+ m_ui->entryTabWidget->setFocus();
+ });
connect(&m_totpTimer, SIGNAL(timeout()), SLOT(updateTotpLabel()));
connect(m_ui->entryAttributesTable, &QTableWidget::itemDoubleClicked, this, [](QTableWidgetItem* item) {
@@ -120,8 +121,12 @@ void EntryPreviewWidget::clear()
void EntryPreviewWidget::setEntry(Entry* selectedEntry)
{
- disconnect(m_currentEntry);
- disconnect(m_currentGroup);
+ if (m_currentEntry) {
+ disconnect(m_currentEntry);
+ }
+ if (m_currentGroup) {
+ disconnect(m_currentGroup);
+ }
m_currentEntry = selectedEntry;
m_currentGroup = nullptr;
@@ -137,8 +142,12 @@ void EntryPreviewWidget::setEntry(Entry* selectedEntry)
void EntryPreviewWidget::setGroup(Group* selectedGroup)
{
- disconnect(m_currentEntry);
- disconnect(m_currentGroup);
+ if (m_currentEntry) {
+ disconnect(m_currentEntry);
+ }
+ if (m_currentGroup) {
+ disconnect(m_currentGroup);
+ }
m_currentEntry = nullptr;
m_currentGroup = selectedGroup;
diff --git a/src/gui/EntryPreviewWidget.h b/src/gui/EntryPreviewWidget.h
index b7a71aa02..901b4a097 100644
--- a/src/gui/EntryPreviewWidget.h
+++ b/src/gui/EntryPreviewWidget.h
@@ -44,7 +44,6 @@ public slots:
void clear();
signals:
- void errorOccurred(const QString& error);
void entryUrlActivated(Entry* entry);
private slots: