Commit 69a33524 authored by Laurent Montel's avatar Laurent Montel 😁

Use QVector here

parent 253f784b
......@@ -40,7 +40,7 @@ ServerSieveListWidget::~ServerSieveListWidget()
void ServerSieveListWidget::readConfig()
{
const QList<SieveEditorUtil::SieveServerConfig> lstServer = SieveEditorUtil::readServerSieveConfig();
const QVector<SieveEditorUtil::SieveServerConfig> lstServer = SieveEditorUtil::readServerSieveConfig();
Q_FOREACH (const SieveEditorUtil::SieveServerConfig &conf, lstServer) {
ServerSieveListWidgetItem *item = new ServerSieveListWidgetItem(this);
item->setServerConfig(conf);
......@@ -49,7 +49,7 @@ void ServerSieveListWidget::readConfig()
void ServerSieveListWidget::writeConfig()
{
QList<SieveEditorUtil::SieveServerConfig> lstServerConfig;
QVector<SieveEditorUtil::SieveServerConfig> lstServerConfig;
for (int i=0; i <count(); ++i) {
ServerSieveListWidgetItem *serverSieveItem = static_cast<ServerSieveListWidgetItem*>(item(i));
if (serverSieveItem) {
......
......@@ -45,7 +45,7 @@ bool SieveEditorManageSieveWidget::refreshList()
bool noImapFound = true;
SieveTreeWidgetItem *last = 0;
const QList<SieveEditorUtil::SieveServerConfig> listConfig = SieveEditorUtil::readServerSieveConfig();
const QVector<SieveEditorUtil::SieveServerConfig> listConfig = SieveEditorUtil::readServerSieveConfig();
Q_FOREACH ( const SieveEditorUtil::SieveServerConfig &conf, listConfig) {
last = new SieveTreeWidgetItem( treeView(), last );
last->setText( 0, conf.serverName + QString::fromLatin1(" (%1)").arg(conf.userName) );
......
......@@ -69,9 +69,9 @@ KUrl SieveEditorUtil::SieveServerConfig::url() const {
return u;
}
QList<SieveEditorUtil::SieveServerConfig> SieveEditorUtil::readServerSieveConfig()
QVector<SieveEditorUtil::SieveServerConfig> SieveEditorUtil::readServerSieveConfig()
{
QList<SieveServerConfig> lstConfig;
QVector<SieveServerConfig> lstConfig;
KSharedConfigPtr cfg = KGlobal::config();
QRegExp re( QLatin1String( "^ServerSieve (.+)$" ) );
const QStringList groups = cfg->groupList().filter( re );
......@@ -99,7 +99,7 @@ QList<SieveEditorUtil::SieveServerConfig> SieveEditorUtil::readServerSieveConfig
return lstConfig;
}
void SieveEditorUtil::writeServerSieveConfig(const QList<SieveEditorUtil::SieveServerConfig> &lstConfig)
void SieveEditorUtil::writeServerSieveConfig(const QVector<SieveServerConfig> &lstConfig)
{
KSharedConfigPtr cfg = KGlobal::config();
const QRegExp re( QLatin1String( "^ServerSieve (.+)$" ) );
......
......@@ -48,10 +48,11 @@ struct SieveServerConfig {
bool enabled;
};
QList<SieveServerConfig> readServerSieveConfig();
void writeServerSieveConfig(const QList<SieveEditorUtil::SieveServerConfig> &lstConfig);
QVector<SieveServerConfig> readServerSieveConfig();
void writeServerSieveConfig(const QVector<SieveEditorUtil::SieveServerConfig> &lstConfig);
void addServerSieveConfig(const SieveEditorUtil::SieveServerConfig &conf);
void writeSieveSettings(KWallet::Wallet *wallet, KSharedConfigPtr cfg, const SieveEditorUtil::SieveServerConfig &conf, int index);
}
Q_DECLARE_TYPEINFO(SieveEditorUtil::SieveServerConfig, Q_MOVABLE_TYPE);
#endif // SIEVEEDITORUTIL_H
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