Commit cad399f9 authored by hjk's avatar hjk

Debugger: Convert some connects to Qt 5 style

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