summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2014-10-01 17:40:48 (GMT)
committerMontel Laurent <montel@kde.org>2014-10-01 17:40:48 (GMT)
commit2eacdea022d04b7b1a52bc41d6ce2f715b820f13 (patch)
tree6a804be4ab6b88e126eb07c100410e4dc9e87270
parentd386ea257eb1a22b900b9e8ed4b5f14ac408b9b0 (diff)
Port to new connect api
-rw-r--r--conf/widgetannottools.cpp18
-rw-r--r--ui/annotationpropertiesdialog.cpp8
-rw-r--r--ui/annotationwidgets.cpp4
-rw-r--r--ui/annotwindow.cpp24
-rw-r--r--ui/bookmarklist.cpp18
-rw-r--r--ui/ktreeviewsearchline.cpp6
-rw-r--r--ui/pageviewannotator.cpp9
-rw-r--r--ui/pageviewutils.cpp6
-rw-r--r--ui/presentationsearchbar.cpp2
-rw-r--r--ui/presentationwidget.cpp22
-rw-r--r--ui/propertiesdialog.cpp8
-rw-r--r--ui/searchlineedit.cpp13
-rw-r--r--ui/searchwidget.cpp2
-rw-r--r--ui/side_reviews.cpp17
-rw-r--r--ui/sidebar.cpp11
-rw-r--r--ui/toc.cpp6
-rw-r--r--ui/toolaction.cpp8
-rw-r--r--ui/tts.cpp6
18 files changed, 85 insertions, 103 deletions
diff --git a/conf/widgetannottools.cpp b/conf/widgetannottools.cpp
index f7e4503..18ecb96 100644
--- a/conf/widgetannottools.cpp
+++ b/conf/widgetannottools.cpp
@@ -67,13 +67,13 @@ WidgetAnnotTools::WidgetAnnotTools( QWidget * parent )
vBoxLayout->addStretch();
hBoxLayout->addLayout( vBoxLayout );
- connect( m_list, SIGNAL( itemDoubleClicked(QListWidgetItem*) ), this, SLOT( slotEdit() ) );
- connect( m_list, SIGNAL( currentRowChanged(int) ), this, SLOT( updateButtons() ) );
- connect( m_btnAdd, SIGNAL( clicked(bool) ), this, SLOT( slotAdd() ) );
- connect( m_btnEdit, SIGNAL( clicked(bool) ), this, SLOT( slotEdit() ) );
- connect( m_btnRemove, SIGNAL( clicked(bool) ), this, SLOT( slotRemove() ) );
- connect( m_btnMoveUp, SIGNAL( clicked(bool) ), this, SLOT( slotMoveUp() ) );
- connect( m_btnMoveDown, SIGNAL( clicked(bool) ), this, SLOT( slotMoveDown() ) );
+ connect(m_list, &QListWidget::itemDoubleClicked, this, &WidgetAnnotTools::slotEdit);
+ connect(m_list, &QListWidget::currentRowChanged, this, &WidgetAnnotTools::updateButtons);
+ connect(m_btnAdd, &KPushButton::clicked, this, &WidgetAnnotTools::slotAdd);
+ connect(m_btnEdit, &KPushButton::clicked, this, &WidgetAnnotTools::slotEdit);
+ connect(m_btnRemove, &KPushButton::clicked, this, &WidgetAnnotTools::slotRemove);
+ connect(m_btnMoveUp, &KPushButton::clicked, this, &WidgetAnnotTools::slotMoveUp);
+ connect(m_btnMoveDown, &KPushButton::clicked, this, &WidgetAnnotTools::slotMoveDown);
}
WidgetAnnotTools::~WidgetAnnotTools()
@@ -272,7 +272,7 @@ EditAnnotToolDialog::EditAnnotToolDialog( QWidget *parent, const QDomElement &in
widgetLayout->addWidget( m_name, 0, 1 );
m_type = new KComboBox( false, widget );
- connect( m_type, SIGNAL( currentIndexChanged(int) ), this, SLOT( slotTypeChanged() ) );
+ connect(m_type, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &EditAnnotToolDialog::slotTypeChanged);
tmplabel = new QLabel( i18n( "&Type:" ), widget );
tmplabel->setBuddy( m_type );
widgetLayout->addWidget( tmplabel, 1, 0, Qt::AlignRight );
@@ -557,7 +557,7 @@ void EditAnnotToolDialog::rebuildAppearanceBox()
m_annotationWidget = AnnotationWidgetFactory::widgetFor( m_stubann );
m_appearanceBox->layout()->addWidget( m_annotationWidget->appearanceWidget() );
- connect( m_annotationWidget, SIGNAL(dataChanged()), this, SLOT(slotDataChanged()) );
+ connect(m_annotationWidget, &AnnotationWidget::dataChanged, this, &EditAnnotToolDialog::slotDataChanged);
}
void EditAnnotToolDialog::updateDefaultNameAndIcon()
diff --git a/ui/annotationpropertiesdialog.cpp b/ui/annotationpropertiesdialog.cpp
index 412503d..a63cac6 100644
--- a/ui/annotationpropertiesdialog.cpp
+++ b/ui/annotationpropertiesdialog.cpp
@@ -39,8 +39,8 @@ AnnotsPropertiesDialog::AnnotsPropertiesDialog( QWidget *parent, Okular::Documen
{
setStandardButtons( QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel );
button( QDialogButtonBox::Apply )->setEnabled( false );
- connect( this, SIGNAL(applyClicked()), this, SLOT(slotapply()) );
- connect( this, SIGNAL(okClicked()), this, SLOT(slotapply()) );
+ connect( button( QDialogButtonBox::Apply ), &QPushButton::clicked, this, &AnnotsPropertiesDialog::slotapply);
+ connect( button( QDialogButtonBox::Ok ), &QPushButton::clicked, this, &AnnotsPropertiesDialog::slotapply);
}
else
{
@@ -90,8 +90,8 @@ AnnotsPropertiesDialog::AnnotsPropertiesDialog( QWidget *parent, Okular::Documen
}
//BEGIN connections
- connect( AuthorEdit, SIGNAL(textChanged(QString)), this, SLOT(setModified()) );
- connect( m_annotWidget, SIGNAL(dataChanged()), this, SLOT(setModified()) );
+ connect(AuthorEdit, &QLineEdit::textChanged, this, &AnnotsPropertiesDialog::setModified);
+ connect(m_annotWidget, &AnnotationWidget::dataChanged, this, &AnnotsPropertiesDialog::setModified);
//END
#if 0
diff --git a/ui/annotationwidgets.cpp b/ui/annotationwidgets.cpp
index c44eb58..4b9098b 100644
--- a/ui/annotationwidgets.cpp
+++ b/ui/annotationwidgets.cpp
@@ -448,7 +448,7 @@ QWidget * LineAnnotationWidget::createStyleWidget()
{
connect( m_innerColor, SIGNAL(changed(QColor)), this, SIGNAL(dataChanged()) );
connect( m_useColor, SIGNAL(toggled(bool)), this, SIGNAL(dataChanged()) );
- connect( m_useColor, SIGNAL(toggled(bool)), m_innerColor, SLOT(setEnabled(bool)) );
+ connect(m_useColor, &QCheckBox::toggled, m_innerColor, &KColorButton::setEnabled);
}
connect( m_spinSize, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) );
@@ -599,7 +599,7 @@ QWidget * GeomAnnotationWidget::createStyleWidget()
connect( m_typeCombo, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dataChanged()) );
connect( m_innerColor, SIGNAL(changed(QColor)), this, SIGNAL(dataChanged()) );
connect( m_useColor, SIGNAL(toggled(bool)), this, SIGNAL(dataChanged()) );
- connect( m_useColor, SIGNAL(toggled(bool)), m_innerColor, SLOT(setEnabled(bool)) );
+ connect(m_useColor, &QCheckBox::toggled, m_innerColor, &KColorButton::setEnabled);
connect( m_spinSize, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) );
return widget;
diff --git a/ui/annotwindow.cpp b/ui/annotwindow.cpp
index 3fb6dd4..f317b78 100644
--- a/ui/annotwindow.cpp
+++ b/ui/annotwindow.cpp
@@ -203,14 +203,10 @@ AnnotWindow::AnnotWindow( QWidget * parent, Okular::Annotation * annot, Okular::
m_prevCursorPos = textEdit->textCursor().position();
m_prevAnchorPos = textEdit->textCursor().anchor();
- connect(textEdit, SIGNAL(textChanged()),
- this,SLOT(slotsaveWindowText()));
- connect(textEdit, SIGNAL(cursorPositionChanged()),
- this,SLOT(slotsaveWindowText()));
- connect(textEdit, SIGNAL(aboutToShowContextMenu(QMenu*)),
- this,SLOT(slotUpdateUndoAndRedoInContextMenu(QMenu*)));
- connect(m_document, SIGNAL(annotationContentsChangedByUndoRedo(Okular::Annotation*,QString,int,int)),
- this, SLOT(slotHandleContentsChangedByUndoRedo(Okular::Annotation*,QString,int,int)));
+ connect(textEdit, &KTextEdit::textChanged, this, &AnnotWindow::slotsaveWindowText);
+ connect(textEdit, &KTextEdit::cursorPositionChanged, this, &AnnotWindow::slotsaveWindowText);
+ connect(textEdit, &KTextEdit::aboutToShowContextMenu, this, &AnnotWindow::slotUpdateUndoAndRedoInContextMenu);
+ connect(m_document, &Okular::Document::annotationContentsChangedByUndoRedo, this, &AnnotWindow::slotHandleContentsChangedByUndoRedo);
if (!canEditAnnotation)
textEdit->setReadOnly(true);
@@ -303,8 +299,8 @@ void AnnotWindow::slotUpdateUndoAndRedoInContextMenu(QMenu* menu)
QAction *kundo = KStandardAction::create( KStandardAction::Undo, m_document, SLOT(undo()), menu);
QAction *kredo = KStandardAction::create( KStandardAction::Redo, m_document, SLOT(redo()), menu);
- connect(m_document, SIGNAL(canUndoChanged(bool)), kundo, SLOT(setEnabled(bool)));
- connect(m_document, SIGNAL(canRedoChanged(bool)), kredo, SLOT(setEnabled(bool)));
+ connect(m_document, &Okular::Document::canUndoChanged, kundo, &QAction::setEnabled);
+ connect(m_document, &Okular::Document::canRedoChanged, kredo, &QAction::setEnabled);
kundo->setEnabled(m_document->canUndo());
kredo->setEnabled(m_document->canRedo());
@@ -343,8 +339,8 @@ void AnnotWindow::renderLatex( bool render )
if (render)
{
textEdit->setReadOnly( true );
- disconnect(textEdit, SIGNAL(textChanged()), this,SLOT(slotsaveWindowText()));
- disconnect(textEdit, SIGNAL(cursorPositionChanged()), this,SLOT(slotsaveWindowText()));
+ disconnect(textEdit, &KTextEdit::textChanged, this, &AnnotWindow::slotsaveWindowText);
+ disconnect(textEdit, &KTextEdit::cursorPositionChanged, this, &AnnotWindow::slotsaveWindowText);
textEdit->setAcceptRichText( true );
QString contents = m_annot->contents();
contents = Qt::convertFromPlainText( contents );
@@ -384,8 +380,8 @@ void AnnotWindow::renderLatex( bool render )
{
textEdit->setAcceptRichText( false );
textEdit->setPlainText( m_annot->contents() );
- connect(textEdit, SIGNAL(textChanged()), this,SLOT(slotsaveWindowText()));
- connect(textEdit, SIGNAL(cursorPositionChanged()), this,SLOT(slotsaveWindowText()));
+ connect(textEdit, &KTextEdit::textChanged, this, &AnnotWindow::slotsaveWindowText);
+ connect(textEdit, &KTextEdit::cursorPositionChanged, this, &AnnotWindow::slotsaveWindowText);
textEdit->setReadOnly( false );
}
}
diff --git a/ui/bookmarklist.cpp b/ui/bookmarklist.cpp
index a11a886..29f468d 100644
--- a/ui/bookmarklist.cpp
+++ b/ui/bookmarklist.cpp
@@ -138,8 +138,8 @@ BookmarkList::BookmarkList( Okular::Document *document, QWidget *parent )
m_tree->header()->hide();
m_tree->setSelectionBehavior( QAbstractItemView::SelectRows );
m_tree->setEditTriggers( QAbstractItemView::EditKeyPressed );
- connect( m_tree, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(slotExecuted(QTreeWidgetItem*)) );
- connect( m_tree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu(QPoint)) );
+ connect(m_tree, &QTreeWidget::itemActivated, this, &BookmarkList::slotExecuted);
+ connect(m_tree, &QTreeWidget::customContextMenuRequested, this, &BookmarkList::slotContextMenu);
m_searchLine->addTreeWidget( m_tree );
QToolBar * bookmarkController = new QToolBar( this );
@@ -154,7 +154,7 @@ BookmarkList::BookmarkList( Okular::Document *document, QWidget *parent )
// insert a togglebutton [show only bookmarks in the current document]
m_showBoomarkOnlyAction = bookmarkController->addAction( QIcon::fromTheme( "bookmarks" ), i18n( "Current document only" ) );
m_showBoomarkOnlyAction->setCheckable( true );
- connect( m_showBoomarkOnlyAction, SIGNAL(toggled(bool)), this, SLOT(slotFilterBookmarks(bool)) );
+ connect(m_showBoomarkOnlyAction, &QAction::toggled, this, &BookmarkList::slotFilterBookmarks);
connect( m_document->bookmarkManager(), SIGNAL(bookmarksChanged(KUrl)), this, SLOT(slotBookmarksChanged(KUrl)) );
@@ -181,7 +181,7 @@ void BookmarkList::notifySetup( const QVector< Okular::Page * > & pages, int set
}
else
{
- disconnect( m_tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(slotChanged(QTreeWidgetItem*)) );
+ disconnect(m_tree, &QTreeWidget::itemChanged, this, &BookmarkList::slotChanged);
if ( m_currentDocumentItem && m_currentDocumentItem != m_tree->invisibleRootItem() )
{
m_currentDocumentItem->setIcon( 0, QIcon() );
@@ -192,7 +192,7 @@ void BookmarkList::notifySetup( const QVector< Okular::Page * > & pages, int set
m_currentDocumentItem->setIcon( 0, QIcon::fromTheme( "bookmarks" ) );
m_currentDocumentItem->setExpanded( true );
}
- connect( m_tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(slotChanged(QTreeWidgetItem*)) );
+ connect(m_tree, &QTreeWidget::itemChanged, this, &BookmarkList::slotChanged);
}
}
@@ -334,7 +334,7 @@ void BookmarkList::rebuildTree( bool filter )
{
// disconnect and reconnect later, otherwise we'll get many itemChanged()
// signals for all the current items
- disconnect( m_tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(slotChanged(QTreeWidgetItem*)) );
+ disconnect(m_tree, &QTreeWidget::itemChanged, this, &BookmarkList::slotChanged);
m_currentDocumentItem = 0;
m_tree->clear();
@@ -382,7 +382,7 @@ void BookmarkList::rebuildTree( bool filter )
m_tree->sortItems( 0, Qt::AscendingOrder );
- connect( m_tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(slotChanged(QTreeWidgetItem*)) );
+ connect(m_tree, &QTreeWidget::itemChanged, this, &BookmarkList::slotChanged);
}
void BookmarkList::goTo( BookmarkItem * item )
@@ -400,7 +400,7 @@ void BookmarkList::goTo( BookmarkItem * item )
void BookmarkList::selectiveUrlUpdate( const KUrl& url, QTreeWidgetItem*& item )
{
- disconnect( m_tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(slotChanged(QTreeWidgetItem*)) );
+ disconnect(m_tree, &QTreeWidget::itemChanged, this, &BookmarkList::slotChanged);
const KBookmark::List urlbookmarks = m_document->bookmarkManager()->bookmarks( url );
if ( urlbookmarks.isEmpty() )
@@ -450,7 +450,7 @@ void BookmarkList::selectiveUrlUpdate( const KUrl& url, QTreeWidgetItem*& item )
item->sortChildren( 0, Qt::AscendingOrder );
}
- connect( m_tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(slotChanged(QTreeWidgetItem*)) );
+ connect(m_tree, &QTreeWidget::itemChanged, this, &BookmarkList::slotChanged);
}
QTreeWidgetItem* BookmarkList::itemForUrl( const KUrl& url ) const
diff --git a/ui/ktreeviewsearchline.cpp b/ui/ktreeviewsearchline.cpp
index 5d85064..bc6c571 100644
--- a/ui/ktreeviewsearchline.cpp
+++ b/ui/ktreeviewsearchline.cpp
@@ -234,8 +234,7 @@ bool KTreeViewSearchLine::Private::checkItemParentsVisible( QTreeView *treeView,
KTreeViewSearchLine::KTreeViewSearchLine( QWidget *parent, QTreeView *treeView )
: KLineEdit( parent ), d( new Private( this ) )
{
- connect( this, SIGNAL(textChanged(QString)),
- this, SLOT(queueSearch(QString)) );
+ connect(this, &KTreeViewSearchLine::textChanged, this, &KTreeViewSearchLine::queueSearch);
setClearButtonShown( true );
setTreeView( treeView );
@@ -249,8 +248,7 @@ KTreeViewSearchLine::KTreeViewSearchLine( QWidget *parent,
const QList<QTreeView *> &treeViews )
: KLineEdit( parent ), d( new Private( this ) )
{
- connect( this, SIGNAL(textChanged(QString)),
- this, SLOT(queueSearch(QString)) );
+ connect(this, &KTreeViewSearchLine::textChanged, this, &KTreeViewSearchLine::queueSearch);
setClearButtonShown( true );
setTreeViews( treeViews );
diff --git a/ui/pageviewannotator.cpp b/ui/pageviewannotator.cpp
index 538492f..51227d9 100644
--- a/ui/pageviewannotator.cpp
+++ b/ui/pageviewannotator.cpp
@@ -736,13 +736,10 @@ void PageViewAnnotator::setEnabled( bool on )
m_toolBar->setItems( m_items );
m_toolBar->setToolsEnabled( m_toolsEnabled );
m_toolBar->setTextToolsEnabled( m_textToolsEnabled );
- connect( m_toolBar, SIGNAL(toolSelected(int)),
- this, SLOT(slotToolSelected(int)) );
- connect( m_toolBar, SIGNAL(orientationChanged(int)),
- this, SLOT(slotSaveToolbarOrientation(int)) );
+ connect(m_toolBar, &PageViewToolBar::toolSelected, this, &PageViewAnnotator::slotToolSelected);
+ connect(m_toolBar, &PageViewToolBar::orientationChanged, this, &PageViewAnnotator::slotSaveToolbarOrientation);
- connect( m_toolBar, SIGNAL(buttonDoubleClicked(int)),
- this, SLOT(slotToolDoubleClicked(int)) );
+ connect(m_toolBar, &PageViewToolBar::buttonDoubleClicked, this, &PageViewAnnotator::slotToolDoubleClicked);
m_toolBar->setCursor(Qt::ArrowCursor);
}
diff --git a/ui/pageviewutils.cpp b/ui/pageviewutils.cpp
index d92cd26..56566db 100644
--- a/ui/pageviewutils.cpp
+++ b/ui/pageviewutils.cpp
@@ -282,7 +282,7 @@ void PageViewMessage::display( const QString & message, const QString & details,
{
m_timer = new QTimer( this );
m_timer->setSingleShot( true );
- connect( m_timer, SIGNAL(timeout()), SLOT(hide()) );
+ connect(m_timer, &QTimer::timeout, this, &PageViewMessage::hide);
}
m_timer->start( durationMs );
} else if ( m_timer )
@@ -530,8 +530,8 @@ void PageViewToolBar::setItems( const QLinkedList<AnnotationToolItem> &items )
for ( ; it != end; ++it )
{
ToolBarButton * button = new ToolBarButton( this, *it );
- connect( button, SIGNAL(clicked()), this, SLOT(slotButtonClicked()) );
- connect( button, SIGNAL(buttonDoubleClicked(int)), this, SIGNAL(buttonDoubleClicked(int)) );
+ connect(button, &ToolBarButton::clicked, this, &PageViewToolBar::slotButtonClicked);
+ connect(button, &ToolBarButton::buttonDoubleClicked, this, &PageViewToolBar::buttonDoubleClicked);
d->buttons.append( button );
}
diff --git a/ui/presentationsearchbar.cpp b/ui/presentationsearchbar.cpp
index 890ef8a..81955fc 100644
--- a/ui/presentationsearchbar.cpp
+++ b/ui/presentationsearchbar.cpp
@@ -81,7 +81,7 @@ PresentationSearchBar::PresentationSearchBar( Okular::Document *document, QWidge
m_anchor->installEventFilter( this );
connect( closeBtn, SIGNAL(clicked()), this, SLOT(close()) );
- connect( findNextBtn, SIGNAL(clicked()), m_search, SLOT(findNext()) );
+ connect(findNextBtn, &KPushButton::clicked, m_search, &SearchLineEdit::findNext);
}
PresentationSearchBar::~PresentationSearchBar()
diff --git a/ui/presentationwidget.cpp b/ui/presentationwidget.cpp
index dd49c1c..4b46e66 100644
--- a/ui/presentationwidget.cpp
+++ b/ui/presentationwidget.cpp
@@ -176,24 +176,24 @@ PresentationWidget::PresentationWidget( QWidget * parent, Okular::Document * doc
QLabel *pagesLabel = new QLabel( m_topBar );
pagesLabel->setText( QLatin1String( " / " ) + QString::number( m_document->pages() ) + QLatin1String( " " ) );
m_topBar->addWidget( pagesLabel );
- connect( m_pagesEdit, SIGNAL(returnPressed()), this, SLOT(slotPageChanged()) );
+ connect(m_pagesEdit, &QLineEdit::returnPressed, this, &PresentationWidget::slotPageChanged);
m_topBar->addAction( QIcon::fromTheme( layoutDirection() == Qt::RightToLeft ? "go-previous" : "go-next" ), i18n( "Next Page" ), this, SLOT(slotNextPage()) );
m_topBar->addSeparator();
QAction *playPauseAct = collection->action( "presentation_play_pause" );
playPauseAct->setEnabled( true );
- connect( playPauseAct, SIGNAL(triggered()), SLOT(slotTogglePlayPause()) );
+ connect(playPauseAct, &QAction::triggered, this, &PresentationWidget::slotTogglePlayPause);
m_topBar->addAction( playPauseAct );
setPlayPauseIcon();
addAction( playPauseAct );
m_topBar->addSeparator();
QAction *drawingAct = collection->action( "presentation_drawing_mode" );
- connect( drawingAct, SIGNAL(toggled(bool)), SLOT(togglePencilMode(bool)) );
+ connect(drawingAct, &QAction::toggled, this, &PresentationWidget::togglePencilMode);
drawingAct->setEnabled( true );
m_topBar->addAction( drawingAct );
addAction( drawingAct );
QAction *eraseDrawingAct = collection->action( "presentation_erase_drawings" );
eraseDrawingAct->setEnabled( true );
- connect( eraseDrawingAct, SIGNAL(triggered()), SLOT(clearDrawings()) );
+ connect(eraseDrawingAct, &QAction::triggered, this, &PresentationWidget::clearDrawings);
m_topBar->addAction( eraseDrawingAct );
addAction( eraseDrawingAct );
QDesktopWidget *desktop = QApplication::desktop();
@@ -228,16 +228,16 @@ PresentationWidget::PresentationWidget( QWidget * parent, Okular::Document * doc
setContextMenuPolicy( Qt::PreventContextMenu );
m_transitionTimer = new QTimer( this );
m_transitionTimer->setSingleShot( true );
- connect( m_transitionTimer, SIGNAL(timeout()), this, SLOT(slotTransitionStep()) );
+ connect(m_transitionTimer, &QTimer::timeout, this, &PresentationWidget::slotTransitionStep);
m_overlayHideTimer = new QTimer( this );
m_overlayHideTimer->setSingleShot( true );
- connect( m_overlayHideTimer, SIGNAL(timeout()), this, SLOT(slotHideOverlay()) );
+ connect(m_overlayHideTimer, &QTimer::timeout, this, &PresentationWidget::slotHideOverlay);
m_nextPageTimer = new QTimer( this );
m_nextPageTimer->setSingleShot( true );
- connect( m_nextPageTimer, SIGNAL(timeout()), this, SLOT(slotNextPage()) );
+ connect(m_nextPageTimer, &QTimer::timeout, this, &PresentationWidget::slotNextPage);
- connect( m_document, SIGNAL(processMovieAction(const Okular::MovieAction*)), this, SLOT(slotProcessMovieAction(const Okular::MovieAction*)) );
- connect( m_document, SIGNAL(processRenditionAction(const Okular::RenditionAction*)), this, SLOT(slotProcessRenditionAction(const Okular::RenditionAction*)) );
+ connect(m_document, &Okular::Document::processMovieAction, this, &PresentationWidget::slotProcessMovieAction);
+ connect(m_document, &Okular::Document::processRenditionAction, this, &PresentationWidget::slotProcessRenditionAction);
// handle cursor appearance as specified in configuration
if ( Okular::Settings::slidesCursor() == Okular::Settings::EnumSlidesCursor::HiddenDelay )
@@ -495,7 +495,7 @@ void PresentationWidget::setupActions()
addAction( m_ac->action( KStandardAction::name( KStandardAction::DocumentForward ) ) );
QAction *action = m_ac->action( "switch_blackscreen_mode" );
- connect( action, SIGNAL(toggled(bool)), SLOT(toggleBlackScreenMode(bool)) );
+ connect(action, &QAction::toggled, this, &PresentationWidget::toggleBlackScreenMode);
action->setEnabled( true );
addAction( action );
}
@@ -743,7 +743,7 @@ void PresentationWidget::paintEvent( QPaintEvent * pe )
m_width = width();
m_height = height();
- connect( m_document, SIGNAL(linkFind()), this, SLOT(slotFind()) );
+ connect(m_document, &Okular::Document::linkFind, this, &PresentationWidget::slotFind);
// register this observer in document. events will come immediately
m_document->addObserver( this );
diff --git a/ui/propertiesdialog.cpp b/ui/propertiesdialog.cpp
index 736b516..fc3ce5e 100644
--- a/ui/propertiesdialog.cpp
+++ b/ui/propertiesdialog.cpp
@@ -140,7 +140,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, Okular::Document *doc)
// add a tree view
QTreeView *view = new QTreeView(page2);
view->setContextMenuPolicy(Qt::CustomContextMenu);
- connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showFontsMenu(QPoint)));
+ connect(view, &QTreeView::customContextMenuRequested, this, &PropertiesDialog::showFontsMenu);
page2Layout->addWidget(view);
view->setRootIsDecorated(false);
view->setAlternatingRowColors(true);
@@ -189,9 +189,9 @@ void PropertiesDialog::pageChanged( KPageWidgetItem *current, KPageWidgetItem *
{
if ( current == m_fontPage && !m_fontScanStarted )
{
- connect( m_document, SIGNAL(gotFont(Okular::FontInfo)), m_fontModel, SLOT(addFont(Okular::FontInfo)) );
- connect( m_document, SIGNAL(fontReadingProgress(int)), this, SLOT(slotFontReadingProgress(int)) );
- connect( m_document, SIGNAL(fontReadingEnded()), this, SLOT(slotFontReadingEnded()) );
+ connect(m_document, &Okular::Document::gotFont, m_fontModel, &FontsListModel::addFont);
+ connect(m_document, &Okular::Document::fontReadingProgress, this, &PropertiesDialog::slotFontReadingProgress);
+ connect(m_document, &Okular::Document::fontReadingEnded, this, &PropertiesDialog::slotFontReadingEnded);
QTimer::singleShot( 0, this, SLOT(reallyStartFontReading()) );
m_fontScanStarted = true;
diff --git a/ui/searchlineedit.cpp b/ui/searchlineedit.cpp
index e69065e..c736759 100644
--- a/ui/searchlineedit.cpp
+++ b/ui/searchlineedit.cpp
@@ -36,11 +36,10 @@ SearchLineEdit::SearchLineEdit( QWidget * parent, Okular::Document * document )
// a timer to ensure that we don't flood the document with requests to search
m_inputDelayTimer = new QTimer(this);
m_inputDelayTimer->setSingleShot(true);
- connect( m_inputDelayTimer, SIGNAL(timeout()),
- this, SLOT(startSearch()) );
+ connect(m_inputDelayTimer, &QTimer::timeout, this, &SearchLineEdit::startSearch);
- connect(this, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged(QString)));
- connect(this, SIGNAL(returnPressed(QString)), this, SLOT(slotReturnPressed(QString)));
+ connect(this, &SearchLineEdit::textChanged, this, &SearchLineEdit::slotTextChanged);
+ connect(this, &SearchLineEdit::returnPressed, this, &SearchLineEdit::slotReturnPressed);
connect(document, SIGNAL(searchFinished(int,Okular::Document::SearchStatus)), this, SLOT(searchFinished(int,Okular::Document::SearchStatus)));
}
@@ -282,10 +281,10 @@ SearchLineWidget::SearchLineWidget( QWidget * parent, Okular::Document * documen
m_timer = new QTimer( this );
m_timer->setSingleShot( true );
- connect( m_timer, SIGNAL(timeout()), this, SLOT(slotTimedout()) );
+ connect(m_timer, &QTimer::timeout, this, &SearchLineWidget::slotTimedout);
- connect( m_edit, SIGNAL(searchStarted()), this, SLOT(slotSearchStarted()) );
- connect( m_edit, SIGNAL(searchStopped()), this, SLOT(slotSearchStopped()) );
+ connect(m_edit, &SearchLineEdit::searchStarted, this, &SearchLineWidget::slotSearchStarted);
+ connect(m_edit, &SearchLineEdit::searchStopped, this, &SearchLineWidget::slotSearchStopped);
}
SearchLineEdit* SearchLineWidget::lineEdit() const
diff --git a/ui/searchwidget.cpp b/ui/searchwidget.cpp
index e1d6c41..2fb6551 100644
--- a/ui/searchwidget.cpp
+++ b/ui/searchwidget.cpp
@@ -63,7 +63,7 @@ SearchWidget::SearchWidget( QWidget * parent, Okular::Document * document )
m_marchAnyWordsAction->setActionGroup( actgrp );
m_marchAllWordsAction->setChecked( true );
- connect( m_menu, SIGNAL(triggered(QAction*)), SLOT(slotMenuChaged(QAction*)) );
+ connect(m_menu, &QMenu::triggered, this, &SearchWidget::slotMenuChaged);
// 3.2. create the toolbar button that spawns the popup menu
QToolButton *optionsMenuAction = new QToolButton( this );
diff --git a/ui/side_reviews.cpp b/ui/side_reviews.cpp
index 2dd2d2a..6eb389e 100644
--- a/ui/side_reviews.cpp
+++ b/ui/side_reviews.cpp
@@ -117,7 +117,7 @@ Reviews::Reviews( QWidget * parent, Okular::Document * document )
m_searchLine = new KTreeViewSearchLine( this, m_view );
m_searchLine->setCaseSensitivity( Okular::Settings::self()->reviewsSearchCaseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive );
m_searchLine->setRegularExpression( Okular::Settings::self()->reviewsSearchRegularExpression() );
- connect( m_searchLine, SIGNAL(searchOptionsChanged()), this, SLOT(saveSearchOptions()) );
+ connect(m_searchLine, &KTreeViewSearchLine::searchOptionsChanged, this, &Reviews::saveSearchOptions);
vLayout->addWidget( m_searchLine );
vLayout->addWidget( m_view );
vLayout->addWidget( toolBar );
@@ -127,12 +127,12 @@ Reviews::Reviews( QWidget * parent, Okular::Document * document )
// - add Page button
QAction * groupByPageAction = toolBar->addAction( QIcon::fromTheme( "text-x-generic" ), i18n( "Group by Page" ) );
groupByPageAction->setCheckable( true );
- connect( groupByPageAction, SIGNAL(toggled(bool)), this, SLOT(slotPageEnabled(bool)) );
+ connect(groupByPageAction, &QAction::toggled, this, &Reviews::slotPageEnabled);
groupByPageAction->setChecked( Okular::Settings::groupByPage() );
// - add Author button
QAction * groupByAuthorAction = toolBar->addAction( QIcon::fromTheme( "user-identity" ), i18n( "Group by Author" ) );
groupByAuthorAction->setCheckable( true );
- connect( groupByAuthorAction, SIGNAL(toggled(bool)), this, SLOT(slotAuthorEnabled(bool)) );
+ connect(groupByAuthorAction, &QAction::toggled, this, &Reviews::slotAuthorEnabled);
groupByAuthorAction->setChecked( Okular::Settings::groupByAuthor() );
// - add separator
@@ -140,15 +140,13 @@ Reviews::Reviews( QWidget * parent, Okular::Document * document )
// - add Current Page Only button
QAction * curPageOnlyAction = toolBar->addAction( QIcon::fromTheme( "arrow-down" ), i18n( "Show reviews for current page only" ) );
curPageOnlyAction->setCheckable( true );
- connect( curPageOnlyAction, SIGNAL(toggled(bool)), this, SLOT(slotCurrentPageOnly(bool)) );
+ connect(curPageOnlyAction, &QAction::toggled, this, &Reviews::slotCurrentPageOnly);
curPageOnlyAction->setChecked( Okular::Settings::currentPageOnly() );
- connect( m_view, SIGNAL(activated(QModelIndex)),
- this, SLOT(activated(QModelIndex)) );
+ connect(m_view, &TreeView::activated, this, &Reviews::activated);
m_view->setContextMenuPolicy( Qt::CustomContextMenu );
- connect( m_view, SIGNAL(customContextMenuRequested(QPoint)),
- this, SLOT(contextMenuRequested(QPoint)) );
+ connect(m_view, &TreeView::customContextMenuRequested, this, &Reviews::contextMenuRequested);
}
@@ -255,8 +253,7 @@ QModelIndexList Reviews::retrieveAnnotations(const QModelIndex& idx) const
void Reviews::contextMenuRequested( const QPoint &pos )
{
AnnotationPopup popup( m_document, AnnotationPopup::SingleAnnotationMode, this );
- connect( &popup, SIGNAL(openAnnotationWindow(Okular::Annotation*,int)),
- this, SIGNAL(openAnnotationWindow(Okular::Annotation*,int)) );
+ connect(&popup, &AnnotationPopup::openAnnotationWindow, this, &Reviews::openAnnotationWindow);
QModelIndexList indexes = m_view->selectionModel()->selectedIndexes();
Q_FOREACH ( const QModelIndex &index, indexes )
diff --git a/ui/sidebar.cpp b/ui/sidebar.cpp
index 763ecd8..60af9a0 100644
--- a/ui/sidebar.cpp
+++ b/ui/sidebar.cpp
@@ -492,11 +492,10 @@ Sidebar::Sidebar( QWidget *parent )
d->stack = new QStackedWidget( d->sideContainer );
d->vlay->addWidget( d->stack );
- connect( d->list, SIGNAL(customContextMenuRequested(QPoint)),
- this, SLOT(listContextMenu(QPoint)) );
- connect( d->splitter, SIGNAL(splitterMoved(int,int)), this, SLOT(splitterMoved(int,int)) );
+ connect(d->list, &SidebarListWidget::customContextMenuRequested, this, &Sidebar::listContextMenu);
+ connect(d->splitter, &QSplitter::splitterMoved, this, &Sidebar::splitterMoved);
- connect( KGlobalSettings::self(), SIGNAL(appearanceChanged()), this, SLOT(appearanceChanged()) );
+ connect(KGlobalSettings::self(), &KGlobalSettings::appearanceChanged, this, &Sidebar::appearanceChanged);
setCollapsed( true );
setFocusProxy( d->list );
@@ -708,7 +707,7 @@ void Sidebar::listContextMenu( const QPoint &pos )
QAction *showTextAct = menu.addAction( i18n( "Show Text" ) );
showTextAct->setCheckable( true );
showTextAct->setChecked( d->sideDelegate->isTextShown() );
- connect( showTextAct, SIGNAL(toggled(bool)), this, SLOT(showTextToggled(bool)) );
+ connect(showTextAct, &QAction::toggled, this, &Sidebar::showTextToggled);
menu.addSeparator();
QActionGroup *sizeGroup = new QActionGroup( &menu );
int curSize = d->list->iconSize().width();
@@ -725,7 +724,7 @@ void Sidebar::listContextMenu( const QPoint &pos )
ADD_SIZE_ACTION( i18n( "Normal Icons" ), KIconLoader::SizeMedium )
ADD_SIZE_ACTION( i18n( "Large Icons" ), KIconLoader::SizeLarge )
#undef ADD_SIZE_ACTION
- connect( sizeGroup, SIGNAL(triggered(QAction*)), this, SLOT(iconSizeChanged(QAction*)) );
+ connect(sizeGroup, &QActionGroup::triggered, this, &Sidebar::iconSizeChanged);
menu.exec( mapToGlobal( pos ) );
}
diff --git a/ui/toc.cpp b/ui/toc.cpp
index b13345a..707c368 100644
--- a/ui/toc.cpp
+++ b/ui/toc.cpp
@@ -35,7 +35,7 @@ TOC::TOC(QWidget *parent, Okular::Document *document) : QWidget(parent), m_docum
mainlay->addWidget( m_searchLine );
m_searchLine->setCaseSensitivity( Okular::Settings::self()->contentsSearchCaseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive );
m_searchLine->setRegularExpression( Okular::Settings::self()->contentsSearchRegularExpression() );
- connect( m_searchLine, SIGNAL(searchOptionsChanged()), this, SLOT(saveSearchOptions()) );
+ connect(m_searchLine, &KTreeViewSearchLine::searchOptionsChanged, this, &TOC::saveSearchOptions);
m_treeView = new QTreeView( this );
mainlay->addWidget( m_treeView );
@@ -47,8 +47,8 @@ TOC::TOC(QWidget *parent, Okular::Document *document) : QWidget(parent), m_docum
m_treeView->setItemDelegate( new PageItemDelegate( m_treeView ) );
m_treeView->header()->hide();
m_treeView->setSelectionBehavior( QAbstractItemView::SelectRows );
- connect( m_treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(slotExecuted(QModelIndex)) );
- connect( m_treeView, SIGNAL(activated(QModelIndex)), this, SLOT(slotExecuted(QModelIndex)) );
+ connect(m_treeView, &QTreeView::clicked, this, &TOC::slotExecuted);
+ connect(m_treeView, &QTreeView::activated, this, &TOC::slotExecuted);
m_searchLine->addTreeView( m_treeView );
}
diff --git a/ui/toolaction.cpp b/ui/toolaction.cpp
index 86e8412..112195d 100644
--- a/ui/toolaction.cpp
+++ b/ui/toolaction.cpp
@@ -52,11 +52,9 @@ QWidget* ToolAction::createWidget( QWidget *parent )
button->setPopupMode( QToolButton::DelayedPopup );
button->setMenu( new QMenu( button ) );
button->setCheckable( true );
- connect( toolBar, SIGNAL(iconSizeChanged(QSize)),
- button, SLOT(setIconSize(QSize)) );
- connect( toolBar, SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)),
- button, SLOT(setToolButtonStyle(Qt::ToolButtonStyle)) );
- connect( button, SIGNAL(triggered(QAction*)), toolBar, SIGNAL(actionTriggered(QAction*)) );
+ connect(toolBar, &QToolBar::iconSizeChanged, button, &QToolButton::setIconSize);
+ connect(toolBar, &QToolBar::toolButtonStyleChanged, button, &QToolButton::setToolButtonStyle);
+ connect(button, &QToolButton::triggered, toolBar, &QToolBar::actionTriggered);
connect( button->menu(), SIGNAL(triggered(QAction*)), this, SLOT(slotNewDefaultAction(QAction*)) );
m_buttons.append( button );
diff --git a/ui/tts.cpp b/ui/tts.cpp
index 6662572..bdd680b 100644
--- a/ui/tts.cpp
+++ b/ui/tts.cpp
@@ -65,8 +65,7 @@ void OkularTTS::Private::setupIface()
kspeech = new org::kde::KSpeech( "org.kde.kttsd", "/KSpeech", QDBusConnection::sessionBus() );
kspeech->setParent( q );
kspeech->setApplicationName( "Okular" );
- connect( kspeech, SIGNAL(jobStateChanged(QString,int,int)),
- q, SLOT(slotJobStateChanged(QString,int,int)) );
+ connect(kspeech, &org::kde::KSpeech::jobStateChanged, q, &OkularTTS::slotJobStateChanged);
}
}
@@ -80,8 +79,7 @@ void OkularTTS::Private::teardownIface()
OkularTTS::OkularTTS( QObject *parent )
: QObject( parent ), d( new Private( this ) )
{
- connect( &d->watcher, SIGNAL(serviceUnregistered(QString)),
- this, SLOT(slotServiceUnregistered(QString)) );
+ connect(&d->watcher, &QDBusServiceWatcher::serviceUnregistered, this, &OkularTTS::slotServiceUnregistered);
}
OkularTTS::~OkularTTS()