Commit 032195f3 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Modernize connect syntax

parent 36c23367
......@@ -62,10 +62,10 @@ CDDBConfigWidget::CDDBConfigWidget(QWidget * parent)
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(groupBox);
connect(needsAuthenticationBox,SIGNAL(toggled(bool)),SLOT(needAuthenticationChanged(bool)));
connect(kcfg_FreedbLookupTransport,SIGNAL(activated(int)),SLOT(protocolChanged()));
connect(kcfg_FreedbLookupEnabled,SIGNAL(toggled(bool)),freedbServerBox,SLOT(setEnabled(bool)));
connect(mirrorListButton,SIGNAL(clicked()),SLOT(showMirrorList()));
connect(needsAuthenticationBox,&QAbstractButton::toggled,this, &CDDBConfigWidget::needAuthenticationChanged);
connect(kcfg_FreedbLookupTransport,&QComboBox::activated,this, &CDDBConfigWidget::protocolChanged);
connect(kcfg_FreedbLookupEnabled,&QAbstractButton::toggled,freedbServerBox,&QWidget::setEnabled);
connect(mirrorListButton,&QAbstractButton::clicked,this, &CDDBConfigWidget::showMirrorList);
}
void CDDBConfigWidget::showMirrorList()
......
......@@ -48,10 +48,10 @@ namespace KCDDB
connect (socket_, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(slotGotError(QAbstractSocket::SocketError)));
connect (socket_, SIGNAL(connected()),
SLOT(slotConnectionSuccess()) );
connect (socket_, &QAbstractSocket::connected,
this, &AsyncCDDBPLookup::slotConnectionSuccess );
connect (socket_, SIGNAL(readyRead()), SLOT(slotReadyRead()) );
connect (socket_, &QIODevice::readyRead, this, &AsyncCDDBPLookup::slotReadyRead );
trackOffsetList_ = trackOffsetList;
......
......@@ -46,8 +46,8 @@ namespace KCDDB
{
trackOffsetList_ = trackOffsetList;
connect( this, SIGNAL(queryReady()), SLOT(slotQueryReady()) );
connect( this, SIGNAL(readReady()), SLOT(requestCDInfoForMatch()) );
connect( this, &HTTPLookup::queryReady, this, &AsyncHTTPLookup::slotQueryReady );
connect( this, &HTTPLookup::readReady, this, &AsyncHTTPLookup::requestCDInfoForMatch );
initURL( hostName, port );
......@@ -134,10 +134,10 @@ namespace KCDDB
if ( nullptr == job )
return ServerError;
connect( job, SIGNAL(data(KIO::Job*,QByteArray)),
SLOT(slotData(KIO::Job*,QByteArray)) );
connect( job, SIGNAL(result(KJob*)),
SLOT(slotResult(KJob*)) );
connect( job, &KIO::TransferJob::data,
this, &AsyncHTTPLookup::slotData );
connect( job, &KJob::result,
this, &AsyncHTTPLookup::slotResult );
return Success;
}
......
......@@ -37,7 +37,7 @@ namespace KCDDB
Result AsyncHTTPSubmit::runJob(KIO::Job* job)
{
connect(job, SIGNAL(result(KJob*)), SLOT(slotFinished(KJob*)));
connect(job, &KJob::result, this, &AsyncHTTPSubmit::slotFinished);
return Success;
}
......
......@@ -40,8 +40,8 @@ namespace KCDDB
Result AsyncSMTPSubmit::runJob(KIO::Job* job)
{
connect( job, SIGNAL(result(KJob*)),
this, SLOT(slotDone(KJob*)) );
connect( job, &KJob::result,
this, &AsyncSMTPSubmit::slotDone );
return Success;
}
......
......@@ -84,18 +84,18 @@ class CDInfoDialog::Private
// We want control over the visibility of this column. See artistChanged().
d->ui->m_trackList->header()->setSectionResizeMode(Private::TRACK_ARTIST, QHeaderView::Interactive);
connect( d->ui->m_trackList, SIGNAL(activated(QModelIndex)), this, SLOT(slotTrackSelected(QModelIndex)) );
connect( d->ui->m_trackList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotTrackDoubleClicked(QModelIndex)) );
connect( d->ui->m_artist, SIGNAL(textChanged(QString)), this, SLOT(artistChanged(QString)) );
connect( d->ui->m_trackList, &QAbstractItemView::activated, this, &CDInfoDialog::slotTrackSelected );
connect( d->ui->m_trackList, &QAbstractItemView::doubleClicked, this, &CDInfoDialog::slotTrackDoubleClicked );
connect( d->ui->m_artist, &QLineEdit::textChanged, this, &CDInfoDialog::artistChanged );
connect( d->ui->m_genre, SIGNAL(textChanged(QString)), this, SLOT(genreChanged(QString)) );
connect( d->ui->m_multiple, SIGNAL(toggled(bool)), this, SLOT(slotMultipleArtists(bool)) );
connect( d->ui->m_multiple, &QAbstractButton::toggled, this, &CDInfoDialog::slotMultipleArtists );
connect(d->ui->m_changeEncoding,SIGNAL(clicked()),SLOT(slotChangeEncoding()));
connect(d->ui->m_changeEncoding,&QAbstractButton::clicked,this, &CDInfoDialog::slotChangeEncoding);
QDialogButtonBox *bbox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
layout->addWidget(bbox);
connect(bbox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), SLOT(accept()));
connect(bbox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), SLOT(close()));
connect(bbox->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, this, &QDialog::accept);
connect(bbox->button(QDialogButtonBox::Cancel), &QAbstractButton::clicked, this, &QWidget::close);
}
void CDInfoDialog::slotTrackSelected( const QModelIndex &index )
......
......@@ -193,8 +193,8 @@ namespace KCDDB
{
AsyncMusicBrainzLookup* lookup = new AsyncMusicBrainzLookup();
connect( lookup, SIGNAL(finished(KCDDB::Result)),
SLOT(slotFinished(KCDDB::Result)) );
connect( lookup, &AsyncMusicBrainzLookup::finished,
this, &Client::slotFinished );
d->pendingLookups.append( lookup );
}
#endif
......@@ -207,16 +207,16 @@ namespace KCDDB
{
AsyncCDDBPLookup* lookup = new AsyncCDDBPLookup();
connect( lookup, SIGNAL(finished(KCDDB::Result)),
SLOT(slotFinished(KCDDB::Result)) );
connect( lookup, &AsyncCDDBPLookup::finished,
this, &Client::slotFinished );
d->pendingLookups.append( lookup );
}
else
{
AsyncHTTPLookup* lookup = new AsyncHTTPLookup();
connect( lookup, SIGNAL(finished(KCDDB::Result)),
SLOT(slotFinished(KCDDB::Result)) );
connect( lookup, &AsyncHTTPLookup::finished,
this, &Client::slotFinished );
d->pendingLookups.append( lookup );
}
}
......@@ -299,8 +299,8 @@ namespace KCDDB
{
d->cdInfoSubmit = new AsyncHTTPSubmit(from, hostname, port);
connect( static_cast<AsyncHTTPSubmit *>( d->cdInfoSubmit ),
SIGNAL(finished(KCDDB::Result)),
SLOT(slotSubmitFinished(KCDDB::Result)) );
&AsyncHTTPSubmit::finished,
this, &Client::slotSubmitFinished );
}
break;
......@@ -317,8 +317,8 @@ namespace KCDDB
{
d->cdInfoSubmit = new AsyncSMTPSubmit( hostname, port, username, from, d->config.submitAddress() );
connect( static_cast<AsyncSMTPSubmit *>( d->cdInfoSubmit ),
SIGNAL(finished(KCDDB::Result)),
SLOT(slotSubmitFinished(KCDDB::Result)) );
&AsyncSMTPSubmit::finished,
this, &Client::slotSubmitFinished );
}
break;
}
......
......@@ -58,7 +58,7 @@ namespace KCDDB
{
m_lookupThread = new LookupThread();
m_lookupThread->m_offsetList = trackOffsetList;
connect(m_lookupThread, SIGNAL(finished()), SLOT(lookupFinished()));
connect(m_lookupThread, &QThread::finished, this, &AsyncMusicBrainzLookup::lookupFinished);
m_lookupThread->start();
......
......@@ -35,7 +35,7 @@ void AsyncCDDBLookupTest::testLookup()
client_->config().setFreedbLookupTransport(Lookup::CDDBP);
client_->setBlockingMode( false );
connect(client_,SIGNAL(finished(KCDDB::Result)),SLOT(slotFinished(KCDDB::Result)));
connect(client_,&KCDDB::Client::finished,this, &AsyncCDDBLookupTest::slotFinished);
TrackOffsetList list;
......
......@@ -36,7 +36,7 @@ void AsyncHTTPLookupTest::testLookup()
client_->config().setFreedbLookupTransport(Lookup::HTTP);
client_->setBlockingMode( false );
connect(client_, SIGNAL(finished(KCDDB::Result)), SLOT(slotFinished(KCDDB::Result)));
connect(client_, &KCDDB::Client::finished, this, &AsyncHTTPLookupTest::slotFinished);
TrackOffsetList list;
......
......@@ -59,7 +59,7 @@ AsyncHTTPSubmitTest::AsyncHTTPSubmitTest(QCoreApplication& app)
cdInfo.track(3).set(QString::fromUtf8("title"), QString::fromUtf8("*"));
cdInfo.track(4).set(QString::fromUtf8("title"), QString::fromUtf8("Jätteödlan Bronto"));
connect(client_,SIGNAL(finished(KCDDB::Result)),SLOT(slotFinished(KCDDB::Result)));
connect(client_,&KCDDB::Client::finished,this, &AsyncHTTPSubmitTest::slotFinished);
client_->submit(cdInfo, list);
}
......
......@@ -38,7 +38,7 @@ void AsyncMusicBrainzTest::testLookup()
client_->config().setMusicBrainzLookupEnabled(true);
client_->setBlockingMode( false );
connect(client_,SIGNAL(finished(KCDDB::Result)),SLOT(slotFinished(KCDDB::Result)));
connect(client_,&KCDDB::Client::finished,this, &AsyncMusicBrainzTest::slotFinished);
TrackOffsetList list;
......
......@@ -60,7 +60,7 @@ AsyncSMTPSubmitTest::AsyncSMTPSubmitTest(QCoreApplication& app)
cdInfo.track(3).set(QString::fromUtf8("title"), QString::fromUtf8("*"));
cdInfo.track(4).set(QString::fromUtf8("title"), QString::fromUtf8("Jätteödlan Bronto"));
connect(client_,SIGNAL(finished(KCDDB::Result)),SLOT(slotFinished(KCDDB::Result)));
connect(client_,&KCDDB::Client::finished,this, &AsyncSMTPSubmitTest::slotFinished);
client_->submit(cdInfo, list);
}
......
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