Convert to the new signal-slot syntax
This commit is contained in:
		
					parent
					
						
							
								55a866dbf3
							
						
					
				
			
			
				commit
				
					
						8e2e9ecbc3
					
				
			
		
					 5 changed files with 16 additions and 30 deletions
				
			
		| 
						 | 
				
			
			@ -56,10 +56,8 @@ namespace Danbooru {
 | 
			
		|||
 | 
			
		||||
        // signal-slot connections
 | 
			
		||||
 | 
			
		||||
        connect(m_delegate, SIGNAL(postDownloadRequested(QUrl)), this,
 | 
			
		||||
            SLOT(slotHandleDownload(QUrl)));
 | 
			
		||||
        connect(m_delegate, SIGNAL(postViewRequested(QUrl)), this,
 | 
			
		||||
            SLOT(slotHandleView(QUrl)));
 | 
			
		||||
        connect(m_delegate, &DanbooruPostDelegate::postDownloadRequested, this, &DanbooruClientView::slotHandleDownload);
 | 
			
		||||
        connect(m_delegate, &DanbooruPostDelegate::postViewRequested, this, &DanbooruClientView::slotHandleView);
 | 
			
		||||
//         connect(m_listView, SIGNAL(clicked(const QModelIndex&)), parent(),
 | 
			
		||||
//             SLOT(displayInfo(const QModelIndex&));
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,18 +82,14 @@ DanbooruConnectWidget::DanbooruConnectWidget(QVector< QUrl > urlList,
 | 
			
		|||
        Wallet::Asynchronous
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    connect(m_wallet, SIGNAL(walletOpened(bool)), this,
 | 
			
		||||
            SLOT(checkWallet(bool)));
 | 
			
		||||
    connect(m_wallet, &KWallet::Wallet::walletOpened, this, &DanbooruConnectWidget::checkWallet);
 | 
			
		||||
 | 
			
		||||
    connect(danbooruUrlComboBox, SIGNAL(currentIndexChanged(int)), this,
 | 
			
		||||
            SLOT(getWalletData()));
 | 
			
		||||
    connect(danbooruUrlComboBox, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &DanbooruConnectWidget::getWalletData);
 | 
			
		||||
 | 
			
		||||
    connect(anonCheckBox, SIGNAL(stateChanged(int)), this,
 | 
			
		||||
        SLOT(toggleLineEdits()));
 | 
			
		||||
    connect(anonCheckBox, &QCheckBox::stateChanged, this, &DanbooruConnectWidget::toggleLineEdits);
 | 
			
		||||
 | 
			
		||||
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
 | 
			
		||||
    connect(closeButton, SIGNAL(clicked(bool)), this,
 | 
			
		||||
        SLOT(emitRejected()));
 | 
			
		||||
    connect(buttonBox, &KDialogButtonBox::accepted, this, &DanbooruConnectWidget::accept);
 | 
			
		||||
    connect(closeButton, &KPushButton::clicked, this, &DanbooruConnectWidget::emitRejected);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -95,8 +95,7 @@ void DanbooruService::getPostList(int page, QStringList tags, int limit)
 | 
			
		|||
    // This job can use JSON data
 | 
			
		||||
    job->setProperty("needsXML", false);
 | 
			
		||||
 | 
			
		||||
    connect(job, SIGNAL(result(KJob*)), this,
 | 
			
		||||
            SLOT(processPostList(KJob*)));
 | 
			
		||||
    connect(job, &KIO::StoredTransferJob::result, this, &DanbooruService::processPostList);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -117,7 +116,7 @@ void DanbooruService::getTagList(int limit, QString name)
 | 
			
		|||
    KIO::StoredTransferJob* job = KIO::storedGet(danbooruUrl, KIO::NoReload,
 | 
			
		||||
                                  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)
 | 
			
		||||
| 
						 | 
				
			
			@ -145,8 +144,7 @@ void DanbooruService::getPool(int poolId, int page)
 | 
			
		|||
 | 
			
		||||
    job->setProperty("needsXML", true);
 | 
			
		||||
 | 
			
		||||
    connect(job, SIGNAL(result(KJob*)), this,
 | 
			
		||||
            SLOT(processPostList(KJob*)));
 | 
			
		||||
    connect(job, &KIO::StoredTransferJob::result, this, &DanbooruService::processPostList);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -172,8 +170,7 @@ void DanbooruService::getPoolList(int page)
 | 
			
		|||
    // This job can use JSON data
 | 
			
		||||
    job->setProperty("needsXML", false);
 | 
			
		||||
 | 
			
		||||
    connect(job, SIGNAL(result(KJob*)), this,
 | 
			
		||||
            SLOT(processPoolList(KJob*)));
 | 
			
		||||
    connect(job, &KIO::StoredTransferJob::result, this, &DanbooruService::processPoolList);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -213,8 +210,7 @@ void DanbooruService::getRelatedTags(const QStringList& tags,
 | 
			
		|||
                                 KIO::HideProgressInfo
 | 
			
		||||
                             );
 | 
			
		||||
 | 
			
		||||
    connect(job, SIGNAL(result(KJob*)), this,
 | 
			
		||||
            SLOT(processRelatedTagList(KJob*)));
 | 
			
		||||
    connect(job, &StoredTransferJob::result, this, &DanbooruService::processRelatedTagList);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -400,8 +396,7 @@ void DanbooruService::processPostList(KJob* job)
 | 
			
		|||
 | 
			
		||||
            pixmapJob->setProperty("danbooruPost", variant);
 | 
			
		||||
 | 
			
		||||
            connect(pixmapJob, SIGNAL(result(KJob*)), this,
 | 
			
		||||
                    SLOT(downloadThumbnail(KJob*)));
 | 
			
		||||
            connect(pixmapJob, &StoredTransferJob::result, this, &DanbooruService::downloadThumbnail);
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -83,8 +83,7 @@ namespace Danbooru {
 | 
			
		|||
    // actionCollection()->removeAction(actionCollection()->action("help_contents"));
 | 
			
		||||
 | 
			
		||||
    KStandardAction::quit(qApp, SLOT(close()), actionCollection());
 | 
			
		||||
    connect(connectAction, SIGNAL(triggered(bool)), this,
 | 
			
		||||
            SLOT(connectToBoard()));
 | 
			
		||||
    connect(connectAction, &QAction::triggered, this, &DanbooruMainWindow::connectToBoard);
 | 
			
		||||
    connect(fetch, SIGNAL(triggered(bool)), this, SLOT(downloadPosts()));
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -74,10 +74,8 @@ namespace Danbooru {
 | 
			
		|||
 | 
			
		||||
        // Signal-slot connections
 | 
			
		||||
 | 
			
		||||
        connect(m_viewButton, SIGNAL(clicked()), this,
 | 
			
		||||
                SLOT(viewButtonClicked()));
 | 
			
		||||
        connect(m_downloadButton, SIGNAL(clicked()), this,
 | 
			
		||||
                SLOT(downloadButtonClicked()));
 | 
			
		||||
        connect(m_viewButton, &QPushButton::clicked, this, &DanbooruPostDelegate::viewButtonClicked);
 | 
			
		||||
        connect(m_downloadButton, &QPushButton::clicked, this, &DanbooruPostDelegate::downloadButtonClicked);
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue