Convert to the new signal-slot syntax

This commit is contained in:
Luca Beltrame 2014-10-03 23:17:52 +02:00
parent 55a866dbf3
commit 8e2e9ecbc3
5 changed files with 16 additions and 30 deletions

View file

@ -56,10 +56,8 @@ namespace Danbooru {
// signal-slot connections // signal-slot connections
connect(m_delegate, SIGNAL(postDownloadRequested(QUrl)), this, connect(m_delegate, &DanbooruPostDelegate::postDownloadRequested, this, &DanbooruClientView::slotHandleDownload);
SLOT(slotHandleDownload(QUrl))); connect(m_delegate, &DanbooruPostDelegate::postViewRequested, this, &DanbooruClientView::slotHandleView);
connect(m_delegate, SIGNAL(postViewRequested(QUrl)), this,
SLOT(slotHandleView(QUrl)));
// connect(m_listView, SIGNAL(clicked(const QModelIndex&)), parent(), // connect(m_listView, SIGNAL(clicked(const QModelIndex&)), parent(),
// SLOT(displayInfo(const QModelIndex&)); // SLOT(displayInfo(const QModelIndex&));

View file

@ -82,18 +82,14 @@ DanbooruConnectWidget::DanbooruConnectWidget(QVector< QUrl > urlList,
Wallet::Asynchronous Wallet::Asynchronous
); );
connect(m_wallet, SIGNAL(walletOpened(bool)), this, connect(m_wallet, &KWallet::Wallet::walletOpened, this, &DanbooruConnectWidget::checkWallet);
SLOT(checkWallet(bool)));
connect(danbooruUrlComboBox, SIGNAL(currentIndexChanged(int)), this, connect(danbooruUrlComboBox, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &DanbooruConnectWidget::getWalletData);
SLOT(getWalletData()));
connect(anonCheckBox, SIGNAL(stateChanged(int)), this, connect(anonCheckBox, &QCheckBox::stateChanged, this, &DanbooruConnectWidget::toggleLineEdits);
SLOT(toggleLineEdits()));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, &KDialogButtonBox::accepted, this, &DanbooruConnectWidget::accept);
connect(closeButton, SIGNAL(clicked(bool)), this, connect(closeButton, &KPushButton::clicked, this, &DanbooruConnectWidget::emitRejected);
SLOT(emitRejected()));
} }

View file

@ -95,8 +95,7 @@ void DanbooruService::getPostList(int page, QStringList tags, int limit)
// This job can use JSON data // This job can use JSON data
job->setProperty("needsXML", false); job->setProperty("needsXML", false);
connect(job, SIGNAL(result(KJob*)), this, connect(job, &KIO::StoredTransferJob::result, this, &DanbooruService::processPostList);
SLOT(processPostList(KJob*)));
} }
@ -117,7 +116,7 @@ void DanbooruService::getTagList(int limit, QString name)
KIO::StoredTransferJob* job = KIO::storedGet(danbooruUrl, KIO::NoReload, KIO::StoredTransferJob* job = KIO::storedGet(danbooruUrl, KIO::NoReload,
KIO::HideProgressInfo); KIO::HideProgressInfo);
connect(job, SIGNAL(result(KJob*)), this, SLOT(processTagList(KJob*))); connect(job, &KIO::StoredTransferJob::result, this, &DanbooruService::processTagList);
} }
void DanbooruService::getPool(int poolId, int page) void DanbooruService::getPool(int poolId, int page)
@ -145,8 +144,7 @@ void DanbooruService::getPool(int poolId, int page)
job->setProperty("needsXML", true); job->setProperty("needsXML", true);
connect(job, SIGNAL(result(KJob*)), this, connect(job, &KIO::StoredTransferJob::result, this, &DanbooruService::processPostList);
SLOT(processPostList(KJob*)));
} }
@ -172,8 +170,7 @@ void DanbooruService::getPoolList(int page)
// This job can use JSON data // This job can use JSON data
job->setProperty("needsXML", false); job->setProperty("needsXML", false);
connect(job, SIGNAL(result(KJob*)), this, connect(job, &KIO::StoredTransferJob::result, this, &DanbooruService::processPoolList);
SLOT(processPoolList(KJob*)));
} }
@ -213,8 +210,7 @@ void DanbooruService::getRelatedTags(const QStringList& tags,
KIO::HideProgressInfo KIO::HideProgressInfo
); );
connect(job, SIGNAL(result(KJob*)), this, connect(job, &StoredTransferJob::result, this, &DanbooruService::processRelatedTagList);
SLOT(processRelatedTagList(KJob*)));
} }
@ -400,8 +396,7 @@ void DanbooruService::processPostList(KJob* job)
pixmapJob->setProperty("danbooruPost", variant); pixmapJob->setProperty("danbooruPost", variant);
connect(pixmapJob, SIGNAL(result(KJob*)), this, connect(pixmapJob, &StoredTransferJob::result, this, &DanbooruService::downloadThumbnail);
SLOT(downloadThumbnail(KJob*)));
} }

View file

@ -83,8 +83,7 @@ namespace Danbooru {
// actionCollection()->removeAction(actionCollection()->action("help_contents")); // actionCollection()->removeAction(actionCollection()->action("help_contents"));
KStandardAction::quit(qApp, SLOT(close()), actionCollection()); KStandardAction::quit(qApp, SLOT(close()), actionCollection());
connect(connectAction, SIGNAL(triggered(bool)), this, connect(connectAction, &QAction::triggered, this, &DanbooruMainWindow::connectToBoard);
SLOT(connectToBoard()));
connect(fetch, SIGNAL(triggered(bool)), this, SLOT(downloadPosts())); connect(fetch, SIGNAL(triggered(bool)), this, SLOT(downloadPosts()));
} }

View file

@ -74,10 +74,8 @@ namespace Danbooru {
// Signal-slot connections // Signal-slot connections
connect(m_viewButton, SIGNAL(clicked()), this, connect(m_viewButton, &QPushButton::clicked, this, &DanbooruPostDelegate::viewButtonClicked);
SLOT(viewButtonClicked())); connect(m_downloadButton, &QPushButton::clicked, this, &DanbooruPostDelegate::downloadButtonClicked);
connect(m_downloadButton, SIGNAL(clicked()), this,
SLOT(downloadButtonClicked()));
} }