Commit 5f041370 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Initialize variables

parent 191aa39b
Pipeline #47576 passed with stage
in 11 minutes and 19 seconds
......@@ -20,9 +20,9 @@ ConfigModule::ConfigModule(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
{
setButtons(NoAdditionalButton);
auto *l = new QVBoxLayout(this);
l->setContentsMargins(0, 0, 0, 0);
auto *tmw = new TransportManagementWidget(this);
auto l = new QVBoxLayout(this);
l->setContentsMargins({});
auto tmw = new TransportManagementWidget(this);
l->addWidget(tmw);
}
......
......@@ -50,16 +50,17 @@ public:
QProgressBar *testProgress = nullptr;
bool secureSocketFinished;
bool normalSocketFinished;
bool tlsFinished;
bool secureSocketFinished = false;
bool normalSocketFinished = false;
bool tlsFinished = false;
bool popSupportsTLS;
int normalStage;
int secureStage;
int encryptionMode;
bool normalPossible;
bool securePossible;
bool normalPossible = true;
bool securePossible = true;
void finalResult();
void handleSMTPIMAPResponse(int type, const QString &text);
......@@ -87,12 +88,6 @@ public:
ServerTestPrivate::ServerTestPrivate(ServerTest *test)
: q(test)
, testProgress(nullptr)
, secureSocketFinished(false)
, normalSocketFinished(false)
, tlsFinished(false)
, normalPossible(true)
, securePossible(true)
{
}
......
......@@ -27,8 +27,8 @@ public:
QSslSocket *socket = nullptr;
QString server;
QString protocol;
int port;
bool secure;
int port = 0;
bool secure = false;
// slots
void slotConnected();
......@@ -44,9 +44,6 @@ private:
SocketPrivate::SocketPrivate(Socket *s)
: q(s)
, socket(nullptr)
, port(0)
, secure(false)
{
}
......
......@@ -61,13 +61,13 @@ public:
KConfig *config = nullptr;
QList<Transport *> transports;
TransportType::List types;
bool myOwnChange;
bool appliedChange;
bool myOwnChange = false;
bool appliedChange = false;
KWallet::Wallet *wallet = nullptr;
bool walletOpenFailed;
bool walletAsyncOpen;
int defaultTransportId;
bool isMainInstance;
bool walletOpenFailed = false;
bool walletAsyncOpen = false;
int defaultTransportId = -1;
bool isMainInstance = false;
QList<TransportJob *> walletQueue;
TransportManager *const q;
......@@ -112,12 +112,6 @@ TransportManager::TransportManager()
migrate.migrate();
qAddPostRoutine(destroyStaticTransportManager);
d->myOwnChange = false;
d->appliedChange = false;
d->wallet = nullptr;
d->walletOpenFailed = false;
d->walletAsyncOpen = false;
d->defaultTransportId = -1;
d->config = new KConfig(QStringLiteral("mailtransports"));
QDBusConnection::sessionBus().registerObject(DBUS_OBJECT_PATH, this,
......
......@@ -61,7 +61,7 @@ void AddTransportDialogNG::Private::readConfig()
QString AddTransportDialogNG::Private::selectedType() const
{
QList<QTreeWidgetItem *> sel = ui.typeListView->selectedItems();
const QList<QTreeWidgetItem *> sel = ui.typeListView->selectedItems();
if (!sel.empty()) {
return sel.first()->data(0, Qt::UserRole).toString();
}
......@@ -87,7 +87,7 @@ AddTransportDialogNG::AddTransportDialogNG(QWidget *parent)
{
// Setup UI.
{
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QWidget *widget = new QWidget(this);
d->ui.setupUi(widget);
mainLayout->addWidget(widget);
......@@ -105,7 +105,7 @@ AddTransportDialogNG::AddTransportDialogNG(QWidget *parent)
// Populate type list.
const auto transportTypes = TransportManager::self()->types();
for (const TransportType &type : transportTypes) {
auto *treeItem = new QTreeWidgetItem(d->ui.typeListView);
auto treeItem = new QTreeWidgetItem(d->ui.typeListView);
treeItem->setText(0, type.name());
treeItem->setText(1, type.description());
treeItem->setToolTip(1, type.description());
......
......@@ -41,7 +41,7 @@ public:
@param transportId The transport identifier.
@return return true if we success to find transportId
*/
Q_REQUIRED_RESULT bool setCurrentTransport(int transportId);
bool setCurrentTransport(int transportId);
/**
Returns the type of the selected transport.
......
......@@ -68,7 +68,7 @@ void TransportListView::commitData(QWidget *editor)
return;
}
QTreeWidgetItem *item = selectedItems().first();
auto *edit = dynamic_cast<QLineEdit *>(editor); // krazy:exclude=qclasses
auto edit = dynamic_cast<QLineEdit *>(editor); // krazy:exclude=qclasses
Q_ASSERT(edit); // original code had if
const int id = item->data(0, Qt::UserRole).toInt();
......@@ -94,7 +94,7 @@ void TransportListView::fillTransportList()
clear();
const auto lstTransports = TransportManager::self()->transports();
for (Transport *t : lstTransports) {
auto *item = new QTreeWidgetItem(this);
auto item = new QTreeWidgetItem(this);
item->setData(0, Qt::UserRole, t->id());
QString name = t->name();
if (TransportManager::self()->defaultTransportId() == t->id()) {
......
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