projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modernize: Use raw string literals instead of escaped strings
[quassel.git]
/
src
/
qtui
/
settingspages
/
identitiessettingspage.cpp
diff --git
a/src/qtui/settingspages/identitiessettingspage.cpp
b/src/qtui/settingspages/identitiessettingspage.cpp
index
094e9e0
..
0cf9974
100644
(file)
--- a/
src/qtui/settingspages/identitiessettingspage.cpp
+++ b/
src/qtui/settingspages/identitiessettingspage.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-201
3
by the Quassel Project *
+ * Copyright (C) 2005-201
8
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 *
@@
-22,19
+22,19
@@
#include <QInputDialog>
#include <QMessageBox>
#include <QInputDialog>
#include <QMessageBox>
+#include <utility>
#include "client.h"
#include "client.h"
-#include "icon
loader
.h"
+#include "icon.h"
#include "signalproxy.h"
IdentitiesSettingsPage::IdentitiesSettingsPage(QWidget *parent)
#include "signalproxy.h"
IdentitiesSettingsPage::IdentitiesSettingsPage(QWidget *parent)
- : SettingsPage(tr("IRC"), tr("Identities"), parent),
- _editSsl(false)
+ : SettingsPage(tr("IRC"), tr("Identities"), parent)
{
ui.setupUi(this);
{
ui.setupUi(this);
- ui.renameIdentity->setIcon(
BarIcon
("edit-rename"));
- ui.addIdentity->setIcon(
BarIcon
("list-add-user"));
- ui.deleteIdentity->setIcon(
BarIcon
("list-remove-user"));
+ ui.renameIdentity->setIcon(
icon::get
("edit-rename"));
+ ui.addIdentity->setIcon(
icon::get
("list-add-user"));
+ ui.deleteIdentity->setIcon(
icon::get
("list-remove-user"));
coreConnectionStateChanged(Client::isConnected()); // need a core connection!
connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
coreConnectionStateChanged(Client::isConnected()); // need a core connection!
connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
@@
-84,7
+84,7
@@
void IdentitiesSettingsPage::continueUnsecured()
_editSsl = true;
QHash<IdentityId, CertIdentity *>::iterator idIter;
_editSsl = true;
QHash<IdentityId, CertIdentity *>::iterator idIter;
- for (idIter = identities.begin(); idIter != identities.end();
idIter++
) {
+ for (idIter = identities.begin(); idIter != identities.end();
++idIter
) {
idIter.value()->enableEditSsl();
}
idIter.value()->enableEditSsl();
}
@@
-175,6
+175,12
@@
bool IdentitiesSettingsPage::testHasChanged()
if (currentId != 0) {
changedIdentities.removeAll(currentId);
CertIdentity temp(currentId, this);
if (currentId != 0) {
changedIdentities.removeAll(currentId);
CertIdentity temp(currentId, this);
+#ifdef HAVE_SSL
+ // we need to set the cert and key manually, as they aren't synced
+ CertIdentity *old = identities[currentId];
+ temp.setSslKey(old->sslKey());
+ temp.setSslCert(old->sslCert());
+#endif
ui.identityEditor->saveToIdentity(&temp);
temp.setIdentityName(identities[currentId]->identityName());
if (temp != *Client::identity(currentId) || temp.isDirty())
ui.identityEditor->saveToIdentity(&temp);
temp.setIdentityName(identities[currentId]->identityName());
if (temp != *Client::identity(currentId) || temp.isDirty())
@@
-209,7
+215,7
@@
bool IdentitiesSettingsPage::aboutToSave()
void IdentitiesSettingsPage::clientIdentityCreated(IdentityId id)
{
void IdentitiesSettingsPage::clientIdentityCreated(IdentityId id)
{
-
CertIdentity
*identity = new CertIdentity(*Client::identity(id), this);
+
auto
*identity = new CertIdentity(*Client::identity(id), this);
#ifdef HAVE_SSL
identity->enableEditSsl(_editSsl);
#endif
#ifdef HAVE_SSL
identity->enableEditSsl(_editSsl);
#endif
@@
-297,13
+303,13
@@
void IdentitiesSettingsPage::removeIdentity(Identity *id)
void IdentitiesSettingsPage::on_identityList_currentIndexChanged(int index)
{
void IdentitiesSettingsPage::on_identityList_currentIndexChanged(int index)
{
- CertIdentity *previousIdentity =
0
;
+ CertIdentity *previousIdentity =
nullptr
;
if (currentId != 0 && identities.contains(currentId))
previousIdentity = identities[currentId];
if (index < 0) {
//ui.identityList->setEditable(false);
if (currentId != 0 && identities.contains(currentId))
previousIdentity = identities[currentId];
if (index < 0) {
//ui.identityList->setEditable(false);
- ui.identityEditor->displayIdentity(
0
, previousIdentity);
+ ui.identityEditor->displayIdentity(
nullptr
, previousIdentity);
currentId = 0;
}
else {
currentId = 0;
}
else {
@@
-326,7
+332,7
@@
void IdentitiesSettingsPage::on_addIdentity_clicked()
if (!identities.keys().contains(-id.toInt())) break;
}
id = -id.toInt();
if (!identities.keys().contains(-id.toInt())) break;
}
id = -id.toInt();
-
CertIdentity
*newId = new CertIdentity(id, this);
+
auto
*newId = new CertIdentity(id, this);
#ifdef HAVE_SSL
newId->enableEditSsl(_editSsl);
#endif
#ifdef HAVE_SSL
newId->enableEditSsl(_editSsl);
#endif
@@
-411,7
+417,7
@@
SaveIdentitiesDlg::SaveIdentitiesDlg(const QList<CertIdentity *> &toCreate, cons
: QDialog(parent)
{
ui.setupUi(this);
: QDialog(parent)
{
ui.setupUi(this);
- ui.abort->setIcon(
SmallIcon
("dialog-cancel"));
+ ui.abort->setIcon(
icon::get
("dialog-cancel"));
numevents = toCreate.count() + toUpdate.count() + toRemove.count();
rcvevents = 0;
numevents = toCreate.count() + toUpdate.count() + toRemove.count();
rcvevents = 0;
@@
-458,15
+464,15
@@
void SaveIdentitiesDlg::clientEvent()
/*************************************************************************************************/
/*************************************************************************************************/
-NickEditDlg::NickEditDlg(const QString &old,
const QStringList &
exist, QWidget *parent)
- : QDialog(parent), oldNick(old), existing(
exist
)
+NickEditDlg::NickEditDlg(const QString &old,
QStringList
exist, QWidget *parent)
+ : QDialog(parent), oldNick(old), existing(
std::move(exist)
)
{
ui.setupUi(this);
// define a regexp for valid nicknames
// TODO: add max nicklength according to ISUPPORT
QString letter = "A-Za-z";
{
ui.setupUi(this);
// define a regexp for valid nicknames
// TODO: add max nicklength according to ISUPPORT
QString letter = "A-Za-z";
- QString special =
"\x5b-\x60\x7b-\x7d
";
+ QString special =
R"([-`{-})
";
QRegExp rx(QString("[%1%2][%1%2\\d-]*").arg(letter, special));
ui.nickEdit->setValidator(new QRegExpValidator(rx, ui.nickEdit));
if (old.isEmpty()) {
QRegExp rx(QString("[%1%2][%1%2\\d-]*").arg(letter, special));
ui.nickEdit->setValidator(new QRegExpValidator(rx, ui.nickEdit));
if (old.isEmpty()) {