Commit 72499d41 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Honor KDE Kiosk setting lineedit_reveal_password

KWidgetsAddons does not depend on KAuth and thus does not handle
KAuthorized settings,  we have to do it manually.

(cherry picked from commit 904580c6)
parent f14918f2
......@@ -12,6 +12,7 @@
#include <config-konversation.h>
#include <KLineEdit>
#include <KAuthorized>
#include <KWallet>
#include <KLocalizedString>
......@@ -26,7 +27,7 @@ ConnectionBehavior_Config::ConnectionBehavior_Config(QWidget* parent)
#endif
kcfg_ReconnectDelay->setSuffix(ki18np(" second", " seconds"));
m_ProxyPassword->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
connect(m_ProxyPassword, &KPasswordLineEdit::passwordChanged, this, [this]() { setPasswordChanged(); });
}
......
......@@ -12,6 +12,7 @@
#include <QInputDialog>
#include <KAuthorized>
#include <KEditListWidget>
#include <KMessageBox>
#include <KMessageWidget>
......@@ -99,6 +100,8 @@ namespace Konversation
m_loginEdit->setValidator(validator);
m_nicknameLBox->lineEdit()->setValidator(validator);
m_authPasswordEdit->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
// set values for the widgets
updateIdentity(0);
......
......@@ -24,6 +24,8 @@
#include "viewcontainer.h"
#include "konversation_log.h"
#include <kwidgetsaddons_version.h>
#include <KAuthorized>
#include <KPasswordDialog>
#include <KMessageBox>
#include <KComboBox>
......@@ -887,6 +889,9 @@ void Channel::modeButtonClicked(int id, bool on)
{
QPointer<KPasswordDialog> dlg = new KPasswordDialog(this);
dlg->setPrompt(i18n("Channel Password"));
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 84, 0)
dlg->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
#endif
if (dlg->exec() && !dlg->password().isEmpty())
{
args = dlg->password();
......
......@@ -11,6 +11,8 @@
#include "channel.h"
#include "servergroupsettings.h"
#include <KAuthorized>
#include <QPushButton>
#include <QDialogButtonBox>
#include <QVBoxLayout>
......@@ -43,6 +45,9 @@ namespace Konversation
m_ui.channelCombo->setFocus();
mOkButton->setEnabled(false);
m_ui.passwordEdit->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
connect(m_ui.channelCombo, &KHistoryComboBox::editTextChanged, this, &JoinChannelDialog::slotChannelChanged);
m_ui.delBtn->setEnabled(false);
......
......@@ -15,6 +15,8 @@
#include "ui_serverdialogui.h"
#include "ui_channeldialogui.h"
#include <KAuthorized>
#include <QPushButton>
#include <QCheckBox>
......@@ -444,6 +446,8 @@ namespace Konversation
m_mainWidget = new Ui::ServerDialogUI();
m_mainWidget->setupUi(mainWidget);
m_mainWidget->m_passwordEdit->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
m_mainWidget->m_serverEdit->setFocus();
connect(m_okButton, &QPushButton::clicked, this, &ServerDialog::slotOk);
......@@ -510,6 +514,7 @@ namespace Konversation
m_mainWidget = new Ui::ChannelDialogUI();
m_mainWidget->setupUi(mainWidget);
m_mainWidget->m_passwordEdit->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
m_mainWidget->m_channelEdit->setFocus();
connect(m_okButton, &QPushButton::clicked, this, &ChannelDialog::slotOk);
......
......@@ -9,6 +9,7 @@
#include <KLineEdit>
#include <KPasswordLineEdit>
#include <KAuthorized>
#include <QCheckBox>
#include <QDialogButtonBox>
......@@ -68,6 +69,7 @@ QuickConnectDialog::QuickConnectDialog(QWidget *parent)
QString passwordWT = i18n("If the IRC server requires a password, enter it here (most servers do not require a password.)");
passwordLabel->setWhatsThis(passwordWT);
passwordInput = new KPasswordLineEdit(page);
passwordInput->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
passwordInput->setWhatsThis(passwordWT);
passwordLabel->setBuddy(passwordInput);
passwordLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment