Commit c29eb773 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use QVector<int> vs QList<int>

parent e1fc32fd
cmake_minimum_required(VERSION 3.0)
set(PIM_VERSION "5.4.80")
set(PIM_VERSION "5.4.81")
project(MailTransport VERSION ${PIM_VERSION})
......
......@@ -331,9 +331,9 @@ bool TransportManager::isEmpty() const
return d->transports.isEmpty();
}
QList<int> TransportManager::transportIds() const
QVector<int> TransportManager::transportIds() const
{
QList<int> rv;
QVector<int> rv;
rv.reserve(d->transports.count());
foreach (Transport *t, d->transports) {
rv << t->id();
......@@ -502,7 +502,7 @@ void TransportManagerPrivate::slotTransportsChanged()
int TransportManagerPrivate::createId() const
{
QList<int> usedIds;
QVector<int> usedIds;
usedIds.reserve(1 + transports.count());
for (Transport *t : qAsConst(transports)) {
usedIds << t->id();
......
......@@ -199,7 +199,7 @@ public Q_SLOTS:
/**
Returns a list of transport identifiers.
*/
Q_SCRIPTABLE QList<int> transportIds() const;
Q_SCRIPTABLE QVector<int> transportIds() const;
/**
Returns a list of transport names.
......
......@@ -30,7 +30,7 @@ using namespace MailTransport;
class TransportComboBoxPrivate
{
public:
QList<int> transports;
QVector<int> transports;
};
TransportComboBox::TransportComboBox(QWidget *parent)
......@@ -75,7 +75,7 @@ void TransportComboBox::updateComboboxList()
int defaultId = 0;
if (!TransportManager::self()->isEmpty()) {
const QStringList listNames = TransportManager::self()->transportNames();
const QList<int> listIds = TransportManager::self()->transportIds();
const QVector<int> listIds = TransportManager::self()->transportIds();
addItems(listNames);
setTransportList(listIds);
defaultId = TransportManager::self()->defaultTransportId();
......@@ -88,7 +88,7 @@ void TransportComboBox::updateComboboxList()
}
}
void TransportComboBox::setTransportList(const QList<int> &transportList)
void TransportComboBox::setTransportList(const QVector<int> &transportList)
{
d->transports = transportList;
}
......@@ -64,7 +64,7 @@ public:
TransportBase::EnumType::type transportType() const;
protected:
void setTransportList(const QList<int> &transportList);
void setTransportList(const QVector<int> &transportList);
public Q_SLOTS:
/**
......
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