uic: Fix some clang-tidy warnings
- Repeated return types - Make member functions static - narrowing int conversions - Use auto * - Use list.isEmpty() - Use modern includes - Remove redundant access specifiers - minor fixes Change-Id: I14ddf1add667536739fbb5fabb357dbaa7ef35c3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> (cherry picked from commit 6346c5b426935a767575ea758e99749bc6544f54) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
03f2dfca7c
commit
8fc29f208b
@ -55,7 +55,7 @@ void WriteDeclaration::acceptUI(DomUI *node)
|
||||
exportMacro.append(u' ');
|
||||
|
||||
QStringList namespaceList = qualifiedClassName.split("::"_L1);
|
||||
if (namespaceList.size()) {
|
||||
if (!namespaceList.isEmpty()) {
|
||||
className = namespaceList.last();
|
||||
namespaceList.removeLast();
|
||||
}
|
||||
@ -66,14 +66,14 @@ void WriteDeclaration::acceptUI(DomUI *node)
|
||||
// In this case the generated Ui helper classes will also end up in
|
||||
// the Qt namespace (which is harmless, but not "pretty")
|
||||
const bool needsMacro = m_option.qtNamespace &&
|
||||
(namespaceList.size() == 0 || namespaceList[0] == "qdesigner_internal"_L1);
|
||||
(namespaceList.isEmpty() || namespaceList.at(0) == "qdesigner_internal"_L1);
|
||||
|
||||
if (needsMacro)
|
||||
m_output << "QT_BEGIN_NAMESPACE\n\n";
|
||||
|
||||
openNameSpaces(namespaceList, m_output);
|
||||
|
||||
if (namespaceList.size())
|
||||
if (!namespaceList.isEmpty())
|
||||
m_output << "\n";
|
||||
|
||||
m_output << "class " << exportMacro << m_option.prefix << className << "\n"
|
||||
@ -98,7 +98,7 @@ void WriteDeclaration::acceptUI(DomUI *node)
|
||||
|
||||
closeNameSpaces(namespaceList, m_output);
|
||||
|
||||
if (namespaceList.size())
|
||||
if (!namespaceList.isEmpty())
|
||||
m_output << "\n";
|
||||
|
||||
if (m_option.generateNamespace && !m_option.prefix.isEmpty()) {
|
||||
@ -110,7 +110,7 @@ void WriteDeclaration::acceptUI(DomUI *node)
|
||||
|
||||
closeNameSpaces(namespaceList, m_output);
|
||||
|
||||
if (namespaceList.size())
|
||||
if (!namespaceList.isEmpty())
|
||||
m_output << "\n";
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ void WriteDeclaration::acceptWidget(DomWidget *node)
|
||||
if (node->hasAttributeClass())
|
||||
className = node->attributeClass();
|
||||
|
||||
m_output << m_option.indent << m_uic->customWidgetsInfo()->realClassName(className) << " *" << m_driver->findOrInsertWidget(node) << ";\n";
|
||||
m_output << m_option.indent << CustomWidgetsInfo::realClassName(className) << " *" << m_driver->findOrInsertWidget(node) << ";\n";
|
||||
|
||||
TreeWalker::acceptWidget(node);
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <qfileinfo.h>
|
||||
#include <qtextstream.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -41,7 +41,7 @@ WriteIncludes::WriteIncludes(Uic *uic) : WriteIncludesBase(uic),
|
||||
for (const auto &e : classInfoEntries()) {
|
||||
const QString klass = QLatin1StringView(e.klass);
|
||||
const QString module = QLatin1StringView(e.module);
|
||||
QLatin1StringView header = QLatin1StringView(e.header);
|
||||
QLatin1StringView header(e.header);
|
||||
if (klass.contains(namespaceDelimiter)) {
|
||||
m_classToHeader.insert(klass, moduleHeader(module, header));
|
||||
} else {
|
||||
@ -73,7 +73,7 @@ void WriteIncludes::acceptUI(DomUI *node)
|
||||
void WriteIncludes::insertIncludeForClass(const QString &className, QString header, bool global)
|
||||
{
|
||||
if (debugWriteIncludes)
|
||||
fprintf(stderr, "%s %s '%s' %d\n", Q_FUNC_INFO, qPrintable(className), qPrintable(header), global);
|
||||
std::fprintf(stderr, "%s %s '%s' %d\n", Q_FUNC_INFO, qPrintable(className), qPrintable(header), global);
|
||||
|
||||
do {
|
||||
if (!header.isEmpty())
|
||||
@ -91,7 +91,7 @@ void WriteIncludes::insertIncludeForClass(const QString &className, QString head
|
||||
// Remove namespaces
|
||||
QString lowerClassName = className.toLower();
|
||||
static const auto namespaceSeparator = "::"_L1;
|
||||
const int namespaceIndex = lowerClassName.lastIndexOf(namespaceSeparator);
|
||||
const auto namespaceIndex = lowerClassName.lastIndexOf(namespaceSeparator);
|
||||
if (namespaceIndex != -1)
|
||||
lowerClassName.remove(0, namespaceIndex + namespaceSeparator.size());
|
||||
if (m_includeBaseNames.contains(lowerClassName)) {
|
||||
|
@ -17,8 +17,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
@ -416,7 +414,7 @@ int SizePolicyHandle::compare(const SizePolicyHandle &rhs) const
|
||||
|
||||
WriteInitialization::LayoutDefaultHandler::LayoutDefaultHandler()
|
||||
{
|
||||
std::fill_n(m_state, int(NumProperties), 0u);
|
||||
std::fill_n(m_state, int(NumProperties), 0U);
|
||||
std::fill_n(m_defaultValues, int(NumProperties), 0);
|
||||
}
|
||||
|
||||
@ -499,7 +497,6 @@ void WriteInitialization::LayoutDefaultHandler::writeProperty(int p, const QStri
|
||||
writeSetter(indent, objectName, setter, m_defaultValues[p], str);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -547,7 +544,7 @@ void WriteInitialization::acceptUI(DomUI *node)
|
||||
if (node->hasAttributeConnectslotsbyname())
|
||||
m_connectSlotsByName = node->attributeConnectslotsbyname();
|
||||
|
||||
if (auto customSlots = node->elementSlots()) {
|
||||
if (auto *customSlots = node->elementSlots()) {
|
||||
m_customSlots = customSlots->elementSlot();
|
||||
m_customSignals = customSlots->elementSignal();
|
||||
}
|
||||
@ -683,7 +680,8 @@ void WriteInitialization::acceptWidget(DomWidget *node)
|
||||
const QString className = node->attributeClass();
|
||||
const QString varName = m_driver->findOrInsertWidget(node);
|
||||
|
||||
QString parentWidget, parentClass;
|
||||
QString parentWidget;
|
||||
QString parentClass;
|
||||
if (m_widgetChain.top()) {
|
||||
parentWidget = m_driver->findOrInsertWidget(m_widgetChain.top());
|
||||
parentClass = m_widgetChain.top()->attributeClass();
|
||||
@ -698,7 +696,7 @@ void WriteInitialization::acceptWidget(DomWidget *node)
|
||||
|
||||
if (m_widgetChain.size() != 1) {
|
||||
m_output << m_indent << varName << " = " << language::operatorNew
|
||||
<< language::fixClassName(cwi->realClassName(className))
|
||||
<< language::fixClassName(CustomWidgetsInfo::realClassName(className))
|
||||
<< '(' << parentWidget << ')' << language::eol;
|
||||
}
|
||||
|
||||
@ -932,7 +930,7 @@ void WriteInitialization::addButtonGroup(const DomWidget *buttonNode, const QStr
|
||||
// was present before the actual Designer support (4.5)
|
||||
const bool createGroupOnTheFly = group == nullptr;
|
||||
if (createGroupOnTheFly) {
|
||||
DomButtonGroup *newGroup = new DomButtonGroup;
|
||||
auto *newGroup = new DomButtonGroup;
|
||||
newGroup->setAttributeName(attributeName);
|
||||
group = newGroup;
|
||||
fprintf(stderr, "%s: Warning: Creating button group `%s'\n",
|
||||
@ -984,8 +982,10 @@ void WriteInitialization::acceptLayout(DomLayout *node)
|
||||
DomPropertyList propList = node->elementProperty();
|
||||
DomPropertyList newPropList;
|
||||
if (m_layoutWidget) {
|
||||
bool left, top, right, bottom;
|
||||
left = top = right = bottom = false;
|
||||
bool left = false;
|
||||
bool top = false;
|
||||
bool right = false;
|
||||
bool bottom = false;
|
||||
for (const DomProperty *p : propList) {
|
||||
const QString propertyName = p->attributeName();
|
||||
if (propertyName == "leftMargin"_L1 && p->kind() == DomProperty::Number)
|
||||
@ -998,25 +998,25 @@ void WriteInitialization::acceptLayout(DomLayout *node)
|
||||
bottom = true;
|
||||
}
|
||||
if (!left) {
|
||||
DomProperty *p = new DomProperty();
|
||||
auto *p = new DomProperty();
|
||||
p->setAttributeName("leftMargin"_L1);
|
||||
p->setElementNumber(0);
|
||||
newPropList.append(p);
|
||||
}
|
||||
if (!top) {
|
||||
DomProperty *p = new DomProperty();
|
||||
auto *p = new DomProperty();
|
||||
p->setAttributeName("topMargin"_L1);
|
||||
p->setElementNumber(0);
|
||||
newPropList.append(p);
|
||||
}
|
||||
if (!right) {
|
||||
DomProperty *p = new DomProperty();
|
||||
auto *p = new DomProperty();
|
||||
p->setAttributeName("rightMargin"_L1);
|
||||
p->setElementNumber(0);
|
||||
newPropList.append(p);
|
||||
}
|
||||
if (!bottom) {
|
||||
DomProperty *p = new DomProperty();
|
||||
auto *p = new DomProperty();
|
||||
p->setAttributeName("bottomMargin"_L1);
|
||||
p->setElementNumber(0);
|
||||
newPropList.append(p);
|
||||
@ -1054,9 +1054,8 @@ void WriteInitialization::writePropertyList(const QString &varName,
|
||||
{
|
||||
if (value.isEmpty())
|
||||
return;
|
||||
const QStringList list = value.split(u',');
|
||||
const int count = list.size();
|
||||
for (int i = 0; i < count; i++) {
|
||||
const auto list = QStringView{value}.split(u',');
|
||||
for (qsizetype i = 0, count = list.size(); i < count; i++) {
|
||||
if (list.at(i) != defaultValue) {
|
||||
m_output << m_indent << varName << language::derefPointer << setFunction
|
||||
<< '(' << i << ", " << list.at(i) << ')' << language::eol;
|
||||
@ -1250,7 +1249,7 @@ static QString configKeyForProperty(const QString &propertyName)
|
||||
return shortcutConfigKey();
|
||||
if (propertyName == "accessibleName"_L1 || propertyName == "accessibleDescription"_L1)
|
||||
return accessibilityConfigKey();
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
void WriteInitialization::writeProperties(const QString &varName,
|
||||
@ -1290,8 +1289,10 @@ void WriteInitialization::writeProperties(const QString &varName,
|
||||
<< language::charliteral(objectName, m_dindent) << ')' << language::eol;
|
||||
}
|
||||
|
||||
int leftMargin, topMargin, rightMargin, bottomMargin;
|
||||
leftMargin = topMargin = rightMargin = bottomMargin = -1;
|
||||
int leftMargin = -1;
|
||||
int topMargin = -1;
|
||||
int rightMargin = -1;
|
||||
int bottomMargin = -1;
|
||||
bool frameShadowEncountered = false;
|
||||
|
||||
for (const DomProperty *p : lst) {
|
||||
@ -2006,8 +2007,8 @@ QString WriteInitialization::domColor2QString(const DomColor *c)
|
||||
static inline QVersionNumber colorRoleVersionAdded(const QString &roleName)
|
||||
{
|
||||
if (roleName == "PlaceholderText"_L1)
|
||||
return QVersionNumber(5, 12, 0);
|
||||
return QVersionNumber();
|
||||
return {5, 12, 0};
|
||||
return {};
|
||||
}
|
||||
|
||||
void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QString &group, const QString &paletteName)
|
||||
@ -2308,8 +2309,9 @@ void WriteInitialization::enableSorting(DomWidget *w, const QString &varName, co
|
||||
the initializer is omitted.
|
||||
See above for other parameters.
|
||||
*/
|
||||
void WriteInitialization::addInitializer(Item *item,
|
||||
const QString &name, int column, const QString &value, const QString &directive, bool translatable) const
|
||||
void WriteInitialization::addInitializer(Item *item, const QString &name,
|
||||
int column, const QString &value,
|
||||
const QString &directive, bool translatable)
|
||||
{
|
||||
if (!value.isEmpty()) {
|
||||
QString setter;
|
||||
@ -2360,8 +2362,8 @@ void WriteInitialization::addBrushInitializer(Item *item,
|
||||
Create inititializer for a flag value in the Qt namespace.
|
||||
If the named property is not in the map, the initializer is omitted.
|
||||
*/
|
||||
void WriteInitialization::addQtFlagsInitializer(Item *item,
|
||||
const DomPropertyMap &properties, const QString &name, int column) const
|
||||
void WriteInitialization::addQtFlagsInitializer(Item *item, const DomPropertyMap &properties,
|
||||
const QString &name, int column)
|
||||
{
|
||||
if (const DomProperty *p = properties.value(name)) {
|
||||
const QString orOperator = u'|' + language::qtQualifier;
|
||||
@ -2500,10 +2502,10 @@ WriteInitialization::Items WriteInitialization::initializeTreeWidgetItems(const
|
||||
{
|
||||
// items
|
||||
Items items;
|
||||
const int numDomItems = domItems.size();
|
||||
const qsizetype numDomItems = domItems.size();
|
||||
items.reserve(numDomItems);
|
||||
|
||||
for (int i = 0; i < numDomItems; ++i) {
|
||||
for (qsizetype i = 0; i < numDomItems; ++i) {
|
||||
const DomItem *domItem = domItems.at(i);
|
||||
|
||||
Item *item = new Item("QTreeWidgetItem"_L1, m_indent, m_output, m_refreshOut, m_driver);
|
||||
@ -2687,7 +2689,7 @@ QString WriteInitialization::noTrCall(DomString *str, const QString &defaultStri
|
||||
{
|
||||
QString value = defaultString;
|
||||
if (!str && defaultString.isEmpty())
|
||||
return QString();
|
||||
return {};
|
||||
if (str)
|
||||
value = str->text();
|
||||
QString ret;
|
||||
@ -2815,7 +2817,7 @@ static void generateMultiDirectiveBegin(QTextStream &outputStream, const QSet<QS
|
||||
std::sort(list.begin(), list.end());
|
||||
|
||||
outputStream << "#if " << language::qtConfig(list.constFirst());
|
||||
for (int i = 1, size = list.size(); i < size; ++i)
|
||||
for (qsizetype i = 1, size = list.size(); i < size; ++i)
|
||||
outputStream << " || " << language::qtConfig(list.at(i));
|
||||
outputStream << Qt::endl;
|
||||
}
|
||||
@ -2847,14 +2849,14 @@ WriteInitialization::Item::~Item()
|
||||
QString WriteInitialization::Item::writeSetupUi(const QString &parent, Item::EmptyItemPolicy emptyItemPolicy)
|
||||
{
|
||||
if (emptyItemPolicy == Item::DontConstruct && m_setupUiData.policy == ItemData::DontGenerate)
|
||||
return QString();
|
||||
return {};
|
||||
|
||||
bool generateMultiDirective = false;
|
||||
if (emptyItemPolicy == Item::ConstructItemOnly && m_children.isEmpty()) {
|
||||
if (m_setupUiData.policy == ItemData::DontGenerate) {
|
||||
m_setupUiStream << m_indent << language::operatorNew << m_itemClassName
|
||||
<< '(' << parent << ')' << language::eol;
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
if (m_setupUiData.policy == ItemData::GenerateWithMultiDirective)
|
||||
generateMultiDirective = true;
|
||||
|
@ -151,7 +151,7 @@ private:
|
||||
void writeRetranslateUi(const QString &parentPath);
|
||||
void addSetter(const QString &setter, const QString &directive = QString(), bool translatable = false); // don't call it if you already added *this as a child of another Item
|
||||
void addChild(Item *child); // all setters should already been added
|
||||
private:
|
||||
|
||||
struct ItemData
|
||||
{
|
||||
QMultiMap<QString, QString> setters; // directive to setter
|
||||
@ -175,10 +175,10 @@ private:
|
||||
};
|
||||
using Items = QList<Item *>;
|
||||
|
||||
void addInitializer(Item *item,
|
||||
const QString &name, int column, const QString &value, const QString &directive = QString(), bool translatable = false) const;
|
||||
void addQtFlagsInitializer(Item *item, const DomPropertyMap &properties,
|
||||
const QString &name, int column = -1) const;
|
||||
static void addInitializer(Item *item, const QString &name, int column,
|
||||
const QString &value, const QString &directive = QString(), bool translatable = false);
|
||||
static void addQtFlagsInitializer(Item *item, const DomPropertyMap &properties,
|
||||
const QString &name, int column = -1);
|
||||
void addQtEnumInitializer(Item *item,
|
||||
const DomPropertyMap &properties, const QString &name, int column = -1) const;
|
||||
void addBrushInitializer(Item *item,
|
||||
@ -206,7 +206,6 @@ private:
|
||||
|
||||
Declaration findDeclaration(const QString &name);
|
||||
|
||||
private:
|
||||
QString writeFontProperties(const DomFont *f);
|
||||
QString writeIconProperties(const DomResourceIcon *i);
|
||||
void writeThemeIconCheckAssignment(const QString &themeValue, const QString &iconName,
|
||||
|
@ -163,7 +163,7 @@ bool CustomWidgetsInfo::isAmbiguousSlot(const QString &className,
|
||||
return isAmbiguous(className, signalSignature, QMetaMethod::Slot);
|
||||
}
|
||||
|
||||
QString CustomWidgetsInfo::realClassName(const QString &className) const
|
||||
QString CustomWidgetsInfo::realClassName(const QString &className)
|
||||
{
|
||||
if (className == "Line"_L1)
|
||||
return u"QFrame"_s;
|
||||
@ -175,7 +175,7 @@ QString CustomWidgetsInfo::customWidgetAddPageMethod(const QString &name) const
|
||||
{
|
||||
if (DomCustomWidget *dcw = m_customWidgets.value(name, nullptr))
|
||||
return dcw->elementAddPageMethod();
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
// add page methods for simple containers taking only the widget parameter
|
||||
@ -195,7 +195,7 @@ QString CustomWidgetsInfo::simpleContainerAddPageMethod(const QString &name) con
|
||||
if (extends(name, m.first))
|
||||
return m.second;
|
||||
}
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
QString customWidgetAddPageMethod(const QString &name) const;
|
||||
QString simpleContainerAddPageMethod(const QString &name) const;
|
||||
|
||||
QString realClassName(const QString &className) const;
|
||||
static QString realClassName(const QString &className);
|
||||
|
||||
bool extends(const QString &className, QAnyStringView baseClassName) const;
|
||||
bool extendsOneOf(const QString &className, const QStringList &baseClassNames) const;
|
||||
|
@ -28,7 +28,7 @@ void DatabaseInfo::acceptWidget(DomWidget *node)
|
||||
QHash<QString, DomProperty*> properties = propertyMap(node->elementProperty());
|
||||
|
||||
DomProperty *frameworkCode = properties.value("frameworkCode"_L1);
|
||||
if (frameworkCode && toBool(frameworkCode->elementBool()) == false)
|
||||
if (frameworkCode && !toBool(frameworkCode->elementBool()))
|
||||
return;
|
||||
|
||||
DomProperty *db = properties.value("database"_L1);
|
||||
|
@ -17,9 +17,9 @@ QT_BEGIN_NAMESPACE
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
Driver::Driver()
|
||||
: m_stdout(stdout, QFile::WriteOnly | QFile::Text)
|
||||
: m_stdout(stdout, QFile::WriteOnly | QFile::Text),
|
||||
m_output(&m_stdout)
|
||||
{
|
||||
m_output = &m_stdout;
|
||||
}
|
||||
|
||||
Driver::~Driver() = default;
|
||||
@ -94,7 +94,7 @@ QString Driver::findOrInsertLayoutItem(const DomLayoutItem *ui_layoutItem)
|
||||
|
||||
Q_ASSERT( 0 );
|
||||
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
QString Driver::findOrInsertActionGroup(const DomActionGroup *ui_group)
|
||||
@ -170,7 +170,7 @@ QString Driver::qtify(const QString &name)
|
||||
if (qname.at(0) == u'Q' || qname.at(0) == u'K')
|
||||
qname.remove(0, 1);
|
||||
|
||||
for (int i = 0, size = qname.size(); i < size && qname.at(i).isUpper(); ++i)
|
||||
for (qsizetype i = 0, size = qname.size(); i < size && qname.at(i).isUpper(); ++i)
|
||||
qname[i] = qname.at(i).toLower();
|
||||
|
||||
return qname;
|
||||
@ -203,7 +203,7 @@ QString Driver::headerFileName(const QString &fileName)
|
||||
// Transform into a valid C++ identifier
|
||||
if (!baseName.isEmpty() && baseName.at(0).isDigit())
|
||||
baseName.prepend(u'_');
|
||||
for (int i = 0; i < baseName.size(); ++i) {
|
||||
for (qsizetype i = 0; i < baseName.size(); ++i) {
|
||||
QChar c = baseName.at(i);
|
||||
if (!isAnsiCCharacter(c)) {
|
||||
// Replace character by its unicode value
|
||||
|
@ -124,9 +124,9 @@ void WriteImports::acceptUI(DomUI *node)
|
||||
output << "import " << w << '\n';
|
||||
}
|
||||
|
||||
if (auto resources = node->elementResources()) {
|
||||
const auto includes = resources->elementInclude();
|
||||
for (auto include : includes) {
|
||||
if (auto *resources = node->elementResources()) {
|
||||
const auto &includes = resources->elementInclude();
|
||||
for (auto *include : includes) {
|
||||
if (include->hasAttributeLocation())
|
||||
writeResourceImport(include->attributeLocation());
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include <QtCore/qstring.h>
|
||||
#include <QtCore/qstringview.h>
|
||||
#include <QtCore/qstring.h>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QTextStream)
|
||||
|
||||
|
@ -108,10 +108,10 @@ static inline bool isCppCommentChar(QChar c)
|
||||
return c == u'/' || c == u'*';
|
||||
}
|
||||
|
||||
static int leadingCppCommentCharCount(QStringView s)
|
||||
static qsizetype leadingCppCommentCharCount(QStringView s)
|
||||
{
|
||||
int i = 0;
|
||||
for (const int size = s.size(); i < size && isCppCommentChar(s.at(i)); ++i) {
|
||||
qsizetype i = 0;
|
||||
for (const qsizetype size = s.size(); i < size && isCppCommentChar(s.at(i)); ++i) {
|
||||
}
|
||||
return i;
|
||||
}
|
||||
@ -122,7 +122,7 @@ void Uic::writeCopyrightHeaderPython(const DomUI *ui) const
|
||||
if (!comment.isEmpty()) {
|
||||
const auto lines = QStringView{comment}.split(u'\n');
|
||||
for (const auto &line : lines) {
|
||||
if (const int leadingCommentChars = leadingCppCommentCharCount(line)) {
|
||||
if (const auto leadingCommentChars = leadingCppCommentCharCount(line)) {
|
||||
out << language::repeat(leadingCommentChars, '#')
|
||||
<< line.right(line.size() - leadingCommentChars);
|
||||
} else {
|
||||
|
@ -68,13 +68,12 @@ private:
|
||||
// copyright header
|
||||
void writeCopyrightHeaderCpp(const DomUI *ui) const;
|
||||
void writeCopyrightHeaderPython(const DomUI *ui) const;
|
||||
DomUI *parseUiFile(QXmlStreamReader &reader);
|
||||
static DomUI *parseUiFile(QXmlStreamReader &reader);
|
||||
|
||||
// header protection
|
||||
void writeHeaderProtectionStart();
|
||||
void writeHeaderProtectionEnd();
|
||||
|
||||
private:
|
||||
Driver *drv;
|
||||
QTextStream &out;
|
||||
Option &opt;
|
||||
|
Loading…
x
Reference in New Issue
Block a user