projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src: Yearly copyright bump
[quassel.git]
/
src
/
client
/
clientidentity.cpp
diff --git
a/src/client/clientidentity.cpp
b/src/client/clientidentity.cpp
index
16e1c42
..
1c2956e
100644
(file)
--- a/
src/client/clientidentity.cpp
+++ b/
src/client/clientidentity.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-201
8
by the Quassel Project *
+ * Copyright (C) 2005-201
9
by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-23,37
+23,22
@@
#include "client.h"
#include "signalproxy.h"
#include "client.h"
#include "signalproxy.h"
-CertIdentity::CertIdentity(IdentityId id, QObject
*
parent)
+CertIdentity::CertIdentity(IdentityId id, QObject
*
parent)
: Identity(id, parent)
: Identity(id, parent)
-#ifdef HAVE_SSL
- , _certManager(nullptr),
- _isDirty(false)
-#endif
-{
-}
-
+{}
-CertIdentity::CertIdentity(const Identity
&other, QObject *
parent)
+CertIdentity::CertIdentity(const Identity
& other, QObject*
parent)
: Identity(other, parent)
: Identity(other, parent)
-#ifdef HAVE_SSL
- , _certManager(nullptr),
- _isDirty(false)
-#endif
-{
-}
-
+{}
-CertIdentity::CertIdentity(const CertIdentity
&other, QObject *
parent)
+CertIdentity::CertIdentity(const CertIdentity
& other, QObject*
parent)
: Identity(other, parent)
#ifdef HAVE_SSL
: Identity(other, parent)
#ifdef HAVE_SSL
- , _certManager(nullptr),
- _isDirty(other._isDirty),
- _sslKey(other._sslKey),
- _sslCert(other._sslCert)
+ , _isDirty(other._isDirty)
+ , _sslKey(other._sslKey)
+ , _sslCert(other._sslCert)
#endif
#endif
-{
-}
-
+{}
#ifdef HAVE_SSL
void CertIdentity::enableEditSsl(bool enable)
#ifdef HAVE_SSL
void CertIdentity::enableEditSsl(bool enable)
@@
-62,15
+47,14
@@
void CertIdentity::enableEditSsl(bool enable)
return;
_certManager = new ClientCertManager(id(), this);
return;
_certManager = new ClientCertManager(id(), this);
- if (isValid()) { // this means we are not a newly created Identity but have a proper Id
+ if (isValid()) {
// this means we are not a newly created Identity but have a proper Id
Client::signalProxy()->synchronize(_certManager);
Client::signalProxy()->synchronize(_certManager);
- connect(_certManager,
SIGNAL(updated()), this, SLOT(markClean())
);
- connect(_certManager,
SIGNAL(initDone()), this, SLOT(markClean())
);
+ connect(_certManager,
&SyncableObject::updated, this, &CertIdentity::markClean
);
+ connect(_certManager,
&SyncableObject::initDone, this, &CertIdentity::markClean
);
}
}
}
}
-
-void CertIdentity::setSslKey(const QSslKey &key)
+void CertIdentity::setSslKey(const QSslKey& key)
{
if (key.toPem() == _sslKey.toPem())
return;
{
if (key.toPem() == _sslKey.toPem())
return;
@@
-78,8
+62,7
@@
void CertIdentity::setSslKey(const QSslKey &key)
_isDirty = true;
}
_isDirty = true;
}
-
-void CertIdentity::setSslCert(const QSslCertificate &cert)
+void CertIdentity::setSslCert(const QSslCertificate& cert)
{
if (cert.toPem() == _sslCert.toPem())
return;
{
if (cert.toPem() == _sslCert.toPem())
return;
@@
-87,7
+70,6
@@
void CertIdentity::setSslCert(const QSslCertificate &cert)
_isDirty = true;
}
_isDirty = true;
}
-
void CertIdentity::requestUpdateSslSettings()
{
if (!_certManager)
void CertIdentity::requestUpdateSslSettings()
{
if (!_certManager)
@@
-96,18
+78,16
@@
void CertIdentity::requestUpdateSslSettings()
_certManager->requestUpdate(_certManager->toVariantMap());
}
_certManager->requestUpdate(_certManager->toVariantMap());
}
-
void CertIdentity::markClean()
{
_isDirty = false;
emit sslSettingsUpdated();
}
void CertIdentity::markClean()
{
_isDirty = false;
emit sslSettingsUpdated();
}
-
// ========================================
// ClientCertManager
// ========================================
// ========================================
// ClientCertManager
// ========================================
-void ClientCertManager::setSslKey(const QByteArray
&
encoded)
+void ClientCertManager::setSslKey(const QByteArray
&
encoded)
{
QSslKey key(encoded, QSsl::Rsa);
if (key.isNull() && Client::isCoreFeatureEnabled(Quassel::Feature::EcdsaCertfpKeys))
{
QSslKey key(encoded, QSsl::Rsa);
if (key.isNull() && Client::isCoreFeatureEnabled(Quassel::Feature::EcdsaCertfpKeys))
@@
-117,10
+97,9
@@
void ClientCertManager::setSslKey(const QByteArray &encoded)
_certIdentity->setSslKey(key);
}
_certIdentity->setSslKey(key);
}
-
-void ClientCertManager::setSslCert(const QByteArray &encoded)
+void ClientCertManager::setSslCert(const QByteArray& encoded)
{
_certIdentity->setSslCert(QSslCertificate(encoded));
}
{
_certIdentity->setSslCert(QSslCertificate(encoded));
}
-#endif // HAVE_SSL
+#endif
// HAVE_SSL