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

Compile without foreach but we can't activate it by default

as phonon has a problem. I fixed it but I can"t depend against it
parent ba8efef2
......@@ -84,7 +84,10 @@ set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libx
remove_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
#if (${KF5Config_VERSION} STRGREATER "5.56.0")
# add_definitions(-DQT_NO_FOREACH)
# MESSAGE(STATUS "compile without foreach")
#endif()
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5MailCommon")
......
......@@ -283,7 +283,8 @@ void FilterActionWidgetLister::Private::regenerateActionListFromWidgets()
mActionList->clear();
foreach (const QWidget *widget, q->widgets()) {
const auto lst = q->widgets();
for (const QWidget *widget : lst) {
FilterAction *action = qobject_cast<const FilterActionWidget *>(widget)->action();
if (action) {
mActionList->append(action);
......
......@@ -366,7 +366,7 @@ QDataStream &SearchPattern::operator>>(QDataStream &s) const
break;
}
Q_FOREACH (const SearchRule::Ptr rule, *this) {
for (const SearchRule::Ptr rule : qAsConst(*this)) {
*rule >> s;
}
return s;
......
......@@ -432,7 +432,8 @@ SearchRuleWidgetLister::~SearchRuleWidgetLister()
void SearchRuleWidgetLister::setPatternEditOptions(SearchPatternEdit::SearchPatternEditOptions options)
{
mOptions = options;
foreach (QWidget *w, widgets()) {
const auto lst = widgets();
for (QWidget *w : lst) {
qobject_cast<SearchRuleWidget *>(w)->setPatternEditOptions(options);
}
}
......@@ -569,7 +570,8 @@ void SearchRuleWidgetLister::regenerateRuleListFromWidgets()
mRuleList->clear();
foreach (const QWidget *w, widgets()) {
const auto lst = widgets();
for (const QWidget *w : lst) {
SearchRule::Ptr r = qobject_cast<const SearchRuleWidget *>(w)->rule();
if (r && !r->isEmpty()) {
mRuleList->append(r);
......
......@@ -85,7 +85,8 @@ void FillTagComboJob::onTagsFetched(KJob *job)
return;
}
Akonadi::TagFetchJob *fetchJob = static_cast<Akonadi::TagFetchJob *>(job);
foreach (const Akonadi::Tag &tag, fetchJob->tags()) {
const auto lst = fetchJob->tags();
for (const Akonadi::Tag &tag : lst) {
QString iconName = QStringLiteral("mail-tagged");
Akonadi::TagAttribute *attr = tag.attribute<Akonadi::TagAttribute>();
if (attr) {
......
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