Commit 968e9d60 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Enable clazy old-style-connect

parent a9598e83
Pipeline #15386 passed with stage
in 13 minutes and 46 seconds
......@@ -48,7 +48,7 @@ build_clazy_clang_tidy:
script:
- srcdir=`pwd` && mkdir -p /tmp/okular_build && cd /tmp/okular_build && CC=clang CXX=clazy CXXFLAGS="-Werror -Wno-deprecated-declarations" cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja $srcdir && cat compile_commands.json | jq '[.[] | select(.file | contains("'"$srcdir"'"))]' > compile_commands.aux.json && cat compile_commands.aux.json | jq '[.[] | select(.file | contains("/synctex/")| not)]' > compile_commands.json
- CLAZY_CHECKS="level0,level1" ninja
- CLAZY_CHECKS="level0,level1,old-style-connect" ninja
# Fix the poppler header, remove when debian:unstable ships poppler 0.82 or later
- sed -i "N;N;N;N; s#class MediaRendition\;\nclass MovieAnnotation\;\nclass ScreenAnnotation;#class MediaRendition\;#g" /usr/include/poppler/qt5/poppler-link.h
- "run-clang-tidy -header-filter='.*/okular/.*' -checks='-*,performance-*,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,modernize-use-emplace,modernize-loop-convert,modernize-use-nullptr,-bugprone-macro-parentheses,-bugprone-narrowing-conversions,-bugprone-branch-clone,-bugprone-incorrect-roundings' -config=\"{WarningsAsErrors: '*'}\""
......@@ -59,7 +59,7 @@ public:
ClosePrintDialogHelper(int expectedTab) : foundDialog(false), m_expectedTab(expectedTab) { }
bool foundDialog;
private slots:
public slots:
void closePrintDialog();
private:
......@@ -249,7 +249,7 @@ void MainShellTest::testShell()
if (expectPrintDialog || externalProcessExpectPrintDialog) {
const int expectedTab = externalProcessExpectPrintDialog && !unique ? 1 : 0;
helper.reset(new ClosePrintDialogHelper(expectedTab));
QTimer::singleShot(0, helper.data(), SLOT(closePrintDialog()));
QTimer::singleShot(0, helper.data(), &ClosePrintDialogHelper::closePrintDialog);
}
Okular::Status status = Okular::main(paths, serializedOptions);
......
......@@ -20,7 +20,7 @@ class SearchFinishedReceiver : public QObject
{
Q_OBJECT
private slots:
public slots:
void searchFinished(int id, Okular::Document::SearchStatus status)
{
m_id = id;
......@@ -170,7 +170,7 @@ void SearchTest::test311232()
SearchFinishedReceiver receiver;
QSignalSpy spy(&d, &Okular::Document::searchFinished);
QObject::connect(&d, SIGNAL(searchFinished(int,Okular::Document::SearchStatus)), &receiver, SLOT(searchFinished(int,Okular::Document::SearchStatus)));
QObject::connect(&d, &Okular::Document::searchFinished, &receiver, &SearchFinishedReceiver::searchFinished);
const QString testFile = QStringLiteral(KDESRCDIR "data/file1.pdf");
QMimeDatabase db;
......
......@@ -32,6 +32,8 @@ DlgGeneral::DlgGeneral( QWidget * parent, Okular::EmbedMode embedMode )
m_dlg->kcfg_rtlReadingDirection->setVisible(false);
}
m_dlg->kcfg_ShellOpenFileInTabs->setVisible( embedMode == Okular::NativeShellMode );
connect(m_dlg->kcfg_UseCustomBackgroundColor, &QCheckBox::toggled, this, &DlgGeneral::setCustomBackgroundColorButton);
}
DlgGeneral::~DlgGeneral()
......
......@@ -480,25 +480,4 @@ For files which were opened before the previous zoom is applied.</string>
<include location="global">kiconloader.h</include>
</includes>
<resources/>
<connections>
<connection>
<sender>kcfg_UseCustomBackgroundColor</sender>
<signal>toggled(bool)</signal>
<receiver>DlgGeneralBase</receiver>
<slot>setCustomBackgroundColorButton(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>130</x>
<y>229</y>
</hint>
<hint type="destinationlabel">
<x>203</x>
<y>-9</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>setCustomBackgroundColorButton(bool)</slot>
</slots>
</ui>
......@@ -55,6 +55,7 @@ DlgPresentation::DlgPresentation( QWidget * parent )
m_dlg->kcfg_SlidesAdvanceTime->setSuffix(ki18ncp("Advance every %1 seconds", " second", " seconds"));
connect(m_dlg->screenCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &DlgPresentation::screenComboChanged);
connect(m_dlg->kcfg_SlidesAdvance, &QAbstractButton::toggled, m_dlg->kcfg_SlidesAdvanceTime, &QWidget::setEnabled);
}
DlgPresentation::~DlgPresentation()
......
......@@ -361,22 +361,4 @@
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>kcfg_SlidesAdvance</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_SlidesAdvanceTime</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>88</x>
<y>43</y>
</hint>
<hint type="destinationlabel">
<x>280</x>
<y>49</y>
</hint>
</hints>
</connection>
</connections>
</ui>
......@@ -28,8 +28,8 @@ PageController::~PageController()
void PageController::addRotationJob(RotationJob *job)
{
connect( job, SIGNAL(done(ThreadWeaver::JobPointer)),
this, SLOT(imageRotationDone(ThreadWeaver::JobPointer)) );
connect( job, &RotationJob::done,
this, &PageController::imageRotationDone );
ThreadWeaver::enqueue(&m_weaver, job);
}
......
......@@ -150,7 +150,7 @@ bool CHMGenerator::loadDocument( const QString & fileName, QVector< Okular::Page
m_syncGen->view()->contentsHeight(), Okular::Rotation0 );
}
connect( m_syncGen, SIGNAL(completed()), this, SLOT(slotCompleted()) );
connect( m_syncGen, QOverload<>::of(&KHTMLPart::completed), this, &CHMGenerator::slotCompleted );
connect( m_syncGen, &KParts::ReadOnlyPart::canceled, this, &CHMGenerator::slotCompleted );
return true;
......@@ -183,7 +183,7 @@ void CHMGenerator::preparePageForSyncOperation(const QString & url)
m_syncGen->view()->layout();
QEventLoop loop;
connect( m_syncGen, SIGNAL(completed()), &loop, SLOT(quit()) );
connect( m_syncGen, QOverload<>::of(&KHTMLPart::completed), &loop, &QEventLoop::quit );
connect( m_syncGen, &KParts::ReadOnlyPart::canceled, &loop, &QEventLoop::quit );
// discard any user input, otherwise it breaks the "synchronicity" of this
// function
......
......@@ -65,7 +65,7 @@ Index::Index()
: QObject( nullptr )
{
lastWindowClosed = false;
connect( qApp, SIGNAL( lastWindowClosed() ), this, SLOT( setLastWinClosed() ) );
connect( qApp, &QGuiApplication::lastWindowClosed, this, &Index::setLastWinClosed );
}
void Index::setLastWinClosed()
......
......@@ -375,7 +375,7 @@ m_cliPresentation(false), m_cliPrint(false), m_cliPrintAndExit(false), m_embedMo
connect(this, &KParts::ReadOnlyPart::started, this, &Part::slotJobStarted);
// connect the completed signal so we can put the window caption when loading remote files
connect(this, SIGNAL(completed()), this, SLOT(setWindowTitleFromDocument()));
connect(this, QOverload<>::of(&Part::completed), this, &Part::setWindowTitleFromDocument);
connect(this, &KParts::ReadOnlyPart::canceled, this, &Part::loadCancelled);
// create browser extension (for printing when embedded into browser)
......@@ -407,7 +407,7 @@ m_cliPresentation(false), m_cliPrint(false), m_cliPrintAndExit(false), m_embedMo
);
if ( parent && parent->metaObject()->indexOfSlot( QMetaObject::normalizedSignature( "slotQuit()" ).constData() ) != -1 )
connect( m_document, SIGNAL(quit()), parent, SLOT(slotQuit()) );
connect( m_document, SIGNAL(quit()), parent, SLOT(slotQuit()) ); // clazy:exclude=old-style-connect
else
connect( m_document, &Document::quit, this, &Part::cannotQuit );
// widgets: ^searchbar (toolbar containing label and SearchWidget)
......@@ -553,11 +553,11 @@ m_cliPresentation(false), m_cliPrint(false), m_cliPrintAndExit(false), m_embedMo
m_pageNumberTool = new MiniBar( nullptr, m_miniBarLogic );
connect( m_findBar, SIGNAL(forwardKeyPressEvent(QKeyEvent*)), m_pageView, SLOT(externalKeyPressEvent(QKeyEvent*)));
connect( m_findBar, SIGNAL(onCloseButtonPressed()), m_pageView, SLOT(setFocus()));
connect( m_miniBar, SIGNAL(forwardKeyPressEvent(QKeyEvent*)), m_pageView, SLOT(externalKeyPressEvent(QKeyEvent*)));
connect( m_findBar, &FindBar::forwardKeyPressEvent, m_pageView, &PageView::externalKeyPressEvent );
connect( m_findBar, &FindBar::onCloseButtonPressed, m_pageView, QOverload<>::of(&PageView::setFocus) );
connect( m_miniBar, &MiniBar::forwardKeyPressEvent, m_pageView, &PageView::externalKeyPressEvent );
connect( m_pageView.data(), &PageView::escPressed, m_findBar, &FindBar::resetSearch );
connect( m_pageNumberTool, SIGNAL(forwardKeyPressEvent(QKeyEvent*)), m_pageView, SLOT(externalKeyPressEvent(QKeyEvent*)));
connect( m_pageNumberTool, &MiniBar::forwardKeyPressEvent, m_pageView, &PageView::externalKeyPressEvent);
connect( m_reviewsWidget.data(), &Reviews::openAnnotationWindow,
m_pageView.data(), &PageView::openAnnotationWindow );
......@@ -1336,7 +1336,7 @@ bool Part::slotImportPSFile()
QProcess *p = new QProcess();
args << url.toLocalFile() << m_temporaryLocalFile;
m_pageView->displayMessage(i18n("Importing PS file as PDF (this may take a while)..."));
connect(p, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(psTransformEnded(int,QProcess::ExitStatus)));
connect(p, QOverload<int,QProcess::ExitStatus>::of(&QProcess::finished), this, &Part::psTransformEnded);
p->start(app, args);
return true;
}
......
......@@ -725,12 +725,13 @@ void Shell::applyOptionsToPart( QObject* part, const QString &serializedOptions
void Shell::connectPart( QObject* part )
{
connect( this, SIGNAL(moveSplitter(int)), part, SLOT(moveSplitter(int)) );
connect( part, SIGNAL(enablePrintAction(bool)), this, SLOT(setPrintEnabled(bool)));
connect( part, SIGNAL(enableCloseAction(bool)), this, SLOT(setCloseEnabled(bool)));
connect( part, SIGNAL(mimeTypeChanged(QMimeType)), this, SLOT(setTabIcon(QMimeType)));
connect( part, SIGNAL(urlsDropped(QList<QUrl>)), this, SLOT(handleDroppedUrls(QList<QUrl>)) );
connect( part, SIGNAL(fitWindowToPage(QSize,QSize)), this, SLOT(slotFitWindowToPage(QSize,QSize)) );
// We're abusing the fact we know the part is our part here
connect( this, SIGNAL(moveSplitter(int)), part, SLOT(moveSplitter(int)) ); // clazy:exclude=old-style-connect
connect( part, SIGNAL(enablePrintAction(bool)), this, SLOT(setPrintEnabled(bool))); // clazy:exclude=old-style-connect
connect( part, SIGNAL(enableCloseAction(bool)), this, SLOT(setCloseEnabled(bool))); // clazy:exclude=old-style-connect
connect( part, SIGNAL(mimeTypeChanged(QMimeType)), this, SLOT(setTabIcon(QMimeType))); // clazy:exclude=old-style-connect
connect( part, SIGNAL(urlsDropped(QList<QUrl>)), this, SLOT(handleDroppedUrls(QList<QUrl>)) ); // clazy:exclude=old-style-connect
connect( part, SIGNAL(fitWindowToPage(QSize,QSize)), this, SLOT(slotFitWindowToPage(QSize,QSize)) ); // clazy:exclude=old-style-connect
}
void Shell::print()
......
......@@ -73,7 +73,7 @@ PixmapPreviewSelector::PixmapPreviewSelector( QWidget * parent, PreviewPosition
setFocusPolicy( Qt::TabFocus );
setFocusProxy( m_comboItems );
connect( m_comboItems, SIGNAL(currentIndexChanged(QString)), this, SLOT(iconComboChanged(QString)) );
connect( m_comboItems, QOverload<const QString &>::of(&QComboBox::currentIndexChanged), this, &PixmapPreviewSelector::iconComboChanged );
connect( m_comboItems, &QComboBox::editTextChanged, this, &PixmapPreviewSelector::iconComboChanged );
connect( m_stampPushButton, &QPushButton::clicked, this, &PixmapPreviewSelector::selectCustomStamp );
}
......@@ -283,7 +283,7 @@ void AnnotationWidget::addOpacitySpinBox( QWidget * widget, QFormLayout * formla
m_opacity->setValue( (int)( m_ann->style().opacity() * 100 ) );
m_opacity->setSuffix( i18nc( "Suffix for the opacity level, eg '80 %'", " %" ) );
formlayout->addRow( i18n( "&Opacity:" ), m_opacity);
connect( m_opacity, SIGNAL(valueChanged(int)), this, SIGNAL(dataChanged()) );
connect( m_opacity, QOverload<int>::of(&QSpinBox::valueChanged), this, &AnnotationWidget::dataChanged );
}
void AnnotationWidget::addVerticalSpacer( QFormLayout * formlayout )
......@@ -408,7 +408,7 @@ void TextAnnotationWidget::addTextAlignComboBox( QWidget * widget, QFormLayout *
m_textAlign->addItem( i18n("Center") );
m_textAlign->addItem( i18n("Right") );
m_textAlign->setCurrentIndex( m_textAnn->inplaceAlignment() );
connect( m_textAlign, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dataChanged()) );
connect( m_textAlign, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &AnnotationWidget::dataChanged );
}
void TextAnnotationWidget::addWidthSpinBox( QWidget * widget, QFormLayout * formlayout )
......@@ -418,7 +418,7 @@ void TextAnnotationWidget::addWidthSpinBox( QWidget * widget, QFormLayout * form
m_spinWidth->setRange( 0, 100 );
m_spinWidth->setValue( m_textAnn->style().width() );
m_spinWidth->setSingleStep( 0.1 );
connect( m_spinWidth, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) );
connect( m_spinWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &AnnotationWidget::dataChanged );
}
StampAnnotationWidget::StampAnnotationWidget( Okular::Annotation * ann )
......@@ -554,8 +554,8 @@ void LineAnnotationWidget::createStyleWidget( QFormLayout * formlayout )
connect( m_startStyleCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &LineAnnotationWidget::dataChanged );
connect( m_endStyleCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &LineAnnotationWidget::dataChanged );
connect( m_spinLL, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) );
connect( m_spinLLE, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) );
connect( m_spinLL, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &LineAnnotationWidget::dataChanged );
connect( m_spinLLE, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &LineAnnotationWidget::dataChanged );
}
else if ( m_lineType == 1 ) // Polygon
{
......@@ -652,7 +652,7 @@ void InkAnnotationWidget::createStyleWidget( QFormLayout * formlayout )
m_spinSize->setRange( 1, 100 );
m_spinSize->setValue( m_inkAnn->style().width() );
connect( m_spinSize, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) );
connect( m_spinSize, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &AnnotationWidget::dataChanged );
}
void InkAnnotationWidget::applyChanges()
......@@ -685,7 +685,7 @@ void HighlightAnnotationWidget::createStyleWidget( QFormLayout * formlayout )
addColorButton( widget, formlayout );
addOpacitySpinBox( widget, formlayout );
connect( m_typeCombo, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dataChanged()) );
connect( m_typeCombo, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &AnnotationWidget::dataChanged );
}
void HighlightAnnotationWidget::applyChanges()
......@@ -736,11 +736,11 @@ void GeomAnnotationWidget::createStyleWidget( QFormLayout * formlayout )
m_spinSize->setRange( 0, 100 );
m_spinSize->setValue( m_geomAnn->style().width() );
connect( m_typeCombo, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dataChanged()) );
connect( m_typeCombo, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &AnnotationWidget::dataChanged );
connect( m_innerColor, &KColorButton::changed, this, &AnnotationWidget::dataChanged );
connect( m_useColor, &QAbstractButton::toggled, this, &AnnotationWidget::dataChanged );
connect(m_useColor, &QCheckBox::toggled, m_innerColor, &KColorButton::setEnabled);
connect( m_spinSize, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) );
connect( m_spinSize, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &AnnotationWidget::dataChanged );
}
void GeomAnnotationWidget::applyChanges()
......
......@@ -66,7 +66,7 @@ class MovableTitle
Q_OBJECT
public:
MovableTitle( QWidget * parent )
MovableTitle( AnnotWindow * parent )
: QWidget( parent )
{
QVBoxLayout * mainlay = new QVBoxLayout( this );
......@@ -122,8 +122,8 @@ public:
latexlay->addWidget( latexButton );
latexlay->addSpacing( 1 );
mainlay->addLayout( latexlay );
connect(latexButton, SIGNAL(clicked(bool)), parent, SLOT(renderLatex(bool)));
connect(parent, SIGNAL(containsLatex(bool)), latexButton, SLOT(setVisible(bool)));
connect(latexButton, &QToolButton::clicked, parent, &AnnotWindow::renderLatex);
connect(parent, &AnnotWindow::containsLatex, latexButton, &QWidget::setVisible);
titleLabel->installEventFilter( this );
dateLabel->installEventFilter( this );
......
......@@ -55,6 +55,9 @@ class AnnotWindow : public QFrame
int m_prevCursorPos;
int m_prevAnchorPos;
public Q_SLOTS:
void renderLatex( bool render );
protected:
void showEvent( QShowEvent * event ) override;
bool eventFilter( QObject * obj, QEvent * event ) override;
......@@ -63,7 +66,6 @@ class AnnotWindow : public QFrame
void slotUpdateUndoAndRedoInContextMenu(QMenu *menu);
void slotOptionBtn();
void slotsaveWindowText();
void renderLatex( bool render );
void slotHandleContentsChangedByUndoRedo( Okular::Annotation* annot, const QString &contents, int cursorPos, int anchorPos);
Q_SIGNALS:
......
......@@ -104,8 +104,8 @@ EmbeddedFilesDialog::EmbeddedFilesDialog(QWidget *parent, const Okular::Document
m_tw->setMinimumWidth(640);
m_tw->updateGeometry();
connect(mUser1Button, SIGNAL(clicked()), this, SLOT(saveFile()));
connect(mUser2Button, SIGNAL(clicked()), this, SLOT(viewFile()));
connect(mUser1Button, &QPushButton::clicked, this, &EmbeddedFilesDialog::saveFileFromButton);
connect(mUser2Button, &QPushButton::clicked, this, &EmbeddedFilesDialog::viewFileFromButton);
connect(m_tw, &QWidget::customContextMenuRequested, this, &EmbeddedFilesDialog::attachViewContextMenu);
connect(m_tw, &QTreeWidget::itemSelectionChanged, this, &EmbeddedFilesDialog::updateSaveButton);
connect(m_tw, &QTreeWidget::itemDoubleClicked, this, &EmbeddedFilesDialog::viewFileItem);
......@@ -118,7 +118,7 @@ void EmbeddedFilesDialog::updateSaveButton()
mUser2Button->setEnabled(enable);
}
void EmbeddedFilesDialog::saveFile()
void EmbeddedFilesDialog::saveFileFromButton()
{
const QList<QTreeWidgetItem *> selected = m_tw->selectedItems();
for (const QTreeWidgetItem *twi : selected)
......@@ -128,7 +128,7 @@ void EmbeddedFilesDialog::saveFile()
}
}
void EmbeddedFilesDialog::viewFile()
void EmbeddedFilesDialog::viewFileFromButton()
{
const QList<QTreeWidgetItem *> selected = m_tw->selectedItems();
for (QTreeWidgetItem *twi : selected)
......
......@@ -29,10 +29,10 @@ Q_OBJECT
EmbeddedFilesDialog(QWidget *parent, const Okular::Document *document);
private Q_SLOTS:
void saveFile();
void saveFileFromButton();
void attachViewContextMenu( const QPoint& pos );
void updateSaveButton();
void viewFile();
void viewFileFromButton();
void viewFileItem( QTreeWidgetItem* item, int column );
private:
......
......@@ -933,11 +933,11 @@ void FileEdit::slotHandleFileChangedByUndoRedo( int pageNumber,
{
return;
}
disconnect( this, SIGNAL( cursorPositionChanged( int, int ) ), this, SLOT( slotChanged() ) );
disconnect( lineEdit(), &QLineEdit::cursorPositionChanged, this, &FileEdit::slotChanged );
setText( contents );
lineEdit()->setCursorPosition( anchorPos );
lineEdit()->cursorForward( true, cursorPos - anchorPos );
connect( this, SIGNAL(cursorPositionChanged(int,int)), this, SLOT( slotChanged() ) );
connect( lineEdit(), &QLineEdit::cursorPositionChanged, this, &FileEdit::slotChanged );
m_prevCursorPos = cursorPos;
m_prevAnchorPos = anchorPos;
setFocus();
......@@ -1027,7 +1027,7 @@ ComboEdit::ComboEdit( Okular::FormFieldChoice * choice, QWidget * parent )
if ( choice->isEditable() && !choice->editChoice().isEmpty() )
lineEdit()->setText( choice->editChoice() );
connect( this, SIGNAL(currentIndexChanged(int)), this, SLOT(slotValueChanged()) );
connect( this, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ComboEdit::slotValueChanged );
connect( this, &QComboBox::editTextChanged, this, &ComboEdit::slotValueChanged );
connect( lineEdit(), &QLineEdit::cursorPositionChanged, this, &ComboEdit::slotValueChanged );
......
......@@ -203,8 +203,8 @@ MiniBar::MiniBar( QWidget * parent, MiniBarLogic * miniBarLogic )
resizeForPage( 0 );
// connect signals from child widgets to internal handlers / signals bouncers
connect( m_pageNumberEdit, SIGNAL(returnPressed()), this, SLOT(slotChangePage()) );
connect( m_pageLabelEdit, SIGNAL(pageNumberChosen(int)), this, SLOT(slotChangePage(int)) );
connect( m_pageNumberEdit, &PageNumberEdit::returnPressed, this, &MiniBar::slotChangePageFromReturn );
connect( m_pageLabelEdit, &PageLabelEdit::pageNumberChosen, this, &MiniBar::slotChangePage );
connect( m_pagesButton, &QAbstractButton::clicked, this, &MiniBar::gotoPage );
connect( m_prevButton, &QAbstractButton::clicked, this, &MiniBar::prevPage );
connect( m_nextButton, &QAbstractButton::clicked, this, &MiniBar::nextPage );
......@@ -259,7 +259,7 @@ bool MiniBar::eventFilter( QObject *target, QEvent *event )
return false;
}
void MiniBar::slotChangePage()
void MiniBar::slotChangePageFromReturn()
{
// get text from the lineEdit
const QString pageNumber = m_pageNumberEdit->text();
......@@ -424,7 +424,7 @@ PageLabelEdit::PageLabelEdit( MiniBar * parent )
: PagesEdit( parent )
{
setVisible( false );
connect( this, SIGNAL(returnPressed()), this, SLOT(pageChosen()) );
connect( this, &PageLabelEdit::returnPressed, this, &PageLabelEdit::pageChosen );
}
void PageLabelEdit::setText( const QString & newText )
......
......@@ -127,7 +127,7 @@ class MiniBar : public QWidget
void forwardKeyPressEvent( QKeyEvent *e );
public Q_SLOTS:
void slotChangePage();
void slotChangePageFromReturn();
void slotChangePage(int page);
void slotEmitNextPage();
void slotEmitPrevPage();
......
......@@ -530,7 +530,7 @@ void PageView::setupBaseActions( KActionCollection * ac )
ac->addAction(QStringLiteral("zoom_to"), d->aZoom );
d->aZoom->setEditable( true );
d->aZoom->setMaxComboViewCount( 14 );
connect( d->aZoom, SIGNAL(triggered(QAction*)), this, SLOT(slotZoom()) );
connect( d->aZoom, QOverload<QAction*>::of(&KSelectAction::triggered), this, &PageView::slotZoom );
updateZoomText();
d->aZoomIn = KStandardAction::zoomIn( this, SLOT(slotZoomIn()), ac );
......@@ -568,8 +568,8 @@ void PageView::setupViewerActions( KActionCollection * ac )
ac->addAction(QStringLiteral("view_pagesizes"), d->aPageSizes);
d->aPageSizes->setEnabled( false );
connect( d->aPageSizes , SIGNAL(triggered(int)),
this, SLOT(slotPageSizes(int)) );
connect( d->aPageSizes , QOverload<int>::of(&KSelectAction::triggered),
this, &PageView::slotPageSizes );
// Trim View actions
d->aTrimMode = new KActionMenu(i18n( "&Trim View" ), this );
......
......@@ -132,6 +132,8 @@ Q_OBJECT
void slotAction( Okular::Action *action );
void slotFormChanged( int pageNumber );
void externalKeyPressEvent( QKeyEvent *e );
Q_SIGNALS:
void rightClick( const Okular::Page *, const QPoint & );
void mouseBackButtonClick();
......@@ -276,7 +278,6 @@ Q_OBJECT
void slotStopSpeaks();
void slotPauseResumeSpeech();
#endif
void externalKeyPressEvent( QKeyEvent *e );
void slotAnnotationWindowDestroyed( QObject *window );
void slotProcessMovieAction( const Okular::MovieAction *action );
void slotProcessRenditionAction( const Okular::RenditionAction *action );
......
......@@ -157,8 +157,8 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, Okular::Document *doc)
// KPageDialog is a bit buggy, it doesn't fix its own sizeHint, so we have to manually resize
resize(layout->sizeHint());
connect( pageWidget(), SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)),
this, SLOT(pageChanged(KPageWidgetItem*,KPageWidgetItem*)) );
connect( pageWidget(), QOverload<KPageWidgetItem*,KPageWidgetItem*>::of(&KPageWidget::currentPageChanged),
this, &PropertiesDialog::pageChanged );
}
PropertiesDialog::~PropertiesDialog()
......
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