forked from qt-creator/qt-creator
Android: Fix multiple clang clazy warnings
Change-Id: I2ea6cebd16c09a8a4502f4719d99a9d85e5e7d02 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -35,13 +35,13 @@ namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
namespace {
|
||||
const QString extraExtraExtraHighDpiIconPath = QLatin1String("/res/drawable-xxxhdpi/");
|
||||
const QString extraExtraHighDpiIconPath = QLatin1String("/res/drawable-xxhdpi/");
|
||||
const QString extraHighDpiIconPath = QLatin1String("/res/drawable-xhdpi/");
|
||||
const QString highDpiIconPath = QLatin1String("/res/drawable-hdpi/");
|
||||
const QString mediumDpiIconPath = QLatin1String("/res/drawable-mdpi/");
|
||||
const QString lowDpiIconPath = QLatin1String("/res/drawable-ldpi/");
|
||||
const QString imageSuffix = QLatin1String(".png");
|
||||
const char extraExtraExtraHighDpiIconPath[] = "/res/drawable-xxxhdpi/";
|
||||
const char extraExtraHighDpiIconPath[] = "/res/drawable-xxhdpi/";
|
||||
const char extraHighDpiIconPath[] = "/res/drawable-xhdpi/";
|
||||
const char highDpiIconPath[] = "/res/drawable-hdpi/";
|
||||
const char mediumDpiIconPath[] = "/res/drawable-mdpi/";
|
||||
const char lowDpiIconPath[] = "/res/drawable-ldpi/";
|
||||
const char imageSuffix[] = ".png";
|
||||
const QSize lowDpiIconSize{32, 32};
|
||||
const QSize mediumDpiIconSize{48, 48};
|
||||
const QSize highDpiIconSize{72, 72};
|
||||
@@ -73,67 +73,73 @@ AndroidManifestEditorIconContainerWidget::AndroidManifestEditorIconContainerWidg
|
||||
QString iconFileName = m_iconFileName + imageSuffix;
|
||||
|
||||
auto lIconButton = new AndroidManifestEditorIconWidget(this,
|
||||
lowDpiIconSize,
|
||||
lowDpiIconSize,
|
||||
tr("LDPI icon"), tr("Select an icon suitable for low-density (ldpi) screens (~120dpi)."),
|
||||
textEditorWidget,
|
||||
lowDpiIconPath,
|
||||
iconFileName);
|
||||
lowDpiIconSize,
|
||||
lowDpiIconSize,
|
||||
tr("LDPI icon"),
|
||||
tr("Select an icon suitable for low-density (ldpi) screens (~120dpi)."),
|
||||
textEditorWidget,
|
||||
lowDpiIconPath,
|
||||
iconFileName);
|
||||
iconLayout->addWidget(lIconButton);
|
||||
m_iconButtons.push_back(lIconButton);
|
||||
iconLayout->addStretch(1);
|
||||
|
||||
auto mIconButton = new AndroidManifestEditorIconWidget(this,
|
||||
mediumDpiIconSize,
|
||||
mediumDpiIconSize,
|
||||
tr("MDPI icon"), tr("Select an icon for medium-density (mdpi) screens (~160dpi)."),
|
||||
textEditorWidget,
|
||||
mediumDpiIconPath,
|
||||
iconFileName);
|
||||
mediumDpiIconSize,
|
||||
mediumDpiIconSize,
|
||||
tr("MDPI icon"),
|
||||
tr("Select an icon for medium-density (mdpi) screens (~160dpi)."),
|
||||
textEditorWidget,
|
||||
mediumDpiIconPath,
|
||||
iconFileName);
|
||||
iconLayout->addWidget(mIconButton);
|
||||
m_iconButtons.push_back(mIconButton);
|
||||
iconLayout->addStretch(1);
|
||||
|
||||
auto hIconButton = new AndroidManifestEditorIconWidget(this,
|
||||
highDpiIconSize,
|
||||
highDpiIconSize,
|
||||
tr("HDPI icon"), tr("Select an icon for high-density (hdpi) screens (~240dpi)."),
|
||||
textEditorWidget,
|
||||
highDpiIconPath,
|
||||
iconFileName);
|
||||
highDpiIconSize,
|
||||
highDpiIconSize,
|
||||
tr("HDPI icon"),
|
||||
tr("Select an icon for high-density (hdpi) screens (~240dpi)."),
|
||||
textEditorWidget,
|
||||
highDpiIconPath,
|
||||
iconFileName);
|
||||
iconLayout->addWidget(hIconButton);
|
||||
m_iconButtons.push_back(hIconButton);
|
||||
iconLayout->addStretch(1);
|
||||
|
||||
auto xhIconButton = new AndroidManifestEditorIconWidget(this,
|
||||
extraHighDpiIconSize,
|
||||
extraHighDpiIconSize,
|
||||
tr("XHDPI icon"), tr("Select an icon for extra-high-density (xhdpi) screens (~320dpi)."),
|
||||
textEditorWidget,
|
||||
extraHighDpiIconPath,
|
||||
iconFileName);
|
||||
extraHighDpiIconSize,
|
||||
extraHighDpiIconSize,
|
||||
tr("XHDPI icon"),
|
||||
tr("Select an icon for extra-high-density (xhdpi) screens (~320dpi)."),
|
||||
textEditorWidget,
|
||||
extraHighDpiIconPath,
|
||||
iconFileName);
|
||||
iconLayout->addWidget(xhIconButton);
|
||||
m_iconButtons.push_back(xhIconButton);
|
||||
iconLayout->addStretch(1);
|
||||
|
||||
auto xxhIconButton = new AndroidManifestEditorIconWidget(this,
|
||||
extraExtraHighDpiIconSize,
|
||||
extraExtraHighDpiIconSize,
|
||||
tr("XXHDPI icon"), tr("Select an icon for extra-extra-high-density (xxhdpi) screens (~480dpi)."),
|
||||
textEditorWidget,
|
||||
extraExtraHighDpiIconPath,
|
||||
iconFileName);
|
||||
extraExtraHighDpiIconSize,
|
||||
extraExtraHighDpiIconSize,
|
||||
tr("XXHDPI icon"),
|
||||
tr("Select an icon for extra-extra-high-density (xxhdpi) screens (~480dpi)."),
|
||||
textEditorWidget,
|
||||
extraExtraHighDpiIconPath,
|
||||
iconFileName);
|
||||
iconLayout->addWidget(xxhIconButton);
|
||||
m_iconButtons.push_back(xxhIconButton);
|
||||
iconLayout->addStretch(1);
|
||||
|
||||
auto xxxhIconButton = new AndroidManifestEditorIconWidget(this,
|
||||
extraExtraExtraHighDpiIconSize,
|
||||
extraExtraExtraHighDpiIconSize,
|
||||
tr("XXXHDPI icon"), tr("Select an icon for extra-extra-extra-high-density (xxxhdpi) screens (~640dpi)."),
|
||||
textEditorWidget,
|
||||
extraExtraExtraHighDpiIconPath,
|
||||
iconFileName);
|
||||
extraExtraExtraHighDpiIconSize,
|
||||
extraExtraExtraHighDpiIconSize,
|
||||
tr("XXXHDPI icon"),
|
||||
tr("Select an icon for extra-extra-extra-high-density (xxxhdpi) screens (~640dpi)."),
|
||||
textEditorWidget,
|
||||
extraExtraExtraHighDpiIconPath,
|
||||
iconFileName);
|
||||
iconLayout->addWidget(xxxhIconButton);
|
||||
m_iconButtons.push_back(xxxhIconButton);
|
||||
iconLayout->addStretch(3);
|
||||
@@ -141,7 +147,7 @@ AndroidManifestEditorIconContainerWidget::AndroidManifestEditorIconContainerWidg
|
||||
auto handleIconModification = [this] {
|
||||
bool iconsMaybeChanged = hasIcons();
|
||||
if (m_hasIcons != iconsMaybeChanged)
|
||||
iconsModified();
|
||||
emit iconsModified();
|
||||
m_hasIcons = iconsMaybeChanged;
|
||||
};
|
||||
for (auto &&iconButton : m_iconButtons) {
|
||||
|
||||
Reference in New Issue
Block a user