forked from qt-creator/qt-creator
Debugger: Convert some connects to Qt 5 style
Change-Id: Id0b374b4b0bd3d14fb73fae28269778db5ae3dc7 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -82,14 +82,13 @@ public:
|
|||||||
QString localFile() const { return m_localFile; }
|
QString localFile() const { return m_localFile; }
|
||||||
QString remoteFile() const { return m_remoteFile; }
|
QString remoteFile() const { return m_remoteFile; }
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void handleSftpOperationFinished(SftpJobId, const QString &error);
|
void handleSftpOperationFinished(SftpJobId, const QString &error);
|
||||||
void handleSftpOperationFailed(const QString &errorMessage);
|
void handleSftpOperationFailed(const QString &errorMessage);
|
||||||
void handleConnectionError(const QString &errorMessage);
|
void handleConnectionError(const QString &errorMessage);
|
||||||
void handleRemoteError(const QString &errorMessage);
|
void handleRemoteError(const QString &errorMessage);
|
||||||
void selectFile();
|
void selectFile();
|
||||||
|
|
||||||
private:
|
|
||||||
QSortFilterProxyModel m_model;
|
QSortFilterProxyModel m_model;
|
||||||
SftpFileSystemModel m_fileSystemModel;
|
SftpFileSystemModel m_fileSystemModel;
|
||||||
QTreeView *m_fileSystemView;
|
QTreeView *m_fileSystemView;
|
||||||
@@ -128,13 +127,15 @@ SelectRemoteFileDialog::SelectRemoteFileDialog(QWidget *parent)
|
|||||||
layout->addWidget(m_textBrowser);
|
layout->addWidget(m_textBrowser);
|
||||||
layout->addWidget(m_buttonBox);
|
layout->addWidget(m_buttonBox);
|
||||||
|
|
||||||
QObject::connect(m_buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
connect(m_buttonBox, &QDialogButtonBox::rejected,
|
||||||
QObject::connect(m_buttonBox, SIGNAL(accepted()), SLOT(selectFile()));
|
this, &QDialog::reject);
|
||||||
|
connect(m_buttonBox, &QDialogButtonBox::accepted,
|
||||||
|
this, &SelectRemoteFileDialog::selectFile);
|
||||||
|
|
||||||
connect(&m_fileSystemModel, SIGNAL(sftpOperationFailed(QString)),
|
connect(&m_fileSystemModel, &SftpFileSystemModel::sftpOperationFailed,
|
||||||
SLOT(handleSftpOperationFailed(QString)));
|
this, &SelectRemoteFileDialog::handleSftpOperationFailed);
|
||||||
connect(&m_fileSystemModel, SIGNAL(connectionError(QString)),
|
connect(&m_fileSystemModel, &SftpFileSystemModel::connectionError,
|
||||||
SLOT(handleConnectionError(QString)));
|
this, &SelectRemoteFileDialog::handleConnectionError);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectRemoteFileDialog::attachToDevice(Kit *k)
|
void SelectRemoteFileDialog::attachToDevice(Kit *k)
|
||||||
@@ -184,8 +185,8 @@ void SelectRemoteFileDialog::selectFile()
|
|||||||
m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||||
m_fileSystemView->setEnabled(false);
|
m_fileSystemView->setEnabled(false);
|
||||||
|
|
||||||
connect(&m_fileSystemModel, SIGNAL(sftpOperationFinished(QSsh::SftpJobId,QString)),
|
connect(&m_fileSystemModel, &SftpFileSystemModel::sftpOperationFinished,
|
||||||
SLOT(handleSftpOperationFinished(QSsh::SftpJobId,QString)));
|
this, &SelectRemoteFileDialog::handleSftpOperationFinished);
|
||||||
|
|
||||||
{
|
{
|
||||||
QTemporaryFile localFile(QDir::tempPath() + QLatin1String("/remotecore-XXXXXX"));
|
QTemporaryFile localFile(QDir::tempPath() + QLatin1String("/remotecore-XXXXXX"));
|
||||||
@@ -323,14 +324,14 @@ AttachCoreDialog::~AttachCoreDialog()
|
|||||||
|
|
||||||
int AttachCoreDialog::exec()
|
int AttachCoreDialog::exec()
|
||||||
{
|
{
|
||||||
connect(d->selectRemoteCoreButton, SIGNAL(clicked()), SLOT(selectRemoteCoreFile()));
|
connect(d->selectRemoteCoreButton, &QAbstractButton::clicked, this, &AttachCoreDialog::selectRemoteCoreFile);
|
||||||
connect(d->remoteCoreFileName, SIGNAL(textChanged(QString)), SLOT(coreFileChanged(QString)));
|
connect(d->remoteCoreFileName, &QLineEdit::textChanged, this, &AttachCoreDialog::coreFileChanged);
|
||||||
connect(d->localExecFileName, SIGNAL(changed(QString)), SLOT(changed()));
|
connect(d->localExecFileName, &PathChooser::changed, this, &AttachCoreDialog::changed);
|
||||||
connect(d->localCoreFileName, SIGNAL(changed(QString)), SLOT(coreFileChanged(QString)));
|
connect(d->localCoreFileName, &PathChooser::changed, this, &AttachCoreDialog::coreFileChanged);
|
||||||
connect(d->forceLocalCheckBox, SIGNAL(stateChanged(int)), SLOT(changed()));
|
connect(d->forceLocalCheckBox, &QCheckBox::stateChanged, this, &AttachCoreDialog::changed);
|
||||||
connect(d->kitChooser, SIGNAL(currentIndexChanged(int)), SLOT(changed()));
|
connect(d->kitChooser, &KitChooser::currentIndexChanged, this, &AttachCoreDialog::changed);
|
||||||
connect(d->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept()));
|
connect(d->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||||
changed();
|
changed();
|
||||||
|
|
||||||
AttachCoreDialogPrivate::State st = d->getDialogState(*this);
|
AttachCoreDialogPrivate::State st = d->getDialogState(*this);
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ ModulesTreeView::ModulesTreeView()
|
|||||||
{
|
{
|
||||||
setSortingEnabled(true);
|
setSortingEnabled(true);
|
||||||
|
|
||||||
connect(this, SIGNAL(activated(QModelIndex)),
|
connect(this, &QAbstractItemView::activated,
|
||||||
SLOT(moduleActivated(QModelIndex)));
|
this, &ModulesTreeView::moduleActivated);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModulesTreeView::moduleActivated(const QModelIndex &index)
|
void ModulesTreeView::moduleActivated(const QModelIndex &index)
|
||||||
|
|||||||
@@ -157,17 +157,17 @@ void PdbEngine::setupEngine()
|
|||||||
m_pdb = _("python");
|
m_pdb = _("python");
|
||||||
showMessage(_("STARTING PDB ") + m_pdb);
|
showMessage(_("STARTING PDB ") + m_pdb);
|
||||||
|
|
||||||
connect(&m_pdbProc, SIGNAL(error(QProcess::ProcessError)),
|
connect(&m_pdbProc, static_cast<void(QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
|
||||||
SLOT(handlePdbError(QProcess::ProcessError)));
|
this, &PdbEngine::handlePdbError);
|
||||||
connect(&m_pdbProc, SIGNAL(finished(int,QProcess::ExitStatus)),
|
connect(&m_pdbProc, static_cast<void(QProcess::*)(int,QProcess::ExitStatus)>(&QProcess::finished),
|
||||||
SLOT(handlePdbFinished(int,QProcess::ExitStatus)));
|
this, &PdbEngine::handlePdbFinished);
|
||||||
connect(&m_pdbProc, SIGNAL(readyReadStandardOutput()),
|
connect(&m_pdbProc, &QProcess::readyReadStandardOutput,
|
||||||
SLOT(readPdbStandardOutput()));
|
this, &PdbEngine::readPdbStandardOutput);
|
||||||
connect(&m_pdbProc, SIGNAL(readyReadStandardError()),
|
connect(&m_pdbProc, &QProcess::readyReadStandardError,
|
||||||
SLOT(readPdbStandardError()));
|
this, &PdbEngine::readPdbStandardError);
|
||||||
|
|
||||||
connect(this, SIGNAL(outputReady(QByteArray)),
|
connect(this, &PdbEngine::outputReady,
|
||||||
SLOT(handleOutput2(QByteArray)), Qt::QueuedConnection);
|
this, &PdbEngine::handleOutput2, Qt::QueuedConnection);
|
||||||
|
|
||||||
// We will stop immediately, so setup a proper callback.
|
// We will stop immediately, so setup a proper callback.
|
||||||
PdbCommand cmd;
|
PdbCommand cmd;
|
||||||
|
|||||||
@@ -116,11 +116,11 @@ private:
|
|||||||
QString errorMessage(QProcess::ProcessError error) const;
|
QString errorMessage(QProcess::ProcessError error) const;
|
||||||
bool hasCapability(unsigned cap) const;
|
bool hasCapability(unsigned cap) const;
|
||||||
|
|
||||||
Q_SLOT void handlePdbFinished(int, QProcess::ExitStatus status);
|
void handlePdbFinished(int, QProcess::ExitStatus status);
|
||||||
Q_SLOT void handlePdbError(QProcess::ProcessError error);
|
void handlePdbError(QProcess::ProcessError error);
|
||||||
Q_SLOT void readPdbStandardOutput();
|
void readPdbStandardOutput();
|
||||||
Q_SLOT void readPdbStandardError();
|
void readPdbStandardError();
|
||||||
Q_SLOT void handleOutput2(const QByteArray &data);
|
void handleOutput2(const QByteArray &data);
|
||||||
void handleResponse(const QByteArray &ba);
|
void handleResponse(const QByteArray &ba);
|
||||||
void handleOutput(const QByteArray &data);
|
void handleOutput(const QByteArray &data);
|
||||||
void updateAll();
|
void updateAll();
|
||||||
|
|||||||
@@ -147,11 +147,16 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
|
|||||||
mainLayout->addRow(buttonsLine);
|
mainLayout->addRow(buttonsLine);
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
connect(m_pathChooser, SIGNAL(beforeBrowsing()), this, SLOT(selectExecutable()));
|
connect(m_pathChooser, &Utils::PathChooser::beforeBrowsing,
|
||||||
connect(m_watchingPushButton, SIGNAL(toggled(bool)), this, SLOT(startStopWatching(bool)));
|
this, &UnstartedAppWatcherDialog::selectExecutable);
|
||||||
connect(m_pathChooser, SIGNAL(pathChanged(QString)), this, SLOT(stopAndCheckExecutable()));
|
connect(m_watchingPushButton, &QAbstractButton::toggled,
|
||||||
connect(m_closePushButton, SIGNAL(clicked()), this, SLOT(reject()));
|
this, &UnstartedAppWatcherDialog::startStopWatching);
|
||||||
connect(&m_timer, SIGNAL(timeout()), this, SLOT(findProcess()));
|
connect(m_pathChooser, &Utils::PathChooser::pathChanged, this,
|
||||||
|
&UnstartedAppWatcherDialog::stopAndCheckExecutable);
|
||||||
|
connect(m_closePushButton, &QAbstractButton::clicked,
|
||||||
|
this, &QDialog::reject);
|
||||||
|
connect(&m_timer, &QTimer::timeout,
|
||||||
|
this, &UnstartedAppWatcherDialog::findProcess);
|
||||||
connect(m_kitChooser, &KitChooser::currentIndexChanged,
|
connect(m_kitChooser, &KitChooser::currentIndexChanged,
|
||||||
this, &UnstartedAppWatcherDialog::kitChanged);
|
this, &UnstartedAppWatcherDialog::kitChanged);
|
||||||
kitChanged();
|
kitChanged();
|
||||||
|
|||||||
@@ -62,20 +62,19 @@ public:
|
|||||||
ProjectExplorer::DeviceProcessItem currentProcess() const;
|
ProjectExplorer::DeviceProcessItem currentProcess() const;
|
||||||
bool hideOnAttach() const;
|
bool hideOnAttach() const;
|
||||||
bool continueOnAttach() const;
|
bool continueOnAttach() const;
|
||||||
|
|
||||||
public slots:
|
|
||||||
void selectExecutable();
|
|
||||||
void startWatching();
|
void startWatching();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void processFound();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void selectExecutable();
|
||||||
void pidFound(const ProjectExplorer::DeviceProcessItem &p);
|
void pidFound(const ProjectExplorer::DeviceProcessItem &p);
|
||||||
void startStopWatching(bool start);
|
void startStopWatching(bool start);
|
||||||
void findProcess();
|
void findProcess();
|
||||||
void stopAndCheckExecutable();
|
void stopAndCheckExecutable();
|
||||||
void kitChanged();
|
void kitChanged();
|
||||||
|
|
||||||
signals:
|
|
||||||
void processFound();
|
|
||||||
|
|
||||||
private:
|
|
||||||
enum UnstartedAppWacherState
|
enum UnstartedAppWacherState
|
||||||
{
|
{
|
||||||
InvalidWacherState,
|
InvalidWacherState,
|
||||||
|
|||||||
Reference in New Issue
Block a user