From ae8e47d863aba82ea1c39887c7245f760c09a7d6 Mon Sep 17 00:00:00 2001 From: Felix Kauselmann Date: Thu, 3 Jun 2021 16:17:07 +0200 Subject: [PATCH] Clazy: Add second batch of SIGNAL/SLOT removal --- common/comic.cpp | 2 +- common/http_worker.cpp | 4 +- common/onstart_flow_selection_dialog.cpp | 4 +- common/pictureflow.cpp | 6 +- custom_widgets/yacreader_busy_widget.cpp | 2 +- .../yacreader_gl_flow_config_widget.cpp | 2 +- .../yacreader_library_item_widget.cpp | 2 +- .../yacreader_library_list_widget.cpp | 2 +- custom_widgets/yacreader_options_dialog.cpp | 84 +++++++++---------- custom_widgets/yacreader_search_line_edit.cpp | 10 +-- .../yacreader_spin_slider_widget.cpp | 6 +- custom_widgets/yacreader_table_view.cpp | 8 +- custom_widgets/yacreader_treeview.cpp | 2 +- .../edit_shortcut_item_delegate.cpp | 6 +- .../edit_shortcuts_dialog.cpp | 6 +- .../httpserver/httpconnectionhandler.cpp | 8 +- .../httpserver/httpconnectionhandlerpool.cpp | 2 +- .../QtWebApp/httpserver/httplistener.cpp | 2 +- .../QtWebApp/httpserver/httpsessionstore.cpp | 2 +- 19 files changed, 80 insertions(+), 80 deletions(-) diff --git a/common/comic.cpp b/common/comic.cpp index 4bc1fd5c..9d21b6b9 100644 --- a/common/comic.cpp +++ b/common/comic.cpp @@ -126,7 +126,7 @@ Comic::~Comic() //----------------------------------------------------------------------------- void Comic::setup() { - connect(this, SIGNAL(pageChanged(int)), this, SLOT(checkIsBookmark(int))); + connect(this, &Comic::pageChanged, this, &Comic::checkIsBookmark); connect(this, SIGNAL(imageLoaded(int)), this, SLOT(updateBookmarkImage(int))); connect(this, SIGNAL(imageLoaded(int)), this, SLOT(setPageLoaded(int))); diff --git a/common/http_worker.cpp b/common/http_worker.cpp index b880d0eb..805b4a92 100644 --- a/common/http_worker.cpp +++ b/common/http_worker.cpp @@ -44,8 +44,8 @@ void HttpWorker::run() QTimer tT; tT.setSingleShot(true); - connect(&tT, SIGNAL(timeout()), &q, SLOT(quit())); - connect(&manager, SIGNAL(finished(QNetworkReply *)), &q, SLOT(quit())); + connect(&tT, &QTimer::timeout, &q, &QEventLoop::quit); + connect(&manager, &QNetworkAccessManager::finished, &q, &QEventLoop::quit); QNetworkReply *reply = manager.get(QNetworkRequest(url)); tT.start(5000); // 5s timeout diff --git a/common/onstart_flow_selection_dialog.cpp b/common/onstart_flow_selection_dialog.cpp index 76868e62..3f0f6889 100644 --- a/common/onstart_flow_selection_dialog.cpp +++ b/common/onstart_flow_selection_dialog.cpp @@ -9,9 +9,9 @@ OnStartFlowSelectionDialog::OnStartFlowSelectionDialog(QWidget *parent) { setModal(true); QPushButton *acceptHW = new QPushButton(this); - connect(acceptHW, SIGNAL(clicked()), this, SLOT(accept())); + connect(acceptHW, &QAbstractButton::clicked, this, &QDialog::accept); QPushButton *rejectHW = new QPushButton(this); //and use SW flow - connect(rejectHW, SIGNAL(clicked()), this, SLOT(reject())); + connect(rejectHW, &QAbstractButton::clicked, this, &QDialog::reject); acceptHW->setGeometry(90, 165, 110, 118); acceptHW->setFlat(true); diff --git a/common/pictureflow.cpp b/common/pictureflow.cpp index 234da9b2..5499d7c7 100644 --- a/common/pictureflow.cpp +++ b/common/pictureflow.cpp @@ -984,7 +984,7 @@ PictureFlow::PictureFlow(QWidget *parent, FlowType flowType) d->animator = new PictureFlowAnimator; d->animator->state = d->state; - QObject::connect(&d->animator->animateTimer, SIGNAL(timeout()), this, SLOT(updateAnimation())); + QObject::connect(&d->animator->animateTimer, &QTimer::timeout, this, &PictureFlow::updateAnimation); QObject::connect(&d->triggerTimer, SIGNAL(timeout()), this, SLOT(render())); @@ -1299,9 +1299,9 @@ void PictureFlow::updateAnimation() //bucle principal if (d->animator->animating == true) { int difference = 10 - now.elapsed(); if (difference >= 0 && !frameSkiped) - QTimer::singleShot(difference, this, SLOT(updateAnimation())); + QTimer::singleShot(difference, this, &PictureFlow::updateAnimation); else { - QTimer::singleShot(0, this, SLOT(updateAnimation())); + QTimer::singleShot(0, this, &PictureFlow::updateAnimation); if (!frameSkiped) framesSkip = -((difference - 10) / 10); } diff --git a/custom_widgets/yacreader_busy_widget.cpp b/custom_widgets/yacreader_busy_widget.cpp index 7301d815..9b86df33 100644 --- a/custom_widgets/yacreader_busy_widget.cpp +++ b/custom_widgets/yacreader_busy_widget.cpp @@ -35,7 +35,7 @@ BusyIndicator::BusyIndicator(QWidget *parent) fillColor = palette().color(QPalette::WindowText); timer.setInterval(16); - connect(&timer, SIGNAL(timeout()), this, SLOT(rotate())); + connect(&timer, &QTimer::timeout, this, &BusyIndicator::rotate); timer.start(); } diff --git a/custom_widgets/yacreader_gl_flow_config_widget.cpp b/custom_widgets/yacreader_gl_flow_config_widget.cpp index 4f50d531..f5bde2ce 100644 --- a/custom_widgets/yacreader_gl_flow_config_widget.cpp +++ b/custom_widgets/yacreader_gl_flow_config_widget.cpp @@ -75,7 +75,7 @@ YACReaderGLFlowConfigWidget::YACReaderGLFlowConfigWidget(QWidget *parent /* = 0 showAdvancedOptions = new QPushButton(tr("Show advanced settings")); showAdvancedOptions->setCheckable(true); - connect(showAdvancedOptions, SIGNAL(toggled(bool)), this, SLOT(avancedOptionToogled(bool))); + connect(showAdvancedOptions, &QAbstractButton::toggled, this, &YACReaderGLFlowConfigWidget::avancedOptionToogled); vbox->addWidget(showAdvancedOptions, 0, Qt::AlignRight); diff --git a/custom_widgets/yacreader_library_item_widget.cpp b/custom_widgets/yacreader_library_item_widget.cpp index bd3f4333..a7be20de 100644 --- a/custom_widgets/yacreader_library_item_widget.cpp +++ b/custom_widgets/yacreader_library_item_widget.cpp @@ -42,7 +42,7 @@ YACReaderLibraryItemWidget::YACReaderLibraryItemWidget(QString n /*ame*/, QStrin options->setFixedWidth(18); options->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum); options->setStyleSheet("QToolButton {border:none;}"); - connect(options, SIGNAL(clicked()), this, SIGNAL(showOptions())); + connect(options, &QAbstractButton::clicked, this, &YACReaderLibraryItemWidget::showOptions); /*up = new QToolButton(this); up->setIcon(QIcon(":/images/libraryUp.png")); up->setHidden(true); diff --git a/custom_widgets/yacreader_library_list_widget.cpp b/custom_widgets/yacreader_library_list_widget.cpp index 82808ca7..dce287fc 100644 --- a/custom_widgets/yacreader_library_list_widget.cpp +++ b/custom_widgets/yacreader_library_list_widget.cpp @@ -21,7 +21,7 @@ void YACReaderLibraryListWidget::addItem(QString name, QString path) QVBoxLayout *mainLayout = dynamic_cast(layout()); YACReaderLibraryItemWidget *library = new YACReaderLibraryItemWidget(name, path, this); - connect(library, SIGNAL(showOptions()), this, SLOT(showContextMenu())); + connect(library, &YACReaderLibraryItemWidget::showOptions, this, &YACReaderLibraryListWidget::showContextMenu); QList::iterator itr; int i = 0; for (itr = librariesList.begin(); itr != librariesList.end() && !naturalSortLessThanCI(name, (*itr)->name); itr++) diff --git a/custom_widgets/yacreader_options_dialog.cpp b/custom_widgets/yacreader_options_dialog.cpp index af52c597..f553ec18 100644 --- a/custom_widgets/yacreader_options_dialog.cpp +++ b/custom_widgets/yacreader_options_dialog.cpp @@ -37,73 +37,73 @@ YACReaderOptionsDialog::YACReaderOptionsDialog(QWidget *parent) shortcutsBox = new QGroupBox(tr("Shortcuts")); shortcutsBox->setLayout(shortcutsLayout); - connect(shortcutsButton, SIGNAL(clicked()), this, SIGNAL(editShortcuts())); + connect(shortcutsButton, &QAbstractButton::clicked, this, &YACReaderOptionsDialog::editShortcuts); - connect(accept, SIGNAL(clicked()), this, SLOT(saveOptions())); + connect(accept, &QAbstractButton::clicked, this, &YACReaderOptionsDialog::saveOptions); connect(cancel, SIGNAL(clicked()), this, SLOT(restoreOptions())); //TODO fix this - connect(cancel, SIGNAL(clicked()), this, SLOT(close())); + connect(cancel, &QAbstractButton::clicked, this, &QWidget::close); #ifndef NO_OPENGL useGL = new QCheckBox(tr("Use hardware acceleration (restart needed)")); - connect(useGL, SIGNAL(stateChanged(int)), this, SLOT(saveUseGL(int))); + connect(useGL, &QCheckBox::stateChanged, this, &YACReaderOptionsDialog::saveUseGL); #endif #ifdef FORCE_ANGLE useGL->setHidden(true); #endif //sw CONNECTIONS - connect(sw->radio1, SIGNAL(toggled(bool)), this, SLOT(setClassicConfigSW())); - connect(sw->radio2, SIGNAL(toggled(bool)), this, SLOT(setStripeConfigSW())); - connect(sw->radio3, SIGNAL(toggled(bool)), this, SLOT(setOverlappedStripeConfigSW())); + connect(sw->radio1, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::setClassicConfigSW); + connect(sw->radio2, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::setStripeConfigSW); + connect(sw->radio3, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::setOverlappedStripeConfigSW); #ifndef NO_OPENGL //gl CONNECTIONS - connect(gl->radioClassic, SIGNAL(toggled(bool)), this, SLOT(setClassicConfig())); - connect(gl->radioStripe, SIGNAL(toggled(bool)), this, SLOT(setStripeConfig())); - connect(gl->radioOver, SIGNAL(toggled(bool)), this, SLOT(setOverlappedStripeConfig())); - connect(gl->radionModern, SIGNAL(toggled(bool)), this, SLOT(setModernConfig())); - connect(gl->radioDown, SIGNAL(toggled(bool)), this, SLOT(setRouletteConfig())); + connect(gl->radioClassic, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::setClassicConfig); + connect(gl->radioStripe, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::setStripeConfig); + connect(gl->radioOver, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::setOverlappedStripeConfig); + connect(gl->radionModern, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::setModernConfig); + connect(gl->radioDown, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::setRouletteConfig); - connect(gl->radioClassic, SIGNAL(toggled(bool)), this, SIGNAL(optionsChanged())); - connect(gl->radioStripe, SIGNAL(toggled(bool)), this, SIGNAL(optionsChanged())); - connect(gl->radioOver, SIGNAL(toggled(bool)), this, SIGNAL(optionsChanged())); - connect(gl->radionModern, SIGNAL(toggled(bool)), this, SIGNAL(optionsChanged())); - connect(gl->radioDown, SIGNAL(toggled(bool)), this, SIGNAL(optionsChanged())); + connect(gl->radioClassic, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::optionsChanged); + connect(gl->radioStripe, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::optionsChanged); + connect(gl->radioOver, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::optionsChanged); + connect(gl->radionModern, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::optionsChanged); + connect(gl->radioDown, &QAbstractButton::toggled, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->xRotation, SIGNAL(valueChanged(int)), this, SLOT(saveXRotation(int))); - connect(gl->xRotation, SIGNAL(valueChanged(int)), this, SIGNAL(optionsChanged())); + connect(gl->xRotation, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::saveXRotation); + connect(gl->xRotation, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->yPosition, SIGNAL(valueChanged(int)), this, SLOT(saveYPosition(int))); - connect(gl->yPosition, SIGNAL(valueChanged(int)), this, SIGNAL(optionsChanged())); + connect(gl->yPosition, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::saveYPosition); + connect(gl->yPosition, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->coverDistance, SIGNAL(valueChanged(int)), this, SLOT(saveCoverDistance(int))); - connect(gl->coverDistance, SIGNAL(valueChanged(int)), this, SIGNAL(optionsChanged())); + connect(gl->coverDistance, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::saveCoverDistance); + connect(gl->coverDistance, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->centralDistance, SIGNAL(valueChanged(int)), this, SLOT(saveCentralDistance(int))); - connect(gl->centralDistance, SIGNAL(valueChanged(int)), this, SIGNAL(optionsChanged())); + connect(gl->centralDistance, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::saveCentralDistance); + connect(gl->centralDistance, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->zoomLevel, SIGNAL(valueChanged(int)), this, SLOT(saveZoomLevel(int))); - connect(gl->zoomLevel, SIGNAL(valueChanged(int)), this, SIGNAL(optionsChanged())); + connect(gl->zoomLevel, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::saveZoomLevel); + connect(gl->zoomLevel, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->yCoverOffset, SIGNAL(valueChanged(int)), this, SLOT(saveYCoverOffset(int))); - connect(gl->yCoverOffset, SIGNAL(valueChanged(int)), this, SIGNAL(optionsChanged())); + connect(gl->yCoverOffset, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::saveYCoverOffset); + connect(gl->yCoverOffset, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->zCoverOffset, SIGNAL(valueChanged(int)), this, SLOT(saveZCoverOffset(int))); - connect(gl->zCoverOffset, SIGNAL(valueChanged(int)), this, SIGNAL(optionsChanged())); + connect(gl->zCoverOffset, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::saveZCoverOffset); + connect(gl->zCoverOffset, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->coverRotation, SIGNAL(valueChanged(int)), this, SLOT(saveCoverRotation(int))); - connect(gl->coverRotation, SIGNAL(valueChanged(int)), this, SIGNAL(optionsChanged())); + connect(gl->coverRotation, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::saveCoverRotation); + connect(gl->coverRotation, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->fadeOutDist, SIGNAL(valueChanged(int)), this, SLOT(saveFadeOutDist(int))); - connect(gl->fadeOutDist, SIGNAL(valueChanged(int)), this, SIGNAL(optionsChanged())); + connect(gl->fadeOutDist, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::saveFadeOutDist); + connect(gl->fadeOutDist, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->lightStrength, SIGNAL(valueChanged(int)), this, SLOT(saveLightStrength(int))); - connect(gl->lightStrength, SIGNAL(valueChanged(int)), this, SIGNAL(optionsChanged())); + connect(gl->lightStrength, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::saveLightStrength); + connect(gl->lightStrength, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->maxAngle, SIGNAL(valueChanged(int)), this, SLOT(saveMaxAngle(int))); - connect(gl->maxAngle, SIGNAL(valueChanged(int)), this, SIGNAL(optionsChanged())); + connect(gl->maxAngle, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::saveMaxAngle); + connect(gl->maxAngle, &YACReaderSpinSliderWidget::valueChanged, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->performanceSlider, SIGNAL(valueChanged(int)), this, SLOT(savePerformance(int))); - connect(gl->performanceSlider, SIGNAL(valueChanged(int)), this, SIGNAL(optionsChanged())); + connect(gl->performanceSlider, &QAbstractSlider::valueChanged, this, &YACReaderOptionsDialog::savePerformance); + connect(gl->performanceSlider, &QAbstractSlider::valueChanged, this, &YACReaderOptionsDialog::optionsChanged); - connect(gl->vSyncCheck, SIGNAL(stateChanged(int)), this, SLOT(saveUseVSync(int))); + connect(gl->vSyncCheck, &QCheckBox::stateChanged, this, &YACReaderOptionsDialog::saveUseVSync); #endif } diff --git a/custom_widgets/yacreader_search_line_edit.cpp b/custom_widgets/yacreader_search_line_edit.cpp index 0232184e..28d6cbf6 100644 --- a/custom_widgets/yacreader_search_line_edit.cpp +++ b/custom_widgets/yacreader_search_line_edit.cpp @@ -25,8 +25,8 @@ YACReaderSearchLineEdit::YACReaderSearchLineEdit(QWidget *parent) clearButton->setCursor(Qt::ArrowCursor); clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; }"); clearButton->hide(); - connect(clearButton, SIGNAL(clicked()), this, SLOT(clear())); - connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(updateCloseButton(const QString &))); + connect(clearButton, &QAbstractButton::clicked, this, &QLineEdit::clear); + connect(this, &QLineEdit::textChanged, this, &YACReaderSearchLineEdit::updateCloseButton); int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); #ifdef Q_OS_MAC setStyleSheet(QString("QLineEdit {border-top:1px solid #9F9F9F; border-bottom:1px solid #ACACAC; border-right:1px solid #ACACAC; border-left:1px solid #ACACAC; border-radius: 10px; background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #CACACA, stop: 0.15 #FFFFFF); padding-left: %1px; padding-right: %2px; padding-bottom: 1px; margin-bottom: 1px;} ").arg(searchLabel->sizeHint().width() + frameWidth + 6).arg(clearButton->sizeHint().width() + frameWidth + 2)); @@ -67,14 +67,14 @@ YACReaderSearchLineEdit::YACReaderSearchLineEdit(QWidget *parent) setValidator(validator); setCompleter(modifiersCompleter); - connect(this, SIGNAL(textChanged(QString)), this, SLOT(processText(QString))); + connect(this, &QLineEdit::textChanged, this, &YACReaderSearchLineEdit::processText); } void YACReaderSearchLineEdit::clearText() { - disconnect(this, SIGNAL(textChanged(QString)), this, SLOT(processText(QString))); + disconnect(this, &QLineEdit::textChanged, this, &YACReaderSearchLineEdit::processText); clear(); - connect(this, SIGNAL(textChanged(QString)), this, SLOT(processText(QString))); + connect(this, &QLineEdit::textChanged, this, &YACReaderSearchLineEdit::processText); } //modifiers are not returned diff --git a/custom_widgets/yacreader_spin_slider_widget.cpp b/custom_widgets/yacreader_spin_slider_widget.cpp index 5e242031..29192dc5 100644 --- a/custom_widgets/yacreader_spin_slider_widget.cpp +++ b/custom_widgets/yacreader_spin_slider_widget.cpp @@ -23,12 +23,12 @@ YACReaderSpinSliderWidget::YACReaderSpinSliderWidget(QWidget *parent, bool strec } connect(spinBox, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int))); - connect(slider, SIGNAL(valueChanged(int)), spinBox, SLOT(setValue(int))); + connect(slider, &QAbstractSlider::valueChanged, spinBox, &QSpinBox::setValue); - connect(slider, SIGNAL(valueChanged(int)), this, SLOT(valueWillChange(int))); + connect(slider, &QAbstractSlider::valueChanged, this, &YACReaderSpinSliderWidget::valueWillChange); connect(spinBox, SIGNAL(valueChanged(int)), this, SLOT(valueWillChangeFromSpinBox(int))); - connect(slider, SIGNAL(sliderReleased()), this, SLOT(sliderRelease())); + connect(slider, &QAbstractSlider::sliderReleased, this, &YACReaderSpinSliderWidget::sliderRelease); setLayout(layout); } diff --git a/custom_widgets/yacreader_table_view.cpp b/custom_widgets/yacreader_table_view.cpp index 048428ba..29d839da 100644 --- a/custom_widgets/yacreader_table_view.cpp +++ b/custom_widgets/yacreader_table_view.cpp @@ -271,10 +271,10 @@ QWidget *YACReaderRatingDelegate::createEditor(QWidget *parent, Q_UNUSED(option) Q_UNUSED(index) StarEditor *editor = new StarEditor(parent); - connect(editor, SIGNAL(editingFinished()), - this, SLOT(sendCloseEditor())); - connect(editor, SIGNAL(commitData()), - this, SLOT(sendCommitData())); + connect(editor, &StarEditor::editingFinished, + this, &YACReaderRatingDelegate::sendCloseEditor); + connect(editor, &StarEditor::commitData, + this, &YACReaderRatingDelegate::sendCommitData); return editor; } diff --git a/custom_widgets/yacreader_treeview.cpp b/custom_widgets/yacreader_treeview.cpp index c6dd9d9d..1d25ee3f 100644 --- a/custom_widgets/yacreader_treeview.cpp +++ b/custom_widgets/yacreader_treeview.cpp @@ -88,7 +88,7 @@ void YACReaderTreeView::dragMoveEvent(QDragMoveEvent *event) QModelIndex underMouse = indexAt(event->pos()); if (underMouse.isValid()) { expandPos = event->pos(); - connect(&expandTimer, SIGNAL(timeout()), this, SLOT(expandCurrent())); + connect(&expandTimer, &QTimer::timeout, this, &YACReaderTreeView::expandCurrent); expandTimer.setSingleShot(true); expandTimer.start(500); } diff --git a/shortcuts_management/edit_shortcut_item_delegate.cpp b/shortcuts_management/edit_shortcut_item_delegate.cpp index 86b51618..bbea6f7e 100644 --- a/shortcuts_management/edit_shortcut_item_delegate.cpp +++ b/shortcuts_management/edit_shortcut_item_delegate.cpp @@ -13,7 +13,7 @@ QWidget *EditShortcutItemDelegate::createEditor(QWidget *parent, const QStyleOpt Q_UNUSED(index); KeySequenceLineEdit *editor = new KeySequenceLineEdit(parent); - connect(editor, SIGNAL(editingFinished()), this, SLOT(closeShortcutEditor())); + connect(editor, &QLineEdit::editingFinished, this, &EditShortcutItemDelegate::closeShortcutEditor); return editor; } @@ -76,8 +76,8 @@ KeySequenceLineEdit::KeySequenceLineEdit(QWidget *parent) acceptButton->setCursor(Qt::ArrowCursor); acceptButton->setStyleSheet(buttonsStyle); - connect(clearButton, SIGNAL(clicked()), this, SLOT(clear())); - connect(acceptButton, SIGNAL(clicked()), this, SIGNAL(editingFinished())); + connect(clearButton, &QAbstractButton::clicked, this, &QLineEdit::clear); + connect(acceptButton, &QAbstractButton::clicked, this, &QLineEdit::editingFinished); } void KeySequenceLineEdit::resizeEvent(QResizeEvent *e) diff --git a/shortcuts_management/edit_shortcuts_dialog.cpp b/shortcuts_management/edit_shortcuts_dialog.cpp index 837136e0..244c43f8 100644 --- a/shortcuts_management/edit_shortcuts_dialog.cpp +++ b/shortcuts_management/edit_shortcuts_dialog.cpp @@ -57,9 +57,9 @@ EditShortcutsDialog::EditShortcutsDialog(QWidget *parent) "QTableView::item:selected {outline: 0px; border: 0px;}" "");*/ - connect(resetButton, SIGNAL(clicked()), this, SLOT(resetToDefaults())); - connect(actionsGroupsListView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(loadShortcuts(QModelIndex, QModelIndex))); //clicked(QModelIndex) doesn't work :S - connect(actionsModel, SIGNAL(conflict(QString)), this, SLOT(processConflict(QString))); + connect(resetButton, &QAbstractButton::clicked, this, &EditShortcutsDialog::resetToDefaults); + connect(actionsGroupsListView->selectionModel(), &QItemSelectionModel::currentChanged, this, &EditShortcutsDialog::loadShortcuts); //clicked(QModelIndex) doesn't work :S + connect(actionsModel, &ActionsShortcutsModel::conflict, this, &EditShortcutsDialog::processConflict); #ifdef Q_OS_MAC setFixedSize(760, 500); diff --git a/third_party/QtWebApp/httpserver/httpconnectionhandler.cpp b/third_party/QtWebApp/httpserver/httpconnectionhandler.cpp index 934f59d0..f5fb8327 100644 --- a/third_party/QtWebApp/httpserver/httpconnectionhandler.cpp +++ b/third_party/QtWebApp/httpserver/httpconnectionhandler.cpp @@ -32,10 +32,10 @@ HttpConnectionHandler::HttpConnectionHandler(const QSettings *settings, HttpRequ socket->moveToThread(thread); // Connect signals - connect(socket, SIGNAL(readyRead()), SLOT(read())); - connect(socket, SIGNAL(disconnected()), SLOT(disconnected())); - connect(&readTimer, SIGNAL(timeout()), SLOT(readTimeout())); - connect(thread, SIGNAL(finished()), this, SLOT(thread_done())); + connect(socket, &QIODevice::readyRead, this, &HttpConnectionHandler::read); + connect(socket, &QAbstractSocket::disconnected, this, &HttpConnectionHandler::disconnected); + connect(&readTimer, &QTimer::timeout, this, &HttpConnectionHandler::readTimeout); + connect(thread, &QThread::finished, this, &HttpConnectionHandler::thread_done); qDebug("HttpConnectionHandler (%p): constructed", static_cast(this)); } diff --git a/third_party/QtWebApp/httpserver/httpconnectionhandlerpool.cpp b/third_party/QtWebApp/httpserver/httpconnectionhandlerpool.cpp index 112e1c8f..f22eb087 100644 --- a/third_party/QtWebApp/httpserver/httpconnectionhandlerpool.cpp +++ b/third_party/QtWebApp/httpserver/httpconnectionhandlerpool.cpp @@ -18,7 +18,7 @@ HttpConnectionHandlerPool::HttpConnectionHandlerPool(const QSettings *settings, this->sslConfiguration=NULL; loadSslConfig(); cleanupTimer.start(settings->value("cleanupInterval",1000).toInt()); - connect(&cleanupTimer, SIGNAL(timeout()), SLOT(cleanup())); + connect(&cleanupTimer, &QTimer::timeout, this, &HttpConnectionHandlerPool::cleanup); } diff --git a/third_party/QtWebApp/httpserver/httplistener.cpp b/third_party/QtWebApp/httpserver/httplistener.cpp index 74871584..768ab842 100644 --- a/third_party/QtWebApp/httpserver/httplistener.cpp +++ b/third_party/QtWebApp/httpserver/httplistener.cpp @@ -83,7 +83,7 @@ void HttpListener::incomingConnection(tSocketDescriptor socketDescriptor) { qDebug("HttpListener: Too many incoming connections"); QTcpSocket* socket=new QTcpSocket(this); socket->setSocketDescriptor(socketDescriptor); - connect(socket, SIGNAL(disconnected()), socket, SLOT(deleteLater())); + connect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater); socket->write("HTTP/1.1 503 too many connections\r\nConnection: close\r\n\r\nToo many connections\r\n"); socket->disconnectFromHost(); } diff --git a/third_party/QtWebApp/httpserver/httpsessionstore.cpp b/third_party/QtWebApp/httpserver/httpsessionstore.cpp index 6703f753..3939aca4 100644 --- a/third_party/QtWebApp/httpserver/httpsessionstore.cpp +++ b/third_party/QtWebApp/httpserver/httpsessionstore.cpp @@ -13,7 +13,7 @@ HttpSessionStore::HttpSessionStore(const QSettings *settings, QObject* parent) :QObject(parent) { this->settings=settings; - connect(&cleanupTimer,SIGNAL(timeout()),this,SLOT(sessionTimerEvent())); + connect(&cleanupTimer,&QTimer::timeout,this,&HttpSessionStore::sessionTimerEvent); cleanupTimer.start(60000); cookieName=settings->value("cookieName","sessionid").toByteArray(); expirationTime=settings->value("expirationTime",3600000).toInt();