Commit 6a4d6efb authored by Montel Laurent's avatar Montel Laurent Committed by hjk

Port to new connect api

Change-Id: I84834f37dd15108ed8c5fbf5353bcabc4e564f70
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 380acb5b
......@@ -55,8 +55,8 @@ PluginErrorOverview::PluginErrorOverview(QWidget *parent) :
}
}
connect(m_ui->pluginList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
this, SLOT(showDetails(QListWidgetItem*)));
connect(m_ui->pluginList, &QListWidget::currentItemChanged,
this, &PluginErrorOverview::showDetails);
if (m_ui->pluginList->count() > 0)
m_ui->pluginList->setCurrentRow(0);
......
......@@ -87,18 +87,18 @@ SftpChannel::SftpChannel(quint32 channelId,
Internal::SshSendFacility &sendFacility)
: d(new Internal::SftpChannelPrivate(channelId, sendFacility, this))
{
connect(d, SIGNAL(initialized()), this, SIGNAL(initialized()),
Qt::QueuedConnection);
connect(d, SIGNAL(channelError(QString)), this,
SIGNAL(channelError(QString)), Qt::QueuedConnection);
connect(d, SIGNAL(dataAvailable(QSsh::SftpJobId,QString)), this,
SIGNAL(dataAvailable(QSsh::SftpJobId,QString)), Qt::QueuedConnection);
connect(d, SIGNAL(fileInfoAvailable(QSsh::SftpJobId,QList<QSsh::SftpFileInfo>)), this,
SIGNAL(fileInfoAvailable(QSsh::SftpJobId,QList<QSsh::SftpFileInfo>)),
Qt::QueuedConnection);
connect(d, SIGNAL(finished(QSsh::SftpJobId,QString)), this,
SIGNAL(finished(QSsh::SftpJobId,QString)), Qt::QueuedConnection);
connect(d, SIGNAL(closed()), this, SIGNAL(closed()), Qt::QueuedConnection);
connect(d, &Internal::SftpChannelPrivate::initialized,
this, &SftpChannel::initialized, Qt::QueuedConnection);
connect(d, &Internal::SftpChannelPrivate::channelError,
this, &SftpChannel::channelError, Qt::QueuedConnection);
connect(d, &Internal::SftpChannelPrivate::dataAvailable,
this, &SftpChannel::dataAvailable, Qt::QueuedConnection);
connect(d, &Internal::SftpChannelPrivate::fileInfoAvailable,
this, &SftpChannel::fileInfoAvailable, Qt::QueuedConnection);
connect(d, &Internal::SftpChannelPrivate::finished,
this, &SftpChannel::finished, Qt::QueuedConnection);
connect(d, &Internal::SftpChannelPrivate::closed,
this, &SftpChannel::closed, Qt::QueuedConnection);
}
SftpChannel::State SftpChannel::state() const
......
......@@ -115,12 +115,14 @@ void SftpFileSystemModel::setSshConnection(const SshConnectionParameters &sshPar
{
QSSH_ASSERT_AND_RETURN(!d->sshConnection);
d->sshConnection = QSsh::acquireConnection(sshParams);
connect(d->sshConnection, SIGNAL(error(QSsh::SshError)), SLOT(handleSshConnectionFailure()));
connect(d->sshConnection, &SshConnection::error,
this, &SftpFileSystemModel::handleSshConnectionFailure);
if (d->sshConnection->state() == SshConnection::Connected) {
handleSshConnectionEstablished();
return;
}
connect(d->sshConnection, SIGNAL(connected()), SLOT(handleSshConnectionEstablished()));
connect(d->sshConnection, &SshConnection::connected,
this, &SftpFileSystemModel::handleSshConnectionEstablished);
if (d->sshConnection->state() == SshConnection::Unconnected)
d->sshConnection->connectToHost();
}
......
......@@ -122,7 +122,8 @@ public:
// create a new connection:
SshConnection * const connection = new SshConnection(sshParams);
connect(connection, SIGNAL(disconnected()), this, SLOT(cleanup()));
connect(connection, &SshConnection::disconnected,
this, &SshConnectionManager::cleanup);
m_acquiredConnections.append(connection);
return connection;
......
......@@ -56,10 +56,14 @@ SshKeyCreationDialog::SshKeyCreationDialog(QWidget *parent)
+ QLatin1String("/.ssh/qtc_id");
setPrivateKeyFile(defaultPath);
connect(m_ui->rsa, SIGNAL(toggled(bool)), this, SLOT(keyTypeChanged()));
connect(m_ui->dsa, SIGNAL(toggled(bool)), this, SLOT(keyTypeChanged()));
connect(m_ui->privateKeyFileButton, SIGNAL(clicked()), SLOT(handleBrowseButtonClicked()));
connect(m_ui->generateButton, SIGNAL(clicked()), this, SLOT(generateKeys()));
connect(m_ui->rsa, &QRadioButton::toggled,
this, &SshKeyCreationDialog::keyTypeChanged);
connect(m_ui->dsa, &QRadioButton::toggled,
this, &SshKeyCreationDialog::keyTypeChanged);
connect(m_ui->privateKeyFileButton, &QPushButton::clicked,
this, &SshKeyCreationDialog::handleBrowseButtonClicked);
connect(m_ui->generateButton, &QPushButton::clicked,
this, &SshKeyCreationDialog::generateKeys);
}
SshKeyCreationDialog::~SshKeyCreationDialog()
......
......@@ -160,15 +160,18 @@ void SshRemoteProcess::setReadChannel(QProcess::ProcessChannel channel)
void SshRemoteProcess::init()
{
connect(d, SIGNAL(started()), this, SIGNAL(started()),
Qt::QueuedConnection);
connect(d, SIGNAL(readyReadStandardOutput()), this, SIGNAL(readyReadStandardOutput()),
Qt::QueuedConnection);
connect(d, SIGNAL(readyRead()), this, SIGNAL(readyRead()), Qt::QueuedConnection);
connect(d, SIGNAL(readyReadStandardError()), this,
SIGNAL(readyReadStandardError()), Qt::QueuedConnection);
connect(d, SIGNAL(closed(int)), this, SIGNAL(closed(int)), Qt::QueuedConnection);
connect(d, SIGNAL(eof()), SIGNAL(readChannelFinished()), Qt::QueuedConnection);
connect(d, &Internal::SshRemoteProcessPrivate::started,
this, &SshRemoteProcess::started, Qt::QueuedConnection);
connect(d, &Internal::SshRemoteProcessPrivate::readyReadStandardOutput,
this, &SshRemoteProcess::readyReadStandardOutput, Qt::QueuedConnection);
connect(d, &Internal::SshRemoteProcessPrivate::readyRead,
this, &SshRemoteProcess::readyRead, Qt::QueuedConnection);
connect(d, &Internal::SshRemoteProcessPrivate::readyReadStandardError,
this, &SshRemoteProcess::readyReadStandardError, Qt::QueuedConnection);
connect(d, &Internal::SshRemoteProcessPrivate::closed,
this, &SshRemoteProcess::closed, Qt::QueuedConnection);
connect(d, &Internal::SshRemoteProcessPrivate::eof,
this, &SshRemoteProcess::readChannelFinished, Qt::QueuedConnection);
}
void SshRemoteProcess::addToEnvironment(const QByteArray &var, const QByteArray &value)
......
......@@ -113,13 +113,14 @@ void SshRemoteProcessRunner::runInternal(const QByteArray &command,
d->m_exitCode = -1;
d->m_command = command;
d->m_connection = QSsh::acquireConnection(sshParams);
connect(d->m_connection, SIGNAL(error(QSsh::SshError)),
SLOT(handleConnectionError(QSsh::SshError)));
connect(d->m_connection, SIGNAL(disconnected()), SLOT(handleDisconnected()));
connect(d->m_connection, &SshConnection::error,
this, &SshRemoteProcessRunner::handleConnectionError);
connect(d->m_connection, &SshConnection::disconnected,
this, &SshRemoteProcessRunner::handleDisconnected);
if (d->m_connection->state() == SshConnection::Connected) {
handleConnected();
} else {
connect(d->m_connection, SIGNAL(connected()), SLOT(handleConnected()));
connect(d->m_connection, &SshConnection::connected, this, &SshRemoteProcessRunner::handleConnected);
if (d->m_connection->state() == SshConnection::Unconnected)
d->m_connection->connectToHost();
}
......
......@@ -53,8 +53,10 @@ TimelineModelAggregator::TimelineModelAggregator(TimelineNotesModel *notes, QObj
: QObject(parent), d(new TimelineModelAggregatorPrivate(this))
{
d->notesModel = notes;
connect(this,SIGNAL(modelsChanged()),this,SIGNAL(heightChanged()));
connect(this,SIGNAL(stateChanged()),this,SIGNAL(heightChanged()));
connect(this, &TimelineModelAggregator::modelsChanged,
this, &TimelineModelAggregator::heightChanged);
connect(this, &TimelineModelAggregator::stateChanged,
this, &TimelineModelAggregator::heightChanged);
}
TimelineModelAggregator::~TimelineModelAggregator()
......
......@@ -34,7 +34,7 @@ namespace Timeline {
TimelineZoomControl::TimelineZoomControl(QObject *parent) : QObject(parent), m_traceStart(-1), m_traceEnd(-1),
m_windowStart(-1), m_windowEnd(-1), m_rangeStart(-1), m_rangeEnd(-1), m_windowLocked(false)
{
connect(&m_timer, SIGNAL(timeout()), this, SLOT(moveWindow()));
connect(&m_timer, &QTimer::timeout, this, &TimelineZoomControl::moveWindow);
}
void TimelineZoomControl::clear()
......
......@@ -85,25 +85,25 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title,
ui.treeView->header()->setVisible(false);
ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(addAccepted()));
connect(ui.newFolderButton, SIGNAL(clicked()), this, SLOT(addNewFolder()));
connect(ui.toolButton, SIGNAL(clicked()), this, SLOT(toolButtonClicked()));
connect(ui.bookmarkEdit, SIGNAL(textChanged(QString)), this,
SLOT(textChanged(QString)));
connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &BookmarkDialog::reject);
connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &BookmarkDialog::addAccepted);
connect(ui.newFolderButton, &QPushButton::clicked, this, &BookmarkDialog::addNewFolder);
connect(ui.toolButton, &QToolButton::clicked, this, &BookmarkDialog::toolButtonClicked);
connect(ui.bookmarkEdit, &QLineEdit::textChanged, this, &BookmarkDialog::textChanged);
connect(bookmarkManager->treeBookmarkModel(),
SIGNAL(itemChanged(QStandardItem*)),
this, SLOT(itemChanged(QStandardItem*)));
&QStandardItemModel::itemChanged,
this, &BookmarkDialog::itemChanged);
connect(ui.bookmarkFolders, SIGNAL(currentIndexChanged(QString)), this,
SLOT(selectBookmarkFolder(QString)));
connect(ui.bookmarkFolders,
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &BookmarkDialog::selectBookmarkFolder);
connect(ui.treeView, SIGNAL(customContextMenuRequested(QPoint)), this,
SLOT(customContextMenuRequested(QPoint)));
connect(ui.treeView, &TreeView::customContextMenuRequested,
this, &BookmarkDialog::customContextMenuRequested);
connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex,
QModelIndex)), this, SLOT(currentChanged(QModelIndex)));
connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)),
this, SLOT(currentChanged(QModelIndex)));
}
BookmarkDialog::~BookmarkDialog()
......@@ -437,8 +437,8 @@ void BookmarkWidget::setup()
vlayout->addWidget(toolbar);
searchField->installEventFilter(this);
connect(searchField, SIGNAL(textChanged(QString)), this,
SLOT(filterChanged()));
connect(searchField, &Utils::FancyLineEdit::textChanged,
this, &BookmarkWidget::filterChanged);
treeView = new TreeView(this);
vlayout->addWidget(treeView);
......@@ -453,14 +453,11 @@ void BookmarkWidget::setup()
treeView->viewport()->installEventFilter(this);
treeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(treeView, SIGNAL(expanded(QModelIndex)), this,
SLOT(expand(QModelIndex)));
connect(treeView, SIGNAL(collapsed(QModelIndex)), this,
SLOT(expand(QModelIndex)));
connect(treeView, SIGNAL(activated(QModelIndex)), this,
SLOT(activated(QModelIndex)));
connect(treeView, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(customContextMenuRequested(QPoint)));
connect(treeView, &TreeView::expanded, this, &BookmarkWidget::expand);
connect(treeView, &TreeView::collapsed, this, &BookmarkWidget::expand);
connect(treeView, &TreeView::activated, this, &BookmarkWidget::activated);
connect(treeView, &TreeView::customContextMenuRequested,
this, &BookmarkWidget::customContextMenuRequested);
filterBookmarkModel->setFilterKeyColumn(0);
filterBookmarkModel->setDynamicSortFilter(true);
......@@ -582,8 +579,8 @@ BookmarkManager::BookmarkManager()
, treeModel(new BookmarkModel(0, 1, this))
, listModel(new BookmarkModel(0, 1, this))
{
connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this,
SLOT(itemChanged(QStandardItem*)));
connect(treeModel, &BookmarkModel::itemChanged,
this, &BookmarkManager::itemChanged);
}
BookmarkManager::~BookmarkManager()
......
......@@ -69,12 +69,14 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword,
if (m_filterModel->rowCount() != 0)
ui.listWidget->setCurrentIndex(m_filterModel->index(0, 0));
connect(ui.buttonDisplay, SIGNAL(clicked()), this, SLOT(acceptDialog()));
connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(ui.listWidget, SIGNAL(activated(QModelIndex)), this,
SLOT(activated(QModelIndex)));
connect(ui.lineEdit, SIGNAL(filterChanged(QString)), this,
SLOT(setFilter(QString)));
connect(ui.buttonDisplay, &QPushButton::clicked,
this, &TopicChooser::acceptDialog);
connect(ui.buttonCancel, &QPushButton::clicked,
this, &TopicChooser::reject);
connect(ui.listWidget, &QListView::activated,
this, &TopicChooser::activated);
connect(ui.lineEdit, &Utils::FancyLineEdit::filterChanged,
this, &TopicChooser::setFilter);
}
QUrl TopicChooser::link() const
......
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