Commit 32872517 authored by Laurent Montel's avatar Laurent Montel 😁

Astyle kdelibs

parent ac55fa06
......@@ -100,7 +100,7 @@ QString Global::unpackAssistant(const QUrl &remotePackageUrl)
localPackageFile = remotePackageUrl.path();
} else {
QString remoteFileName = QFileInfo(remotePackageUrl.path()).fileName();
localPackageFile = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1String("/accountwizard/") + remoteFileName ;
localPackageFile = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1String("/accountwizard/") + remoteFileName;
KIO::Job *job = KIO::copy(remotePackageUrl, QUrl::fromLocalFile(localPackageFile), KIO::Overwrite | KIO::HideProgressInfo);
qCDebug(ACCOUNTWIZARD_LOG) << "downloading remote URL" << remotePackageUrl << "to" << localPackageFile;
if (!job->exec()) {
......@@ -111,7 +111,7 @@ QString Global::unpackAssistant(const QUrl &remotePackageUrl)
const QUrl file(QLatin1String("tar://") + localPackageFile);
const QFileInfo fi(localPackageFile);
const QString assistant = fi.baseName();
const QString dest = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1String("/") ;
const QString dest = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1String("/");
QDir().mkpath(dest + file.fileName());
KIO::Job *getJob = KIO::copy(file, QUrl::fromLocalFile(dest), KIO::Overwrite | KIO::HideProgressInfo);
if (getJob->exec()) {
......
......@@ -48,7 +48,7 @@ public:
AutoconfigKolabFreebusy *execIspdb(const QString &file)
{
const QString filePath = QStringLiteral(AUTOCONFIG_DATA_DIR) + QLatin1Char('/') + file;
[](const QString &file) {
[](const QString & file) {
QVERIFY(QFile(file).exists());
}(filePath);
......
......@@ -48,7 +48,7 @@ public:
AutoconfigKolabLdap *execIspdb(const QString &file)
{
const QString filePath = QStringLiteral(AUTOCONFIG_DATA_DIR) + QLatin1Char('/') + file;
[](const QString &file) {
[](const QString & file) {
QVERIFY(QFile(file).exists());
}(filePath);
......
......@@ -54,7 +54,7 @@ public:
AutoconfigKolabMail *execIspdb(const QString &file)
{
const QString filePath = QStringLiteral(AUTOCONFIG_DATA_DIR) + QLatin1Char('/') + file;
[](const QString &file) {
[](const QString & file) {
QVERIFY(QFile(file).exists());
}(filePath);
......
......@@ -98,7 +98,7 @@ void Ldap::create()
KConfigGroup group = c->group(QStringLiteral("LDAP"));
bool hasMyServer = false;
uint selHosts = group.readEntry("NumSelectedHosts", 0);
for (uint i = 0 ; i < selHosts && !hasMyServer; ++i) {
for (uint i = 0; i < selHosts && !hasMyServer; ++i) {
if (group.readEntry(QStringLiteral("SelectedHost%1").arg(i), QString()) == host) {
hasMyServer = true;
m_entry = i;
......
......@@ -46,7 +46,7 @@ int main(int argc, char **argv)
i18n("(c) 2009-2015 the Akonadi developers"),
QStringLiteral("http://pim.kde.org/akonadi/"));
aboutData.addAuthor(i18n("Volker Krause"), i18n("Author"), QStringLiteral("vkrause@kde.org"));
aboutData.addAuthor(i18n("Laurent Montel"), QString() , QStringLiteral("montel@kde.org"));
aboutData.addAuthor(i18n("Laurent Montel"), QString(), QStringLiteral("montel@kde.org"));
app.setOrganizationDomain(QStringLiteral("kde.org"));
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("akonadi")));
......
......@@ -104,7 +104,7 @@ QUrl ArchiveMailInfo::realUrl(const QString &folderName, bool &dirExist) const
const char *extensions[numExtensions] = { ".zip", ".tar", ".tar.bz2", ".tar.gz" };
const QString dirPath = dirArchive(dirExist);
const QString path = dirPath + QLatin1Char('/') + i18nc("Start of the filename for a mail archive file" , "Archive")
const QString path = dirPath + QLatin1Char('/') + i18nc("Start of the filename for a mail archive file", "Archive")
+ QLatin1Char('_') + normalizeFolderName(folderName) + QLatin1Char('_')
+ QDate::currentDate().toString(Qt::ISODate) + QString::fromLatin1(extensions[mArchiveType]);
QUrl real(QUrl::fromLocalFile(path));
......@@ -121,7 +121,7 @@ QStringList ArchiveMailInfo::listOfArchive(const QString &folderName, bool &dirE
QDir dir(dirPath);
QStringList nameFilters;
nameFilters << i18nc("Start of the filename for a mail archive file" , "Archive") + QLatin1Char('_') +
nameFilters << i18nc("Start of the filename for a mail archive file", "Archive") + QLatin1Char('_') +
normalizeFolderName(folderName) + QLatin1Char('_') + QLatin1String("*") + QString::fromLatin1(extensions[mArchiveType]);
const QStringList lst = dir.entryList(nameFilters, QDir::Files | QDir::NoDotAndDotDot, QDir::Time | QDir::Reversed);
return lst;
......
......@@ -64,7 +64,7 @@ void ArchiveMailManager::load()
const QStringList collectionList = mConfig->groupList().filter(QRegExp(QStringLiteral("ArchiveMailCollection \\d+")));
const int numberOfCollection = collectionList.count();
for (int i = 0 ; i < numberOfCollection; ++i) {
for (int i = 0; i < numberOfCollection; ++i) {
KConfigGroup group = mConfig->group(collectionList.at(i));
ArchiveMailInfo *info = new ArchiveMailInfo(group);
......@@ -189,7 +189,7 @@ QString ArchiveMailManager::printArchiveListInfo()
QString infoStr;
const QStringList collectionList = mConfig->groupList().filter(QRegExp(QStringLiteral("ArchiveMailCollection \\d+")));
const int numberOfCollection = collectionList.count();
for (int i = 0 ; i < numberOfCollection; ++i) {
for (int i = 0; i < numberOfCollection; ++i) {
KConfigGroup group = mConfig->group(collectionList.at(i));
ArchiveMailInfo info(group);
if (!infoStr.isEmpty()) {
......
......@@ -147,7 +147,7 @@ void ArchiveMailWidget::load()
KSharedConfig::Ptr config = KSharedConfig::openConfig();
const QStringList collectionList = config->groupList().filter(QRegExp(archiveMailCollectionPattern()));
const int numberOfCollection = collectionList.count();
for (int i = 0 ; i < numberOfCollection; ++i) {
for (int i = 0; i < numberOfCollection; ++i) {
KConfigGroup group = config->group(collectionList.at(i));
ArchiveMailInfo *info = new ArchiveMailInfo(group);
if (info->isValid()) {
......
......@@ -111,7 +111,7 @@ void FollowUpReminderInfoWidget::load()
KSharedConfig::Ptr config = KSharedConfig::openConfig();
const QStringList filterGroups = config->groupList().filter(QRegExp(followUpItemPattern()));
const int numberOfItem = filterGroups.count();
for (int i = 0 ; i < numberOfItem; ++i) {
for (int i = 0; i < numberOfItem; ++i) {
KConfigGroup group = config->group(filterGroups.at(i));
FollowUpReminder::FollowUpReminderInfo *info = new FollowUpReminder::FollowUpReminderInfo(group);
......
......@@ -54,7 +54,7 @@ void FollowUpReminderManager::load(bool forceReloadConfig)
const QStringList itemList = mConfig->groupList().filter(QRegExp(QStringLiteral("FollowupReminderItem \\d+")));
const int numberOfItems = itemList.count();
QList<FollowUpReminder::FollowUpReminderInfo *> noAnswerList;
for (int i = 0 ; i < numberOfItems; ++i) {
for (int i = 0; i < numberOfItems; ++i) {
KConfigGroup group = mConfig->group(itemList.at(i));
......
......@@ -353,7 +353,7 @@ void FilterManager::mailCollectionRemoved(const Akonadi::Collection &collection)
{
QList<MailCommon::MailFilter *>::const_iterator end(d->mFilters.constEnd());
for (QList<MailCommon::MailFilter *>::const_iterator it = d->mFilters.constBegin();
it != end ; ++it) {
it != end; ++it) {
(*it)->folderRemoved(collection, Akonadi::Collection());
}
}
......@@ -496,7 +496,7 @@ bool FilterManager::process(const QList< MailFilter * > &mailFilters, const Akon
const bool applyOnOutbound = ((set & Outbound) || (set & BeforeOutbound));
for (QList<MailCommon::MailFilter *>::const_iterator it = mailFilters.constBegin();
!stopIt && it != end ; ++it) {
!stopIt && it != end; ++it) {
if ((*it)->isEnabled()) {
const bool inboundOk = ((set & Inbound) && (*it)->applyOnInbound());
......@@ -561,7 +561,7 @@ MailCommon::SearchRule::RequiredPart FilterManager::requiredPart(const QString &
if (id.isEmpty()) {
return d->mRequiredPartsBasedOnAll;
}
return d->mRequiredParts.contains(id) ? d->mRequiredParts[id] : SearchRule::Envelope ;
return d->mRequiredParts.contains(id) ? d->mRequiredParts[id] : SearchRule::Envelope;
}
#ifndef NDEBUG
......
......@@ -190,7 +190,7 @@ void NotesManager::updateNetworkListener()
if (NoteShared::NoteSharedGlobalConfig::receiveNotes()) {
// create the socket and start listening for connections
mListener = KSocketFactory::listen(QStringLiteral("knotes") , QHostAddress::Any,
mListener = KSocketFactory::listen(QStringLiteral("knotes"), QHostAddress::Any,
NoteShared::NoteSharedGlobalConfig::port());
connect(mListener, &QTcpServer::newConnection, this, &NotesManager::slotAcceptConnection);
}
......
......@@ -152,7 +152,7 @@ void SendLaterWidget::load()
KSharedConfig::Ptr config = KSharedConfig::openConfig();
const QStringList filterGroups = config->groupList().filter(QRegExp(sendLaterItemPattern()));
const int numberOfItem = filterGroups.count();
for (int i = 0 ; i < numberOfItem; ++i) {
for (int i = 0; i < numberOfItem; ++i) {
KConfigGroup group = config->group(filterGroups.at(i));
SendLater::SendLaterInfo *info = new SendLater::SendLaterInfo(group);
if (info->isValid()) {
......
......@@ -66,7 +66,7 @@ void SendLaterManager::load(bool forcereload)
const QStringList itemList = mConfig->groupList().filter(QRegExp(QStringLiteral("SendLaterItem \\d+")));
const int numberOfItems = itemList.count();
for (int i = 0 ; i < numberOfItems; ++i) {
for (int i = 0; i < numberOfItems; ++i) {
KConfigGroup group = mConfig->group(itemList.at(i));
SendLater::SendLaterInfo *info = new SendLater::SendLaterInfo(group);
if (info->isValid()) {
......
......@@ -465,7 +465,7 @@ void BrowserWidget::dumpToXml()
if (!root.isValid()) {
return;
}
const QString fileName = QFileDialog::getSaveFileName(this, QStringLiteral("Select XML file") , QString(), QStringLiteral("*.xml"));
const QString fileName = QFileDialog::getSaveFileName(this, QStringLiteral("Select XML file"), QString(), QStringLiteral("*.xml"));
if (fileName.isEmpty()) {
return;
}
......
......@@ -34,7 +34,7 @@ class MonitorsModel : public QAbstractItemModel
public:
enum Column {
IdentifierColumn = 0,
IsAllMonitoredColumn ,
IsAllMonitoredColumn,
MonitoredCollectionsColumn,
MonitoredItemsColumn,
MonitoredResourcesColumn,
......
......@@ -47,11 +47,11 @@ KCMAkregatorAppearanceConfig::KCMAkregatorAppearanceConfig(QWidget *parent, cons
connect(m_ui.kcfg_UseCustomColors, &QAbstractButton::toggled, m_ui.lbl_newArticles, &QWidget::setEnabled);
connect(m_ui.kcfg_UseCustomColors, &QAbstractButton::toggled, m_ui.lbl_unreadArticles, &QWidget::setEnabled);
connect(m_ui.slider_minimumFontSize, &QAbstractSlider::valueChanged, m_ui.kcfg_MinimumFontSize , &QSpinBox::setValue);
connect(m_ui.slider_mediumFontSize, &QAbstractSlider::valueChanged, m_ui.kcfg_MediumFontSize , &QSpinBox::setValue);
connect(m_ui.slider_minimumFontSize, &QAbstractSlider::valueChanged, m_ui.kcfg_MinimumFontSize, &QSpinBox::setValue);
connect(m_ui.slider_mediumFontSize, &QAbstractSlider::valueChanged, m_ui.kcfg_MediumFontSize, &QSpinBox::setValue);
connect(m_ui.slider_minimumFontSize, &QAbstractSlider::sliderMoved, m_ui.kcfg_MinimumFontSize , &QSpinBox::setValue);
connect(m_ui.slider_mediumFontSize, &QAbstractSlider::sliderMoved, m_ui.kcfg_MediumFontSize , &QSpinBox::setValue);
connect(m_ui.slider_minimumFontSize, &QAbstractSlider::sliderMoved, m_ui.kcfg_MinimumFontSize, &QSpinBox::setValue);
connect(m_ui.slider_mediumFontSize, &QAbstractSlider::sliderMoved, m_ui.kcfg_MediumFontSize, &QSpinBox::setValue);
connect(m_ui.kcfg_MinimumFontSize, SIGNAL(valueChanged(int)), m_ui.slider_minimumFontSize, SLOT(setValue(int)));
connect(m_ui.kcfg_MediumFontSize, SIGNAL(valueChanged(int)), m_ui.slider_mediumFontSize, SLOT(setValue(int)));
......
......@@ -88,7 +88,7 @@ public:
}
}
void write(const QVariant &value , QXmlStreamWriter &writer, TextMode mode = PlainText) const
void write(const QVariant &value, QXmlStreamWriter &writer, TextMode mode = PlainText) const
{
const QVariant qv(value);
Q_ASSERT(qv.canConvert(QVariant::String));
......
......@@ -51,7 +51,7 @@ void c4_Column::Validate()const
d4_assert(0 <= _slack && _slack < kSegMax);
if (_segments.GetSize() == 0) {
return ;
return;
}
// ok, not initialized
......@@ -1353,7 +1353,7 @@ void c4_ColOfInts::Set(int index_, const c4_Bytes &buf_)
d4_assert(buf_.Size() == _dataWidth);
if ((this->*_setter)(index_, buf_.Contents())) {
return ;
return;
}
d4_assert(buf_.Size() == sizeof(t4_i32));
......@@ -1479,7 +1479,7 @@ void c4_ColOfInts::ResizeData(int index_, int count_, bool clear_)
} else {
RemoveData(index_ * w, - count_ * w);
}
return ;
return;
}
d4_assert(_currWidth == 1 || _currWidth == 2 || _currWidth == 4);
......
......@@ -97,7 +97,7 @@ static int(*my_munmap)(char *, t4_u32) = fake_munmap;
static void InitializeIO()
{
if (sfwRefCount++) {
return ;
return;
}
// race condition, infinitesimal risk
......@@ -115,7 +115,7 @@ static void InitializeIO()
}
}
if (!systemFramework || !CFBundleLoadExecutable(systemFramework)) {
return ;
return;
}
#define F(x) CFBundleGetFunctionPointerForName(systemFramework, CFSTR(#x))
my_fopen = (FILE * (*)(const char *, const char *))F(fopen);
......@@ -138,7 +138,7 @@ static void InitializeIO()
static void FinalizeIO()
{
if (--sfwRefCount) {
return ;
return;
}
// race condition, infinitesimal risk
......@@ -447,7 +447,7 @@ void c4_FileStrategy::DataCommit(t4_i32 limit_)
_failure = ferror(_file);
d4_assert(_failure != 0);
d4_assert(true); // always force an assertion failure in debug mode
return ;
return;
}
if (limit_ > 0) {
......
......@@ -658,7 +658,7 @@ void c4_FormatB::SetOne(int index_, const c4_Bytes &xbuf_, bool ignoreMemos_)
} else if (n < 0) {
cp->Shrink(start, - n);
} else if (m == 0) {
return ;
return;
}
// no size change and no contents
......@@ -922,7 +922,7 @@ void c4_FormatS::Set(int index_, const c4_Bytes &buf_)
d4_assert(buf_.Contents()[m] == 0);
if (m == 0) {
SetOne(index_, c4_Bytes()); // don't store data for empty strings
return ;
return;
}
}
......@@ -946,7 +946,7 @@ void c4_FormatS::Insert(int index_, const c4_Bytes &buf_, int count_)
d4_assert(buf_.Contents()[m] == 0);
if (m == 0) {
c4_FormatB::Insert(index_, c4_Bytes(), count_);
return ;
return;
}
}
......@@ -1141,7 +1141,7 @@ void c4_FormatV::Replace(int index_, c4_HandlerSeq *seq_)
c4_HandlerSeq *&curr = (c4_HandlerSeq *&)_subSeqs.ElementAt(index_);
if (seq_ == curr) {
return ;
return;
}
if (curr != 0) {
......
......@@ -298,7 +298,7 @@ void c4_Allocator::InsertPair(int i_, t4_i32 from_, t4_i32 to_)
//!d4_assert(to_ < GetAt(i_));
if (to_ >= (t4_i32)GetAt(i_)) {
return ;
return;
}
// ignore 2nd allocation of used area
......@@ -624,7 +624,7 @@ void c4_SaveContext::Write(const void *buf_, int len_)
void c4_SaveContext::StoreValue(t4_i32 v_)
{
if (_walk == 0) {
return ;
return;
}
if (_curr + 10 >= _limit) {
......@@ -642,7 +642,7 @@ void c4_SaveContext::SaveIt(c4_HandlerSeq &root_, c4_Allocator **spacePtr_,
const t4_i32 size = _strategy.FileSize();
if (_strategy._failure != 0) {
return ;
return;
}
const t4_i32 end = _fullScan ? 0 : size - _strategy._baseOffset;
......@@ -690,7 +690,7 @@ void c4_SaveContext::SaveIt(c4_HandlerSeq &root_, c4_Allocator **spacePtr_,
if (limit < 0) {
// 2006-01-12 #2: catch file size exceeding 2 Gb
_strategy._failure = - 1; // unusual non-zero value flags this case
return ;
return;
}
bool changed = _fullScan || tempWalk != rootWalk_;
......@@ -708,7 +708,7 @@ void c4_SaveContext::SaveIt(c4_HandlerSeq &root_, c4_Allocator **spacePtr_,
}
if (!changed) {
return ;
return;
}
//AllocDump("b1", false);
......@@ -717,7 +717,7 @@ void c4_SaveContext::SaveIt(c4_HandlerSeq &root_, c4_Allocator **spacePtr_,
if (_differ != 0) {
int n = _differ->NewDiffID();
_differ->CreateDiff(n, walk);
return ;
return;
}
d4_assert(_mode != 0 || _fullScan);