Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use custom data to save any browser integration related data #1497

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ add_subdirectory(browser)
add_subdirectory(proxy)
if(WITH_XC_BROWSER)
set(keepassxcbrowser_LIB keepassxcbrowser)
set(keepassx_SOURCES ${keepassx_SOURCES} gui/dbsettings/DatabaseSettingsWidgetBrowser.cpp)
endif()

add_subdirectory(autotype)
Expand Down
12 changes: 0 additions & 12 deletions src/browser/BrowserAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,15 +566,3 @@ QString BrowserAction::incrementNonce(const QString& nonce)
sodium_increment(n.data(), n.size());
return getQByteArray(n.data(), n.size()).toBase64();
}

void BrowserAction::removeSharedEncryptionKeys()
{
QMutexLocker locker(&m_mutex);
m_browserService.removeSharedEncryptionKeys();
}

void BrowserAction::removeStoredPermissions()
{
QMutexLocker locker(&m_mutex);
m_browserService.removeStoredPermissions();
}
4 changes: 0 additions & 4 deletions src/browser/BrowserAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ class BrowserAction : public QObject

QJsonObject readResponse(const QJsonObject& json);

public slots:
void removeSharedEncryptionKeys();
void removeStoredPermissions();

private:
QJsonObject handleAction(const QJsonObject& json);
QJsonObject handleChangePublicKeys(const QJsonObject& json, const QString& action);
Expand Down
6 changes: 3 additions & 3 deletions src/browser/BrowserEntryConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "core/EntryAttributes.h"
#include <QtCore>

static const char KEEPASSBROWSER_NAME[] = "KeePassXC-Browser Settings";
static const char KEEPASSXCBROWSER_NAME[] = "KeePassXC-Browser Settings";

BrowserEntryConfig::BrowserEntryConfig(QObject* parent)
: QObject(parent)
Expand Down Expand Up @@ -82,7 +82,7 @@ void BrowserEntryConfig::setRealm(const QString& realm)

bool BrowserEntryConfig::load(const Entry* entry)
{
QString s = entry->attributes()->value(KEEPASSBROWSER_NAME);
QString s = entry->customData()->value(KEEPASSXCBROWSER_NAME);
if (s.isEmpty()) {
return false;
}
Expand All @@ -104,5 +104,5 @@ void BrowserEntryConfig::save(Entry* entry)
QVariantMap v = qo2qv(this);
QJsonObject o = QJsonObject::fromVariantMap(v);
QByteArray json = QJsonDocument(o).toJson(QJsonDocument::Compact);
entry->attributes()->set(KEEPASSBROWSER_NAME, json);
entry->customData()->set(KEEPASSXCBROWSER_NAME, json);
}
3 changes: 0 additions & 3 deletions src/browser/BrowserOptionDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,12 @@
#include "ui_BrowserOptionDialog.h"

#include <QFileDialog>
#include <QMessageBox>

BrowserOptionDialog::BrowserOptionDialog(QWidget* parent)
: QWidget(parent)
, m_ui(new Ui::BrowserOptionDialog())
{
m_ui->setupUi(this);
connect(m_ui->removeSharedEncryptionKeys, SIGNAL(clicked()), this, SIGNAL(removeSharedEncryptionKeys()));
connect(m_ui->removeStoredPermissions, SIGNAL(clicked()), this, SIGNAL(removeStoredPermissions()));

m_ui->extensionLabel->setOpenExternalLinks(true);
m_ui->extensionLabel->setText(tr("KeePassXC-Browser is needed for the browser integration to work. <br />Download it for %1 and %2.").arg(
Expand Down
5 changes: 1 addition & 4 deletions src/browser/BrowserOptionDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define BROWSEROPTIONDIALOG_H

#include <QScopedPointer>
#include <QPointer>
#include <QWidget>

namespace Ui
Expand All @@ -40,10 +41,6 @@ public slots:
void loadSettings();
void saveSettings();

signals:
void removeSharedEncryptionKeys();
void removeStoredPermissions();

private slots:
void showProxyLocationFileDialog();

Expand Down
36 changes: 3 additions & 33 deletions src/browser/BrowserOptionDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
Expand Down Expand Up @@ -215,7 +215,7 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
Expand All @@ -230,36 +230,6 @@
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="removeSharedEncryptionKeys">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&amp;Disconnect all browsers</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeStoredPermissions">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Forget all remembered &amp;permissions</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
Expand Down Expand Up @@ -376,7 +346,7 @@
</layout>
</item>
<item>
<spacer name="verticalSpacer_4">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
Expand Down
Loading