Commit 88dfa84f authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Android: Use Qt5-style connects

The heavy lifting was done by clazy.

Change-Id: Id09b62b7b9812d9c0981202c257d18387a8b09d9
Reviewed-by: default avatarBogDan Vatra <bogdan@kdab.com>
parent c3acbc46
...@@ -79,13 +79,11 @@ public: ...@@ -79,13 +79,11 @@ public:
void setBuildTargetSdk(const QString &sdk); void setBuildTargetSdk(const QString &sdk);
virtual Utils::FileName androidPackageSourceDir() const = 0; virtual Utils::FileName androidPackageSourceDir() const = 0;
public slots:
void setDeployAction(AndroidDeployAction deploy); void setDeployAction(AndroidDeployAction deploy);
protected slots:
void showInGraphicalShell();
protected: protected:
Q_INVOKABLE void showInGraphicalShell();
AndroidBuildApkStep(ProjectExplorer::BuildStepList *bc, AndroidBuildApkStep(ProjectExplorer::BuildStepList *bc,
AndroidBuildApkStep *other); AndroidBuildApkStep *other);
bool keystorePassword(); bool keystorePassword();
......
...@@ -96,37 +96,47 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) ...@@ -96,37 +96,47 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step)
m_ui->openPackageLocationCheckBox->setChecked(m_step->openPackageLocation()); m_ui->openPackageLocationCheckBox->setChecked(m_step->openPackageLocation());
// target sdk // target sdk
connect(m_ui->targetSDKComboBox, SIGNAL(activated(QString)), SLOT(setTargetSdk(QString))); connect(m_ui->targetSDKComboBox,
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated),
this, &AndroidBuildApkWidget::setTargetSdk);
// deployment options // deployment options
connect(m_ui->ministroOption, SIGNAL(clicked()), SLOT(setMinistro())); connect(m_ui->ministroOption, &QAbstractButton::clicked,
connect(m_ui->temporaryQtOption, SIGNAL(clicked()), SLOT(setDeployLocalQtLibs())); this, &AndroidBuildApkWidget::setMinistro);
connect(m_ui->bundleQtOption, SIGNAL(clicked()), SLOT(setBundleQtLibs())); connect(m_ui->temporaryQtOption, &QAbstractButton::clicked,
connect(m_ui->ministroOption, SIGNAL(clicked()), SLOT(updateDebugDeploySigningWarning())); this, &AndroidBuildApkWidget::setDeployLocalQtLibs);
connect(m_ui->temporaryQtOption, SIGNAL(clicked()), SLOT(updateDebugDeploySigningWarning())); connect(m_ui->bundleQtOption, &QAbstractButton::clicked,
connect(m_ui->bundleQtOption, SIGNAL(clicked()), SLOT(updateDebugDeploySigningWarning())); this, &AndroidBuildApkWidget::setBundleQtLibs);
connect(m_ui->ministroOption, &QAbstractButton::clicked,
connect(m_ui->useGradleCheckBox, SIGNAL(toggled(bool)), this, &AndroidBuildApkWidget::updateDebugDeploySigningWarning);
this, SLOT(useGradleCheckBoxToggled(bool))); connect(m_ui->temporaryQtOption, &QAbstractButton::clicked,
connect(m_ui->openPackageLocationCheckBox, SIGNAL(toggled(bool)), this, &AndroidBuildApkWidget::updateDebugDeploySigningWarning);
this, SLOT(openPackageLocationCheckBoxToggled(bool))); connect(m_ui->bundleQtOption, &QAbstractButton::clicked,
connect(m_ui->verboseOutputCheckBox, SIGNAL(toggled(bool)), this, &AndroidBuildApkWidget::updateDebugDeploySigningWarning);
this, SLOT(verboseOutputCheckBoxToggled(bool)));
connect(m_ui->useGradleCheckBox, &QAbstractButton::toggled,
this, &AndroidBuildApkWidget::useGradleCheckBoxToggled);
connect(m_ui->openPackageLocationCheckBox, &QAbstractButton::toggled,
this, &AndroidBuildApkWidget::openPackageLocationCheckBoxToggled);
connect(m_ui->verboseOutputCheckBox, &QAbstractButton::toggled,
this, &AndroidBuildApkWidget::verboseOutputCheckBoxToggled);
//signing //signing
connect(m_ui->signPackageCheckBox, SIGNAL(toggled(bool)), connect(m_ui->signPackageCheckBox, &QAbstractButton::toggled,
this, SLOT(signPackageCheckBoxToggled(bool))); this, &AndroidBuildApkWidget::signPackageCheckBoxToggled);
connect(m_ui->KeystoreCreatePushButton, SIGNAL(clicked()), connect(m_ui->KeystoreCreatePushButton, &QAbstractButton::clicked,
this, SLOT(createKeyStore())); this, &AndroidBuildApkWidget::createKeyStore);
connect(m_ui->KeystoreLocationPathChooser, SIGNAL(pathChanged(QString)), connect(m_ui->KeystoreLocationPathChooser, &Utils::PathChooser::pathChanged,
SLOT(updateKeyStorePath(QString))); this, &AndroidBuildApkWidget::updateKeyStorePath);
connect(m_ui->certificatesAliasComboBox, SIGNAL(activated(QString)), connect(m_ui->certificatesAliasComboBox,
this, SLOT(certificatesAliasComboBoxActivated(QString))); static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated),
connect(m_ui->certificatesAliasComboBox, SIGNAL(currentIndexChanged(QString)), this, &AndroidBuildApkWidget::certificatesAliasComboBoxActivated);
this, SLOT(certificatesAliasComboBoxCurrentIndexChanged(QString))); connect(m_ui->certificatesAliasComboBox,
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
connect(m_step->buildConfiguration(), SIGNAL(buildTypeChanged()), this, &AndroidBuildApkWidget::certificatesAliasComboBoxCurrentIndexChanged);
this, SLOT(updateSigningWarning()));
connect(m_step->buildConfiguration(), &ProjectExplorer::BuildConfiguration::buildTypeChanged,
this, &AndroidBuildApkWidget::updateSigningWarning);
updateSigningWarning(); updateSigningWarning();
updateDebugDeploySigningWarning(); updateDebugDeploySigningWarning();
......
...@@ -49,7 +49,7 @@ public: ...@@ -49,7 +49,7 @@ public:
AndroidBuildApkWidget(AndroidBuildApkStep *step); AndroidBuildApkWidget(AndroidBuildApkStep *step);
~AndroidBuildApkWidget(); ~AndroidBuildApkWidget();
private slots: private:
void setTargetSdk(const QString &sdk); void setTargetSdk(const QString &sdk);
void setMinistro(); void setMinistro();
void setDeployLocalQtLibs(); void setDeployLocalQtLibs();
...@@ -65,7 +65,6 @@ private slots: ...@@ -65,7 +65,6 @@ private slots:
void updateKeyStorePath(const QString &path); void updateKeyStorePath(const QString &path);
void signPackageCheckBoxToggled(bool checked); void signPackageCheckBoxToggled(bool checked);
private:
virtual QString summaryText() const; virtual QString summaryText() const;
virtual QString displayName() const; virtual QString displayName() const;
void setCertificates(); void setCertificates();
......
...@@ -776,7 +776,8 @@ QString AndroidConfig::startAVD(const QString &name) const ...@@ -776,7 +776,8 @@ QString AndroidConfig::startAVD(const QString &name) const
bool AndroidConfig::startAVDAsync(const QString &avdName) const bool AndroidConfig::startAVDAsync(const QString &avdName) const
{ {
QProcess *avdProcess = new QProcess(); QProcess *avdProcess = new QProcess();
avdProcess->connect(avdProcess, SIGNAL(finished(int)), avdProcess, SLOT(deleteLater())); QObject::connect(avdProcess, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
avdProcess, &QObject::deleteLater);
// start the emulator // start the emulator
QStringList arguments; QStringList arguments;
......
...@@ -224,7 +224,6 @@ public: ...@@ -224,7 +224,6 @@ public:
static AndroidDeviceInfo showDeviceDialog(ProjectExplorer::Project *project, int apiLevel, const QString &abi, Options options); static AndroidDeviceInfo showDeviceDialog(ProjectExplorer::Project *project, int apiLevel, const QString &abi, Options options);
static void setDefaultDevice(ProjectExplorer::Project *project, const QString &abi, const QString &serialNumber); // serial number or avd name static void setDefaultDevice(ProjectExplorer::Project *project, const QString &abi, const QString &serialNumber); // serial number or avd name
static QString defaultDevice(ProjectExplorer::Project *project, const QString &abi); // serial number or avd name static QString defaultDevice(ProjectExplorer::Project *project, const QString &abi); // serial number or avd name
public slots:
static void clearDefaultDevices(ProjectExplorer::Project *project); static void clearDefaultDevices(ProjectExplorer::Project *project);
static void registerNewToolChains(); static void registerNewToolChains();
static void removeOldToolChains(); static void removeOldToolChains();
......
...@@ -39,12 +39,18 @@ AndroidCreateKeystoreCertificate::AndroidCreateKeystoreCertificate(QWidget *pare ...@@ -39,12 +39,18 @@ AndroidCreateKeystoreCertificate::AndroidCreateKeystoreCertificate(QWidget *pare
ui(new Ui::AndroidCreateKeystoreCertificate) ui(new Ui::AndroidCreateKeystoreCertificate)
{ {
ui->setupUi(this); ui->setupUi(this);
connect(ui->keystorePassLineEdit, SIGNAL(textChanged(QString)), this, SLOT(checkKeystorePassword())); connect(ui->keystorePassLineEdit, &QLineEdit::textChanged,
connect(ui->keystoreRetypePassLineEdit, SIGNAL(textChanged(QString)), this, SLOT(checkKeystorePassword())); this, &AndroidCreateKeystoreCertificate::checkKeystorePassword);
connect(ui->certificatePassLineEdit, SIGNAL(textChanged(QString)), this, SLOT(checkCertificatePassword())); connect(ui->keystoreRetypePassLineEdit, &QLineEdit::textChanged,
connect(ui->certificateRetypePassLineEdit, SIGNAL(textChanged(QString)), this, SLOT(checkCertificatePassword())); this, &AndroidCreateKeystoreCertificate::checkKeystorePassword);
connect(ui->certificateAliasLineEdit, SIGNAL(textChanged(QString)), this, SLOT(checkCertificateAlias())); connect(ui->certificatePassLineEdit, &QLineEdit::textChanged,
connect(ui->countryLineEdit, SIGNAL(textChanged(QString)), this, SLOT(checkCountryCode())); this, &AndroidCreateKeystoreCertificate::checkCertificatePassword);
connect(ui->certificateRetypePassLineEdit, &QLineEdit::textChanged,
this, &AndroidCreateKeystoreCertificate::checkCertificatePassword);
connect(ui->certificateAliasLineEdit, &QLineEdit::textChanged,
this, &AndroidCreateKeystoreCertificate::checkCertificateAlias);
connect(ui->countryLineEdit, &QLineEdit::textChanged,
this, &AndroidCreateKeystoreCertificate::checkCountryCode);
} }
AndroidCreateKeystoreCertificate::~AndroidCreateKeystoreCertificate() AndroidCreateKeystoreCertificate::~AndroidCreateKeystoreCertificate()
......
...@@ -54,11 +54,13 @@ public: ...@@ -54,11 +54,13 @@ public:
QString certificateAlias(); QString certificateAlias();
QString certificatePassword(); QString certificatePassword();
private slots: private:
PasswordStatus checkKeystorePassword(); PasswordStatus checkKeystorePassword();
PasswordStatus checkCertificatePassword(); PasswordStatus checkCertificatePassword();
bool checkCertificateAlias(); bool checkCertificateAlias();
bool checkCountryCode(); bool checkCountryCode();
private slots:
void on_keystoreShowPassCheckBox_stateChanged(int state); void on_keystoreShowPassCheckBox_stateChanged(int state);
void on_certificateShowPassCheckBox_stateChanged(int state); void on_certificateShowPassCheckBox_stateChanged(int state);
void on_buttonBox_accepted(); void on_buttonBox_accepted();
......
...@@ -77,7 +77,6 @@ public: ...@@ -77,7 +77,6 @@ public:
AndroidDeviceInfo deviceInfo() const; AndroidDeviceInfo deviceInfo() const;
public slots:
void setUninstallPreviousPackage(bool uninstall); void setUninstallPreviousPackage(bool uninstall);
signals: signals:
......
...@@ -44,11 +44,14 @@ AndroidDeployQtWidget::AndroidDeployQtWidget(AndroidDeployQtStep *step) ...@@ -44,11 +44,14 @@ AndroidDeployQtWidget::AndroidDeployQtWidget(AndroidDeployQtStep *step)
m_ui->uninstallPreviousPackage->setChecked(m_step->uninstallPreviousPackage() > AndroidDeployQtStep::Keep); m_ui->uninstallPreviousPackage->setChecked(m_step->uninstallPreviousPackage() > AndroidDeployQtStep::Keep);
m_ui->uninstallPreviousPackage->setEnabled(m_step->uninstallPreviousPackage() != AndroidDeployQtStep::ForceUnintall); m_ui->uninstallPreviousPackage->setEnabled(m_step->uninstallPreviousPackage() != AndroidDeployQtStep::ForceUnintall);
connect(m_ui->installMinistroButton, SIGNAL(clicked()), SLOT(installMinistro())); connect(m_ui->installMinistroButton, &QAbstractButton::clicked,
connect(m_ui->cleanLibsPushButton, SIGNAL(clicked()), SLOT(cleanLibsOnDevice())); this, &AndroidDeployQtWidget::installMinistro);
connect(m_ui->resetDefaultDevices, SIGNAL(clicked()), SLOT(resetDefaultDevices())); connect(m_ui->cleanLibsPushButton, &QAbstractButton::clicked,
connect(m_ui->uninstallPreviousPackage, SIGNAL(toggled(bool)), this, &AndroidDeployQtWidget::cleanLibsOnDevice);
m_step, SLOT(setUninstallPreviousPackage(bool))); connect(m_ui->resetDefaultDevices, &QAbstractButton::clicked,
this, &AndroidDeployQtWidget::resetDefaultDevices);
connect(m_ui->uninstallPreviousPackage, &QAbstractButton::toggled,
m_step, &AndroidDeployQtStep::setUninstallPreviousPackage);
} }
......
...@@ -46,12 +46,11 @@ public: ...@@ -46,12 +46,11 @@ public:
AndroidDeployQtWidget(AndroidDeployQtStep *step); AndroidDeployQtWidget(AndroidDeployQtStep *step);
~AndroidDeployQtWidget(); ~AndroidDeployQtWidget();
private slots: private:
void installMinistro(); void installMinistro();
void cleanLibsOnDevice(); void cleanLibsOnDevice();
void resetDefaultDevices(); void resetDefaultDevices();
private:
virtual QString summaryText() const; virtual QString summaryText() const;
virtual QString displayName() const; virtual QString displayName() const;
......
...@@ -439,19 +439,19 @@ AndroidDeviceDialog::AndroidDeviceDialog(int apiLevel, const QString &abi, Andro ...@@ -439,19 +439,19 @@ AndroidDeviceDialog::AndroidDeviceDialog(int apiLevel, const QString &abi, Andro
+ tr("No Device Found") + QLatin1String("</span></p><br/>") + tr("No Device Found") + QLatin1String("</span></p><br/>")
+ msgConnect() + QLatin1String("<br/>") + msgConnect() + QLatin1String("<br/>")
+ msgAdbListDevices()); + msgAdbListDevices());
connect(m_ui->missingLabel, SIGNAL(linkActivated(QString)), connect(m_ui->missingLabel, &QLabel::linkActivated,
this, SLOT(showHelp())); this, &AndroidDeviceDialog::showHelp);
connect(m_ui->refreshDevicesButton, SIGNAL(clicked()), connect(m_ui->refreshDevicesButton, &QAbstractButton::clicked,
this, SLOT(refreshDeviceList())); this, &AndroidDeviceDialog::refreshDeviceList);
connect(m_ui->createAVDButton, SIGNAL(clicked()), connect(m_ui->createAVDButton, &QAbstractButton::clicked,
this, SLOT(createAvd())); this, &AndroidDeviceDialog::createAvd);
connect(m_ui->deviceView, SIGNAL(doubleClicked(QModelIndex)), connect(m_ui->deviceView, &QAbstractItemView::doubleClicked,
this, SLOT(accept())); this, &QDialog::accept);
connect(&m_futureWatcherAddDevice, SIGNAL(finished()), connect(&m_futureWatcherAddDevice, &QFutureWatcherBase::finished,
this, SLOT(avdAdded())); this, &AndroidDeviceDialog::avdAdded);
connect(&m_futureWatcherRefreshDevices, &QFutureWatcherBase::finished, connect(&m_futureWatcherRefreshDevices, &QFutureWatcherBase::finished,
this, &AndroidDeviceDialog::devicesRefreshed); this, &AndroidDeviceDialog::devicesRefreshed);
......
...@@ -57,13 +57,12 @@ public: ...@@ -57,13 +57,12 @@ public:
bool saveDeviceSelection() const; bool saveDeviceSelection() const;
private slots: private:
void refreshDeviceList(); void refreshDeviceList();
void createAvd(); void createAvd();
void clickedOnView(const QModelIndex &idx); void clickedOnView(const QModelIndex &idx);
void showHelp(); void showHelp();
void avdAdded(); void avdAdded();
private:
void devicesRefreshed(); void devicesRefreshed();
void enableOkayButton(); void enableOkayButton();
void defaultDeviceClear(); void defaultDeviceClear();
......
...@@ -122,9 +122,11 @@ AndroidGdbServerKitInformationWidget::AndroidGdbServerKitInformationWidget(Kit * ...@@ -122,9 +122,11 @@ AndroidGdbServerKitInformationWidget::AndroidGdbServerKitInformationWidget(Kit *
// ToolButton with Menu, defaulting to 'Autodetect'. // ToolButton with Menu, defaulting to 'Autodetect'.
auto buttonMenu = new QMenu(m_button); auto buttonMenu = new QMenu(m_button);
QAction *autoDetectAction = buttonMenu->addAction(tr("Auto-detect")); QAction *autoDetectAction = buttonMenu->addAction(tr("Auto-detect"));
connect(autoDetectAction, SIGNAL(triggered()), this, SLOT(autoDetectDebugger())); connect(autoDetectAction, &QAction::triggered,
this, &AndroidGdbServerKitInformationWidget::autoDetectDebugger);
QAction *changeAction = buttonMenu->addAction(tr("Edit...")); QAction *changeAction = buttonMenu->addAction(tr("Edit..."));
connect(changeAction, SIGNAL(triggered()), this, SLOT(showDialog())); connect(changeAction, &QAction::triggered,
this, &AndroidGdbServerKitInformationWidget::showDialog);
m_button->setMenu(buttonMenu); m_button->setMenu(buttonMenu);
refresh(); refresh();
...@@ -192,8 +194,8 @@ void AndroidGdbServerKitInformationWidget::showDialog() ...@@ -192,8 +194,8 @@ void AndroidGdbServerKitInformationWidget::showDialog()
layout->addLayout(formLayout); layout->addLayout(formLayout);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog);
connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); connect(buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
layout->addWidget(buttonBox); layout->addWidget(buttonBox);
dialog.setWindowTitle(tr("GDB Server for \"%1\"").arg(m_kit->displayName())); dialog.setWindowTitle(tr("GDB Server for \"%1\"").arg(m_kit->displayName()));
......
...@@ -53,10 +53,10 @@ public: ...@@ -53,10 +53,10 @@ public:
QWidget *mainWidget() const override; QWidget *mainWidget() const override;
QWidget *buttonWidget() const override; QWidget *buttonWidget() const override;
private slots: private:
void autoDetectDebugger(); void autoDetectDebugger();
void showDialog(); void showDialog();
private:
QLabel *m_label; QLabel *m_label;
QPushButton *m_button; QPushButton *m_button;
}; };
......
...@@ -316,7 +316,8 @@ void AndroidManager::cleanLibsOnDevice(ProjectExplorer::Target *target) ...@@ -316,7 +316,8 @@ void AndroidManager::cleanLibsOnDevice(ProjectExplorer::Target *target)
QProcess *process = new QProcess(); QProcess *process = new QProcess();
QStringList arguments = AndroidDeviceInfo::adbSelector(deviceSerialNumber); QStringList arguments = AndroidDeviceInfo::adbSelector(deviceSerialNumber);
arguments << QLatin1String("shell") << QLatin1String("rm") << QLatin1String("-r") << QLatin1String("/data/local/tmp/qt"); arguments << QLatin1String("shell") << QLatin1String("rm") << QLatin1String("-r") << QLatin1String("/data/local/tmp/qt");
process->connect(process, SIGNAL(finished(int)), process, SLOT(deleteLater())); QObject::connect(process, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
process, &QObject::deleteLater);
const QString adb = AndroidConfigurations::currentConfig().adbToolPath().toString(); const QString adb = AndroidConfigurations::currentConfig().adbToolPath().toString();
Core::MessageManager::write(adb + QLatin1Char(' ') + arguments.join(QLatin1Char(' '))); Core::MessageManager::write(adb + QLatin1Char(' ') + arguments.join(QLatin1Char(' ')));
process->start(adb, arguments); process->start(adb, arguments);
......
...@@ -43,8 +43,8 @@ AndroidManifestDocument::AndroidManifestDocument(AndroidManifestEditorWidget *ed ...@@ -43,8 +43,8 @@ AndroidManifestDocument::AndroidManifestDocument(AndroidManifestEditorWidget *ed
setId(Constants::ANDROID_MANIFEST_EDITOR_ID); setId(Constants::ANDROID_MANIFEST_EDITOR_ID);
setMimeType(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE)); setMimeType(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE));
setSuspendAllowed(false); setSuspendAllowed(false);
connect(editorWidget, SIGNAL(guiChanged()), connect(editorWidget, &AndroidManifestEditorWidget::guiChanged,
this, SIGNAL(changed())); this, &Core::IDocument::changed);
} }
bool AndroidManifestDocument::save(QString *errorString, const QString &fileName, bool autoSave) bool AndroidManifestDocument::save(QString *errorString, const QString &fileName, bool autoSave)
......
...@@ -42,7 +42,8 @@ AndroidManifestEditor::AndroidManifestEditor(AndroidManifestEditorWidget *editor ...@@ -42,7 +42,8 @@ AndroidManifestEditor::AndroidManifestEditor(AndroidManifestEditorWidget *editor
{ {
m_toolBar = new QToolBar(editorWidget); m_toolBar = new QToolBar(editorWidget);
m_actionGroup = new QActionGroup(this); m_actionGroup = new QActionGroup(this);
connect(m_actionGroup, SIGNAL(triggered(QAction*)), this, SLOT(changeEditorPage(QAction*))); connect(m_actionGroup, &QActionGroup::triggered,
this, &AndroidManifestEditor::changeEditorPage);
QAction *generalAction = m_toolBar->addAction(tr("General")); QAction *generalAction = m_toolBar->addAction(tr("General"));
generalAction->setData(AndroidManifestEditorWidget::General); generalAction->setData(AndroidManifestEditorWidget::General);
......
...@@ -57,10 +57,9 @@ public: ...@@ -57,10 +57,9 @@ public:
int currentColumn() const override; int currentColumn() const override;
void gotoLine(int line, int column = 0, bool centerLine = true) override; void gotoLine(int line, int column = 0, bool centerLine = true) override;
private slots: private:
void changeEditorPage(QAction *action); void changeEditorPage(QAction *action);
private:
QString m_displayName; QString m_displayName;
QToolBar *m_toolBar; QToolBar *m_toolBar;
QActionGroup *m_actionGroup; QActionGroup *m_actionGroup;
......
...@@ -112,11 +112,11 @@ AndroidManifestEditorWidget::AndroidManifestEditorWidget() ...@@ -112,11 +112,11 @@ AndroidManifestEditorWidget::AndroidManifestEditorWidget()
m_editor = new AndroidManifestEditor(this); m_editor = new AndroidManifestEditor(this);
connect(&m_timerParseCheck, SIGNAL(timeout()), connect(&m_timerParseCheck, &QTimer::timeout,
this, SLOT(delayedParseCheck())); this, &AndroidManifestEditorWidget::delayedParseCheck);
connect(m_textEditorWidget->document(), SIGNAL(contentsChanged()), connect(m_textEditorWidget->document(), &QTextDocument::contentsChanged,
this, SLOT(startParseCheck())); this, &AndroidManifestEditorWidget::startParseCheck);
connect(m_textEditorWidget->textDocument(), &TextEditor::TextDocument::reloadFinished, connect(m_textEditorWidget->textDocument(), &TextEditor::TextDocument::reloadFinished,
this, [this](bool success) { if (success) updateAfterFileLoad(); }); this, [this](bool success) { if (success) updateAfterFileLoad(); });
connect(m_textEditorWidget->textDocument(), &TextEditor::TextDocument::openFinishedSuccessfully, connect(m_textEditorWidget->textDocument(), &TextEditor::TextDocument::openFinishedSuccessfully,
...@@ -137,6 +137,7 @@ void AndroidManifestEditorWidget::initializePage() ...@@ -137,6 +137,7 @@ void AndroidManifestEditorWidget::initializePage()
QGroupBox *packageGroupBox = new QGroupBox(mainWidget); QGroupBox *packageGroupBox = new QGroupBox(mainWidget);
topLayout->addWidget(packageGroupBox); topLayout->addWidget(packageGroupBox);
auto setDirtyFunc = [this] { setDirty(); };
packageGroupBox->setTitle(tr("Package")); packageGroupBox->setTitle(tr("Package"));
{ {
QFormLayout *formLayout = new QFormLayout(); QFormLayout *formLayout = new QFormLayout();
...@@ -201,16 +202,18 @@ void AndroidManifestEditorWidget::initializePage() ...@@ -201,16 +202,18 @@ void AndroidManifestEditorWidget::initializePage()
updateSdkVersions(); updateSdkVersions();
connect(m_packageNameLineEdit, SIGNAL(textEdited(QString)), connect(m_packageNameLineEdit, &QLineEdit::textEdited,
this, SLOT(setPackageName())); this, &AndroidManifestEditorWidget::setPackageName);
connect(m_versionCode, SIGNAL(valueChanged(int)), connect(m_versionCode, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, SLOT(setDirty())); this, &AndroidManifestEditorWidget::setDirty);
connect(m_versionNameLinedit, SIGNAL(textEdited(QString)), connect(m_versionNameLinedit, &QLineEdit::textEdited,
this, SLOT(setDirty())); this, setDirtyFunc);
connect(m_androidMinSdkVersion, SIGNAL(currentIndexChanged(int)), connect(m_androidMinSdkVersion,
this, SLOT(setDirty())); static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
connect(m_androidTargetSdkVersion, SIGNAL(currentIndexChanged(int)), this, setDirtyFunc);
this, SLOT(setDirty())); connect(m_androidTargetSdkVersion,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, setDirtyFunc);
} }
...@@ -261,16 +264,19 @@ void AndroidManifestEditorWidget::initializePage() ...@@ -261,16 +264,19 @@ void AndroidManifestEditorWidget::initializePage()
applicationGroupBox->setLayout(formLayout); applicationGroupBox->setLayout(formLayout);
connect(m_appNameLineEdit, SIGNAL(textEdited(QString)), connect(m_appNameLineEdit, &QLineEdit::textEdited,
this, SLOT(setDirty())); this, setDirtyFunc);
connect(m_activityNameLineEdit, SIGNAL(textEdited(QString)), connect(m_activityNameLineEdit, &QLineEdit::textEdited,
this, SLOT(setDirty())); this, setDirtyFunc);
connect(m_targetLineEdit, SIGNAL(currentTextChanged(QString)), connect(m_targetLineEdit, &QComboBox::currentTextChanged,
this, SLOT(setDirty())); this, setDirtyFunc);
connect(m_lIconButton, SIGNAL(clicked()), SLOT(setLDPIIcon())); connect(m_lIconButton, &QAbstractButton::clicked,
connect(m_mIconButton, SIGNAL(clicked()), SLOT(setMDPIIcon())); this, &AndroidManifestEditorWidget::setLDPIIcon);
connect(m_hIconButton, SIGNAL(clicked()), SLOT(setHDPIIcon())); connect(m_mIconButton, &QAbstractButton::clicked,
this, &AndroidManifestEditorWidget::setMDPIIcon);
connect(m_hIconButton, &QAbstractButton::clicked,
this, &AndroidManifestEditorWidget::setHDPIIcon);
} }
...@@ -443,17 +449,17 @@ void AndroidManifestEditorWidget::initializePage() ...@@ -443,17 +449,17 @@ void AndroidManifestEditorWidget::initializePage()
permissionsGroupBox->setLayout(layout); permissionsGroupBox->setLayout(layout);
connect(m_defaultPermissonsCheckBox, SIGNAL(stateChanged(int)), connect(m_defaultPermissonsCheckBox, &QCheckBox::stateChanged,
this, SLOT(defaultPermissionOrFeatureCheckBoxClicked())); this, &AndroidManifestEditorWidget::defaultPermissionOrFeatureCheckBoxClicked);
connect(m_defaultFeaturesCheckBox, SIGNAL(stateChanged(int)), connect(m_defaultFeaturesCheckBox, &QCheckBox::stateChanged,
this, SLOT(defaultPermissionOrFeatureCheckBoxClicked())); this, &AndroidManifestEditorWidget::defaultPermissionOrFeatureCheckBoxClicked);
connect(m_addPermissionButton, SIGNAL(clicked()), connect(m_addPermissionButton, &QAbstractButton::clicked,
this, SLOT(addPermission())); this, &AndroidManifestEditorWidget::addPermission);
connect(m_removePermissionButton, SIGNAL(clicked()), connect(m_removePermissionButton, &QAbstractButton::clicked,
this, SLOT(removePermission())); this, &AndroidManifestEditorWidget::removePermission);
connect(m_permissionsComboBox, SIGNAL(currentTextChanged(QString)), connect(m_permissionsComboBox, &QComboBox::currentTextChanged,
this, SLOT(updateAddRemovePermissionButtons())); this, &AndroidManifestEditorWidget::updateAddRemovePermissionButtons);
} }