forked from qt-creator/qt-creator
Android: fix manifest editor appending lib_name meta-data
The manifest editor is always adding the meta-data part for "android.app.lib_name" because parseMetaData() is wrongfully returning false. Change-Id: Ic5f1971e98f213b6fe517bf6605120b21ca51508 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This commit is contained in:
@@ -1121,8 +1121,7 @@ bool AndroidManifestEditorWidget::parseMetaData(QXmlStreamReader &reader, QXmlSt
|
||||
{
|
||||
Q_ASSERT(reader.isStartElement());
|
||||
|
||||
const int parseItemsCount = 2;
|
||||
int counter = 0;
|
||||
bool found = false;
|
||||
QXmlStreamAttributes attributes = reader.attributes();
|
||||
QXmlStreamAttributes result;
|
||||
QStringList keys;
|
||||
@@ -1132,13 +1131,13 @@ bool AndroidManifestEditorWidget::parseMetaData(QXmlStreamReader &reader, QXmlSt
|
||||
keys = QStringList("android:value");
|
||||
values = QStringList(m_targetLineEdit->currentText());
|
||||
result = modifyXmlStreamAttributes(attributes, keys, values);
|
||||
++counter;
|
||||
found = true;
|
||||
} else if (attributes.value(QLatin1String("android:name"))
|
||||
== QLatin1String("android.app.extract_android_style")) {
|
||||
keys = QStringList("android:value");
|
||||
values = QStringList(m_styleExtractMethod->currentText());
|
||||
result = modifyXmlStreamAttributes(attributes, keys, values);
|
||||
++counter;
|
||||
found = true;
|
||||
} else {
|
||||
result = attributes;
|
||||
}
|
||||
@@ -1151,7 +1150,7 @@ bool AndroidManifestEditorWidget::parseMetaData(QXmlStreamReader &reader, QXmlSt
|
||||
while (!reader.atEnd()) {
|
||||
if (reader.isEndElement()) {
|
||||
writer.writeCurrentToken(reader);
|
||||
return counter == parseItemsCount;
|
||||
return found;
|
||||
} else if (reader.isStartElement()) {
|
||||
parseUnknownElement(reader, writer);
|
||||
} else {
|
||||
@@ -1159,7 +1158,7 @@ bool AndroidManifestEditorWidget::parseMetaData(QXmlStreamReader &reader, QXmlSt
|
||||
}
|
||||
reader.readNext();
|
||||
}
|
||||
return counter == parseItemsCount; // should never be reached
|
||||
return found; // should never be reached
|
||||
}
|
||||
|
||||
void AndroidManifestEditorWidget::parseUsesSdk(QXmlStreamReader &reader, QXmlStreamWriter & writer)
|
||||
|
Reference in New Issue
Block a user