Commit f25dcd53 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Enforce QT_NO_CAST_FROM_ASCII

parent 234be202
......@@ -65,7 +65,6 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX LIBKLEO
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055300)
remove_definitions(-DQT_NO_CAST_FROM_ASCII )
remove_definitions(-DQT_NO_FOREACH)
add_definitions(-DQT_NO_EMIT)
set(CMAKE_CXX_STANDARD 17)
......
......@@ -477,8 +477,13 @@ struct ltstr {
};
}
static const char *const defaultOrder[] = {
"CN", "L", "_X_", "OU", "O", "C"
static const QStringList defaultOrder = {
QStringLiteral("CN"),
QStringLiteral("L"),
QStringLiteral("_X_"),
QStringLiteral("OU"),
QStringLiteral("O"),
QStringLiteral("C"),
};
static std::pair<const char *, const char *> const attributeLabels[] = {
......@@ -521,10 +526,7 @@ Kleo::DNAttributeMapper::DNAttributeMapper()
{
d = new Private();
const KConfigGroup config(KSharedConfig::openConfig(), "DN");
d->attributeOrder = config.readEntry("AttributeOrder", QStringList());
if (d->attributeOrder.empty())
std::copy(defaultOrder, defaultOrder + sizeof defaultOrder / sizeof * defaultOrder,
std::back_inserter(d->attributeOrder));
d->attributeOrder = config.readEntry("AttributeOrder", defaultOrder);
mSelf = this;
}
......@@ -570,10 +572,8 @@ const QStringList &Kleo::DNAttributeMapper::attributeOrder() const
void Kleo::DNAttributeMapper::setAttributeOrder(const QStringList &order)
{
d->attributeOrder = order;
if (order.empty())
std::copy(defaultOrder, defaultOrder + sizeof defaultOrder / sizeof * defaultOrder,
std::back_inserter(d->attributeOrder));
d->attributeOrder = order.empty() ? defaultOrder : order;
KConfigGroup config(KSharedConfig::openConfig(), "DN");
config.writeEntry("AttributeOrder", order);
}
......
......@@ -186,7 +186,7 @@ int main(int argc, char **argv)
cout << "quiet option reset to initial: " << (val ? "is set" : "is not set") << endl;
} else {
cout << "Entry 'dirmngr/" << qPrintable(s_entryName) << "' not found" << endl;
cout << "Entry 'dirmngr/" << s_entryName << "' not found" << endl;
}
}
......@@ -257,7 +257,7 @@ int main(int argc, char **argv)
cout << "LDAP timeout reset to initial " << initialValue << " seconds." << endl;
} else {
cout << "Entry 'dirmngr/" << qPrintable(s_entryName) << "' not found" << endl;
cout << "Entry 'dirmngr/" << s_entryName << "' not found" << endl;
}
}
......@@ -304,7 +304,7 @@ int main(int argc, char **argv)
cout << "Log-file reset to initial " << val.toLocal8Bit().constData() << endl;
} else {
cout << "Entry 'dirmngr/" << qPrintable(s_entryName) << "' not found" << endl;
cout << "Entry 'dirmngr/" << s_entryName << "' not found" << endl;
}
}
......@@ -369,7 +369,7 @@ int main(int argc, char **argv)
}
cout << endl;
} else {
cout << "Entry 'gpgsm/" << qPrintable(s_entryName) << "' not found" << endl;
cout << "Entry 'gpgsm/" << s_entryName << "' not found" << endl;
}
}
......
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