Commit c549acaa authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Move the Q_PRIVATE_SLOTS to lambda connections

Some of the invokeMethods with a queued connection get changed with a
QTimer::SingleShot with 0 which has the same behaviour
parent 377a64eb
Pipeline #12197 passed with stage
in 11 minutes and 23 seconds
......@@ -145,8 +145,9 @@ BookmarkManager::BookmarkManager( DocumentPrivate * document )
d->manager = KBookmarkManager::managerForFile( d->file, QStringLiteral("okular") );
d->manager->setEditorOptions( QGuiApplication::applicationDisplayName(), false );
d->manager->setUpdate( true );
connect( d->manager, SIGNAL(changed(QString,QString)),
this, SLOT(_o_changed(QString,QString)) );
connect( d->manager, &KBookmarkManager::changed, this, [this](const QString & groupAddress, const QString & caller) {
d->_o_changed(groupAddress, caller);
});
}
BookmarkManager::~BookmarkManager()
......
......@@ -204,8 +204,6 @@ class OKULARCORE_EXPORT BookmarkManager : public QObject
bool removePageBookmark( int page );
Q_DISABLE_COPY( BookmarkManager )
Q_PRIVATE_SLOT( d, void _o_changed( const QString &, const QString & ) )
};
}
......
......@@ -1547,7 +1547,7 @@ void DocumentPrivate::sendGeneratorPixmapRequest()
{
m_pixmapRequestsMutex.unlock();
// pino (7/4/2006): set the polling interval from 10 to 30
QTimer::singleShot( 30, m_parent, SLOT(sendGeneratorPixmapRequest()) );
QTimer::singleShot( 30, m_parent, [this] { sendGeneratorPixmapRequest(); } );
}
}
......@@ -1583,7 +1583,7 @@ void DocumentPrivate::fontReadingGotFont( const Okular::FontInfo& font )
}
}
void DocumentPrivate::slotGeneratorConfigChanged( const QString& )
void DocumentPrivate::slotGeneratorConfigChanged()
{
if ( !m_generator )
return;
......@@ -1763,7 +1763,7 @@ void DocumentPrivate::doContinueDirectionMatchSearch(void *doContinueDirectionMa
}
// Both of the previous if branches need to call doContinueDirectionMatchSearch
QMetaObject::invokeMethod(m_parent, "doContinueDirectionMatchSearch", Qt::QueuedConnection, Q_ARG(void *, searchStruct));
QTimer::singleShot(0, m_parent, [this, searchStruct] { doContinueDirectionMatchSearch(searchStruct); });
}
else
{
......@@ -1874,7 +1874,7 @@ void DocumentPrivate::doContinueAllDocumentSearch(void *pagesToNotifySet, void *
}
delete lastMatch;
QMetaObject::invokeMethod(m_parent, "doContinueAllDocumentSearch", Qt::QueuedConnection, Q_ARG(void *, pagesToNotifySet), Q_ARG(void *, pageMatches), Q_ARG(int, currentPage + 1), Q_ARG(int, searchID));
QTimer::singleShot(0, m_parent, [this, pagesToNotifySet, pageMatches, currentPage, searchID] { doContinueAllDocumentSearch(pagesToNotifySet, pageMatches, currentPage + 1, searchID); });
}
else
{
......@@ -1994,7 +1994,7 @@ void DocumentPrivate::doContinueGooglesDocumentSearch(void *pagesToNotifySet, vo
pageMatches->remove(page);
}
QMetaObject::invokeMethod(m_parent, "doContinueGooglesDocumentSearch", Qt::QueuedConnection, Q_ARG(void *, pagesToNotifySet), Q_ARG(void *, pageMatches), Q_ARG(int, currentPage + 1), Q_ARG(int, searchID), Q_ARG(QStringList, words));
QTimer::singleShot(0, m_parent, [this, pagesToNotifySet, pageMatches, currentPage, searchID, words] { doContinueGooglesDocumentSearch(pagesToNotifySet, pageMatches, currentPage + 1, searchID, words); });
}
else
{
......@@ -2320,7 +2320,7 @@ Document::Document( QWidget *widget )
d->m_viewportIterator = d->m_viewportHistory.insert( d->m_viewportHistory.end(), DocumentViewport() );
d->m_undoStack = new QUndoStack(this);
connect( SettingsCore::self(), SIGNAL(configChanged()), this, SLOT(_o_configChanged()) );
connect( SettingsCore::self(), &SettingsCore::configChanged, this, [this] { d->_o_configChanged(); } );
connect(d->m_undoStack, &QUndoStack::canUndoChanged, this, &Document::canUndoChanged);
connect(d->m_undoStack, &QUndoStack::canRedoChanged, this, &Document::canRedoChanged);
connect(d->m_undoStack, &QUndoStack::cleanChanged, this, &Document::undoHistoryCleanChanged);
......@@ -2617,8 +2617,8 @@ Document::OpenResult Document::openDocument(const QString & docFile, const QUrl
d->m_generatorName = offer.pluginId();
d->m_pageController = new PageController();
connect( d->m_pageController, SIGNAL(rotationFinished(int,Okular::Page*)),
this, SLOT(rotationFinished(int,Okular::Page*)) );
connect( d->m_pageController, &PageController::rotationFinished,
this, [this](int p, Okular::Page *op) { d->rotationFinished(p, op); } );
for ( Page *p : qAsConst(d->m_pagesVector) )
p->d->m_doc = d;
......@@ -2663,7 +2663,7 @@ Document::OpenResult Document::openDocument(const QString & docFile, const QUrl
if ( !d->m_saveBookmarksTimer )
{
d->m_saveBookmarksTimer = new QTimer( this );
connect( d->m_saveBookmarksTimer, SIGNAL(timeout()), this, SLOT(saveDocumentInfo()) );
connect( d->m_saveBookmarksTimer, &QTimer::timeout, this, [this] { d->saveDocumentInfo(); } );
}
d->m_saveBookmarksTimer->start( 5 * 60 * 1000 );
......@@ -2671,7 +2671,7 @@ Document::OpenResult Document::openDocument(const QString & docFile, const QUrl
if ( !d->m_memCheckTimer )
{
d->m_memCheckTimer = new QTimer( this );
connect( d->m_memCheckTimer, SIGNAL(timeout()), this, SLOT(slotTimedMemoryCheck()) );
connect( d->m_memCheckTimer, &QTimer::timeout, this, [this] { d->slotTimedMemoryCheck(); } );
}
d->m_memCheckTimer->start( 2000 );
......@@ -3045,8 +3045,8 @@ void Document::startFontReading()
}
d->m_fontThread = new FontExtractionThread( d->m_generator, pages() );
connect( d->m_fontThread, SIGNAL(gotFont(Okular::FontInfo)), this, SLOT(fontReadingGotFont(Okular::FontInfo)) );
connect( d->m_fontThread.data(), SIGNAL(progress(int)), this, SLOT(slotFontReadingProgress(int)) );
connect( d->m_fontThread, &FontExtractionThread::gotFont, this, [this](const Okular::FontInfo &f) { d->fontReadingGotFont(f); } );
connect( d->m_fontThread.data(), &FontExtractionThread::progress, this, [this](int p) { d->slotFontReadingProgress(p); } );
d->m_fontThread->startExtraction( /*d->m_generator->hasFeature( Generator::Threaded )*/true );
}
......@@ -3931,7 +3931,7 @@ void Document::searchText( int searchID, const QString & text, bool fromStart, Q
QMap< Page *, QVector<RegularAreaRect *> > *pageMatches = new QMap< Page *, QVector<RegularAreaRect *> >;
// search and highlight 'text' (as a solid phrase) on all pages
QMetaObject::invokeMethod(this, "doContinueAllDocumentSearch", Qt::QueuedConnection, Q_ARG(void *, pagesToNotify), Q_ARG(void *, pageMatches), Q_ARG(int, 0), Q_ARG(int, searchID));
QTimer::singleShot(0, this, [this, pagesToNotify, pageMatches, searchID] { d->doContinueAllDocumentSearch(pagesToNotify, pageMatches, 0, searchID); });
}
// 2. NEXTMATCH - find next matching item (or start from top)
// 3. PREVMATCH - find previous matching item (or start from bottom)
......@@ -3969,7 +3969,7 @@ void Document::searchText( int searchID, const QString & text, bool fromStart, Q
searchStruct->currentPage = currentPage;
searchStruct->searchID = searchID;
QMetaObject::invokeMethod(this, "doContinueDirectionMatchSearch", Qt::QueuedConnection, Q_ARG(void *, searchStruct));
QTimer::singleShot(0, this, [this, searchStruct] { d->doContinueDirectionMatchSearch(searchStruct); });
}
// 4. GOOGLE* - process all document marking pages
else if ( type == GoogleAll || type == GoogleAny )
......@@ -3978,7 +3978,7 @@ void Document::searchText( int searchID, const QString & text, bool fromStart, Q
const QStringList words = text.split( QLatin1Char ( ' ' ), QString::SkipEmptyParts );
// search and highlight every word in 'text' on all pages
QMetaObject::invokeMethod(this, "doContinueGooglesDocumentSearch", Qt::QueuedConnection, Q_ARG(void *, pagesToNotify), Q_ARG(void *, pageMatches), Q_ARG(int, 0), Q_ARG(int, searchID), Q_ARG(QStringList, words));
QTimer::singleShot(0, this, [this, pagesToNotify, pageMatches, searchID, words] { d->doContinueGooglesDocumentSearch(pagesToNotify, pageMatches, 0, searchID, words); });
}
}
......@@ -4736,8 +4736,8 @@ void Document::fillConfigDialog( KConfigDialog * dialog )
}
if ( pagesAdded )
{
connect( dialog, SIGNAL(settingsChanged(QString)),
this, SLOT(slotGeneratorConfigChanged(QString)) );
connect( dialog, &KConfigDialog::settingsChanged,
this, [this] { d->slotGeneratorConfigChanged(); } );
}
}
......@@ -5342,6 +5342,11 @@ QByteArray Document::requestSignedRevisionData( const Okular::SignatureInfo &inf
return data;
}
void Document::refreshPixmaps( int pageNumber )
{
d->refreshPixmaps( pageNumber );
}
void DocumentPrivate::executeScript( const QString &function )
{
if( !m_scripter )
......
......@@ -1066,6 +1066,13 @@ class OKULARCORE_EXPORT Document : public QObject
*/
QByteArray requestSignedRevisionData( const Okular::SignatureInfo &info );
/**
* Refresh the pixmaps for the given @p pageNumber.
*
* @since 1.10
*/
void refreshPixmaps( int pageNumber );
Q_SIGNALS:
/**
* This signal is emitted whenever the document is about to close.
......@@ -1267,21 +1274,6 @@ class OKULARCORE_EXPORT Document : public QObject
DocumentPrivate *const d;
Q_DISABLE_COPY( Document )
Q_PRIVATE_SLOT( d, void saveDocumentInfo() const )
Q_PRIVATE_SLOT( d, void slotTimedMemoryCheck() )
Q_PRIVATE_SLOT( d, void sendGeneratorPixmapRequest() )
Q_PRIVATE_SLOT( d, void rotationFinished( int page, Okular::Page *okularPage ) )
Q_PRIVATE_SLOT( d, void slotFontReadingProgress( int page ) )
Q_PRIVATE_SLOT( d, void fontReadingGotFont( const Okular::FontInfo& font ) )
Q_PRIVATE_SLOT( d, void slotGeneratorConfigChanged( const QString& ) )
Q_PRIVATE_SLOT( d, void refreshPixmaps( int ) )
Q_PRIVATE_SLOT( d, void _o_configChanged() )
// search thread simulators
Q_PRIVATE_SLOT( d, void doContinueDirectionMatchSearch(void *doContinueDirectionMatchSearchStruct) )
Q_PRIVATE_SLOT( d, void doContinueAllDocumentSearch(void *pagesToNotifySet, void *pageMatchesMap, int currentPage, int searchID) )
Q_PRIVATE_SLOT( d, void doContinueGooglesDocumentSearch(void *pagesToNotifySet, void *pageMatchesMap, int currentPage, int searchID, const QStringList & words) )
};
......
......@@ -185,7 +185,7 @@ class DocumentPrivate
void rotationFinished( int page, Okular::Page *okularPage );
void slotFontReadingProgress( int page );
void fontReadingGotFont( const Okular::FontInfo& font );
void slotGeneratorConfigChanged( const QString& );
void slotGeneratorConfigChanged();
void refreshPixmaps( int );
void _o_configChanged();
void doContinueDirectionMatchSearch(void *doContinueDirectionMatchSearchStruct);
......
......@@ -71,7 +71,7 @@ PixmapGenerationThread* GeneratorPrivate::pixmapGenerationThread()
Q_Q( Generator );
mPixmapGenerationThread = new PixmapGenerationThread( q );
QObject::connect( mPixmapGenerationThread, SIGNAL(finished()), q, SLOT(pixmapGenerationFinished()),
QObject::connect( mPixmapGenerationThread, &PixmapGenerationThread::finished, q, [this] { pixmapGenerationFinished(); },
Qt::QueuedConnection );
return mPixmapGenerationThread;
......@@ -84,7 +84,7 @@ TextPageGenerationThread* GeneratorPrivate::textPageGenerationThread()
Q_Q( Generator );
mTextPageGenerationThread = new TextPageGenerationThread( q );
QObject::connect( mTextPageGenerationThread, SIGNAL(finished()), q, SLOT(textpageGenerationFinished()),
QObject::connect( mTextPageGenerationThread, &TextPageGenerationThread::finished, q, [this] { textpageGenerationFinished(); },
Qt::QueuedConnection );
return mTextPageGenerationThread;
......
......@@ -625,9 +625,6 @@ class OKULARCORE_EXPORT Generator : public QObject
private:
Q_DISABLE_COPY( Generator )
Q_PRIVATE_SLOT( d_func(), void pixmapGenerationFinished() )
Q_PRIVATE_SLOT( d_func(), void textpageGenerationFinished() )
};
/**
......
......@@ -17,6 +17,7 @@
#include <qhash.h>
#include <QDebug>
#include <QTimer>
#include "../debug_p.h"
#include "../document_p.h"
......@@ -44,7 +45,8 @@ static void updateField( FormField *field )
if (page)
{
Document *doc = PagePrivate::get( page )->m_doc->m_parent;
QMetaObject::invokeMethod( doc, "refreshPixmaps", Qt::QueuedConnection, Q_ARG( int, page->number() ) );
const int pageNumber = page->number();
QTimer::singleShot(0, doc, [doc, pageNumber] { doc->refreshPixmaps(pageNumber); } );
emit doc->refreshFormWidget( field );
}
else
......
......@@ -265,16 +265,16 @@ void TextDocumentGeneratorPrivate::initializeGenerator()
q->setFeature( Generator::Threaded );
#endif
QObject::connect( mConverter, SIGNAL(addAction(Action*,int,int)),
q, SLOT(addAction(Action*,int,int)) );
QObject::connect( mConverter, SIGNAL(addAnnotation(Annotation*,int,int)),
q, SLOT(addAnnotation(Annotation*,int,int)) );
QObject::connect( mConverter, SIGNAL(addTitle(int,QString,QTextBlock)),
q, SLOT(addTitle(int,QString,QTextBlock)) );
QObject::connect( mConverter, SIGNAL(addMetaData(QString,QString,QString)),
q, SLOT(addMetaData(QString,QString,QString)) );
QObject::connect( mConverter, SIGNAL(addMetaData(DocumentInfo::Key,QString)),
q, SLOT(addMetaData(DocumentInfo::Key,QString)) );
QObject::connect( mConverter, &TextDocumentConverter::addAction,
q, [this](Action *a, int cb, int ce) { addAction(a, cb, ce); } );
QObject::connect( mConverter, &TextDocumentConverter::addAnnotation,
q, [this](Annotation *a, int cb, int ce) { addAnnotation(a, cb, ce); } );
QObject::connect( mConverter, &TextDocumentConverter::addTitle,
q, [this](int l, const QString &t, const QTextBlock &b) { addTitle(l, t, b); } );
QObject::connect( mConverter, QOverload<const QString &, const QString &, const QString &>::of(&TextDocumentConverter::addMetaData),
q, [this](const QString &k, const QString &v, const QString &t) { addMetaData(k, v, t); } );
QObject::connect( mConverter, QOverload<DocumentInfo::Key,const QString &>::of(&TextDocumentConverter::addMetaData),
q, [this](DocumentInfo::Key k, const QString &v) { addMetaData(k, v); } );
QObject::connect( mConverter, &TextDocumentConverter::error,
q, &Generator::error );
......
......@@ -84,6 +84,7 @@ class OKULARCORE_EXPORT TextDocumentConverter : public QObject
*/
void addMetaData( const QString &key, const QString &value, const QString &title );
// TODO When we can do a BIC change rename one of the two addMetaData functions (or see if we can kill one)
/**
* Adds a set of meta data to the generator.
*
......@@ -222,12 +223,6 @@ class OKULARCORE_EXPORT TextDocumentGenerator : public Generator, public Okular:
private:
Q_DECLARE_PRIVATE( TextDocumentGenerator )
Q_DISABLE_COPY( TextDocumentGenerator )
Q_PRIVATE_SLOT( d_func(), void addAction( Action*, int, int ) )
Q_PRIVATE_SLOT( d_func(), void addAnnotation( Annotation*, int, int ) )
Q_PRIVATE_SLOT( d_func(), void addTitle( int, const QString&, const QTextBlock& ) )
Q_PRIVATE_SLOT( d_func(), void addMetaData( const QString&, const QString&, const QString& ) )
Q_PRIVATE_SLOT( d_func(), void addMetaData( DocumentInfo::Key, const QString& ) )
};
}
......
......@@ -282,10 +282,10 @@ void KTreeViewSearchLine::contextMenuEvent( QContextMenuEvent *event )
popup->addSeparator();
QMenu *optionsSubMenu = popup->addMenu( i18n("Search Options") );
QAction* caseSensitiveAction = optionsSubMenu->addAction( i18nc("Enable case sensitive search in the side navigation panels", "Case Sensitive"), this, SLOT(slotCaseSensitive()) );
QAction* caseSensitiveAction = optionsSubMenu->addAction( i18nc("Enable case sensitive search in the side navigation panels", "Case Sensitive"), this, [this] { d->slotCaseSensitive(); } );
caseSensitiveAction->setCheckable( true );
caseSensitiveAction->setChecked( d->caseSensitive );
QAction* regularExpressionAction = optionsSubMenu->addAction( i18nc("Enable regular expression search in the side navigation panels", "Regular Expression"), this, SLOT(slotRegularExpression()) );
QAction* regularExpressionAction = optionsSubMenu->addAction( i18nc("Enable regular expression search in the side navigation panels", "Regular Expression"), this, [this] { d->slotRegularExpression(); } );
regularExpressionAction->setCheckable( true );
regularExpressionAction->setChecked( d->regularExpression );
......@@ -296,22 +296,22 @@ void KTreeViewSearchLine::contextMenuEvent( QContextMenuEvent *event )
void KTreeViewSearchLine::connectTreeView( QTreeView *treeView )
{
if ( treeView ) {
connect( treeView, SIGNAL(destroyed(QObject*)),
this, SLOT(treeViewDeleted(QObject*)) );
connect( treeView, &QTreeView::destroyed,
this, &KTreeViewSearchLine::treeViewDeleted );
connect( treeView->model(), SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(rowsInserted(QModelIndex,int,int)) );
connect( treeView->model(), &QAbstractItemModel::rowsInserted,
this, &KTreeViewSearchLine::rowsInserted );
}
}
void KTreeViewSearchLine::disconnectTreeView( QTreeView *treeView )
{
if ( treeView ) {
disconnect( treeView, SIGNAL(destroyed(QObject*)),
this, SLOT(treeViewDeleted(QObject*)) );
disconnect( treeView, &QTreeView::destroyed,
this, &KTreeViewSearchLine::treeViewDeleted );
disconnect( treeView->model(), SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(rowsInserted(QModelIndex,int,int)) );
disconnect( treeView->model(), &QAbstractItemModel::rowsInserted,
this, &KTreeViewSearchLine::rowsInserted );
}
}
......@@ -335,6 +335,20 @@ void KTreeViewSearchLine::activateSearch()
updateSearch( d->search );
}
////////////////////////////////////////////////////////////////////////////////
// private functions
////////////////////////////////////////////////////////////////////////////////
void KTreeViewSearchLine::rowsInserted(const QModelIndex & parent, int start, int end) const
{
d->rowsInserted(parent, start, end);
}
void KTreeViewSearchLine::treeViewDeleted( QObject *treeView )
{
d->treeViewDeleted( treeView );
}
////////////////////////////////////////////////////////////////////////////////
// KTreeViewSearchLineWidget
////////////////////////////////////////////////////////////////////////////////
......
......@@ -175,10 +175,8 @@ class KTreeViewSearchLine : public KLineEdit
class Private;
Private* const d;
Q_PRIVATE_SLOT( d, void rowsInserted( const QModelIndex&, int, int ) const )
Q_PRIVATE_SLOT( d, void treeViewDeleted( QObject* ) )
Q_PRIVATE_SLOT( d, void slotCaseSensitive() )
Q_PRIVATE_SLOT( d, void slotRegularExpression() )
void rowsInserted( const QModelIndex&, int, int ) const;
void treeViewDeleted( QObject* );
};
/**
......
......@@ -5522,8 +5522,7 @@ void PageView::slotRefreshPage()
{
for (int req : qAsConst(d->refreshPages))
{
QMetaObject::invokeMethod( d->document, "refreshPixmaps", Qt::QueuedConnection,
Q_ARG( int, req ) );
QTimer::singleShot(0, this, [this, req] { d->document->refreshPixmaps(req); });
}
d->refreshPages.clear();
}
......
......@@ -76,7 +76,7 @@ class ThumbnailListPrivate : public QWidget
// SLOTS:
// make requests for generating pixmaps for visible thumbnails
void slotRequestVisiblePixmaps( int newContentsY = -1 );
void slotRequestVisiblePixmaps();
// delay timeout: resize overlays and requests pixmaps
void slotDelayTimeout();
ThumbnailWidget* getPageByNumber( int page ) const;
......@@ -216,7 +216,7 @@ ThumbnailList::ThumbnailList( QWidget *parent, Okular::Document *document )
widget()->show();
widget()->setBackgroundRole( QPalette::Base );
connect( verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(slotRequestVisiblePixmaps(int)) );
connect( verticalScrollBar(), &QScrollBar::valueChanged, d, &ThumbnailListPrivate::slotRequestVisiblePixmaps );
}
ThumbnailList::~ThumbnailList()
......@@ -601,7 +601,7 @@ void ThumbnailListPrivate::viewportResizeEvent( QResizeEvent * e )
//END widget events
//BEGIN internal SLOTS
void ThumbnailListPrivate::slotRequestVisiblePixmaps( int /*newContentsY*/ )
void ThumbnailListPrivate::slotRequestVisiblePixmaps()
{
// if an update is already scheduled or the widget is hidden, don't proceed
if ( ( m_delayTimer && m_delayTimer->isActive() ) || q->isHidden() )
......@@ -654,7 +654,7 @@ void ThumbnailListPrivate::delayedRequestVisiblePixmaps( int delayMs )
{
m_delayTimer = new QTimer( q );
m_delayTimer->setSingleShot( true );
connect( m_delayTimer, SIGNAL(timeout()), q, SLOT(slotDelayTimeout()) );
connect( m_delayTimer, &QTimer::timeout, this, &ThumbnailListPrivate::slotDelayTimeout );
}
m_delayTimer->start( delayMs );
}
......
......@@ -67,9 +67,6 @@ Q_OBJECT
private:
friend class ThumbnailListPrivate;
ThumbnailListPrivate *d;
Q_PRIVATE_SLOT( d, void slotRequestVisiblePixmaps( int newContentsY = -1 ) )
Q_PRIVATE_SLOT( d, void slotDelayTimeout() )
};
/**
......
......@@ -76,7 +76,7 @@ public:
void setPosterImage( const QImage& );
void takeSnapshot();
void videoStopped();
void stateChanged(Phonon::State, Phonon::State);
void stateChanged(Phonon::State newState);
// slots
void finished();
......@@ -128,8 +128,8 @@ void VideoWidget::Private::load()
player->load( urlFromUrlString( movie->url(), document ) );
connect( player->mediaObject(), SIGNAL( stateChanged( Phonon::State, Phonon::State ) ),
q, SLOT( stateChanged( Phonon::State, Phonon::State ) ) );
connect( player->mediaObject(), &Phonon::MediaObject::stateChanged,
q, [this](Phonon::State s) { stateChanged( s ); } );
seekSlider->setEnabled( true );
}
......@@ -153,7 +153,7 @@ void VideoWidget::Private::takeSnapshot()
const QUrl url = urlFromUrlString( movie->url(), document );
SnapshotTaker *taker = new SnapshotTaker( url, q );
q->connect( taker, SIGNAL( finished( const QImage& ) ), q, SLOT( setPosterImage( const QImage& ) ) );
q->connect( taker, &SnapshotTaker::finished, q, [this]( const QImage &image ) { setPosterImage( image ); } );
}
void VideoWidget::Private::videoStopped()
......@@ -218,7 +218,7 @@ void VideoWidget::Private::setPosterImage( const QImage &image )
posterImagePage->setPixmap( QPixmap::fromImage( image ) );
}
void VideoWidget::Private::stateChanged( Phonon::State newState, Phonon::State )
void VideoWidget::Private::stateChanged( Phonon::State newState )
{
if ( newState == Phonon::PlayingState )
pageLayout->setCurrentIndex( 0 );
......@@ -268,8 +268,8 @@ VideoWidget::VideoWidget( const Okular::Annotation *annotation, Okular::Movie *m
d->controlBar->setVisible( movie->showControls() );
connect( d->player, SIGNAL(finished()), this, SLOT(finished()) );
connect( d->playPauseAction, SIGNAL(triggered()), this, SLOT(playOrPause()) );
connect( d->player, &Phonon::VideoPlayer::finished, this, [this] { d->finished(); } );
connect( d->playPauseAction, &QAction::triggered, this, [this] { d->playOrPause(); } );
d->geom = annotation->transformedBoundingRectangle();
......
......@@ -57,11 +57,6 @@ class VideoWidget : public QWidget
void resizeEvent( QResizeEvent * event ) override;
private:
Q_PRIVATE_SLOT( d, void finished() )
Q_PRIVATE_SLOT( d, void playOrPause() )
Q_PRIVATE_SLOT( d, void setPosterImage( const QImage& ) )
Q_PRIVATE_SLOT( d, void stateChanged( Phonon::State, Phonon::State ) )
// private storage
class Private;
Private *d;
......
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