Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.1:Update
kile5
0020-Use-more-functor-based-signal-slot-connect...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0020-Use-more-functor-based-signal-slot-connections-in-Ki.patch of Package kile5
From 3e585a06492e852781be53f126b717cc7feb2fcf Mon Sep 17 00:00:00 2001 From: Michel Ludwig <michel.ludwig@kdemail.net> Date: Sun, 28 Oct 2018 19:32:12 +0100 Subject: [PATCH 20/35] Use more functor-based signal/slot connections in 'KileDocument::Manager::createDocument' --- src/kiledocmanager.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/kiledocmanager.cpp b/src/kiledocmanager.cpp index 1d67a6b6..610a9034 100644 --- a/src/kiledocmanager.cpp +++ b/src/kiledocmanager.cpp @@ -561,15 +561,11 @@ KTextEditor::Document* Manager::createDocument(const QUrl &url, TextInfo *docinf } //handle changes of the document - connect(doc, SIGNAL(documentNameChanged(KTextEditor::Document*)), this, SIGNAL(documentNameChanged(KTextEditor::Document*))); - connect(doc, SIGNAL(documentUrlChanged(KTextEditor::Document*)), this, SIGNAL(documentUrlChanged(KTextEditor::Document*))); - if(doc->metaObject()->indexOfSignal(QMetaObject::normalizedSignature("readWriteChanged(KTextEditor::Document*)")) >= 0) { - // signal available in KDE 4.10 - connect(doc, SIGNAL(readWriteChanged(KTextEditor::Document*)), - this, SIGNAL(documentReadWriteStateChanged(KTextEditor::Document*))); - } + connect(doc, &KTextEditor::Document::documentNameChanged, this, &KileDocument::Manager::documentNameChanged); + connect(doc, &KTextEditor::Document::documentUrlChanged, this, &KileDocument::Manager::documentUrlChanged); + connect(doc, &KTextEditor::Document::readWriteChanged, this, &KileDocument::Manager::documentReadWriteStateChanged); - connect(doc, SIGNAL(modifiedChanged(KTextEditor::Document*)), this, SLOT(newDocumentStatus(KTextEditor::Document*))); + connect(doc, &KTextEditor::Document::modifiedChanged, this, &KileDocument::Manager::newDocumentStatus); KTextEditor::ModificationInterface *modificationInterface = qobject_cast<KTextEditor::ModificationInterface*>(doc); if(modificationInterface) { modificationInterface->setModifiedOnDiskWarning(true); @@ -583,9 +579,15 @@ KTextEditor::Document* Manager::createDocument(const QUrl &url, TextInfo *docinf if(!highlight.isEmpty()) { docinfo->setHighlightingMode(highlight); } - // FIXME: the whole structure updating stuff needs to be rewritten; updates should originate from - // the docinfo only, i.e. the structure view should just react to changes! - connect(docinfo, SIGNAL(completed(KileDocument::Info*)), m_ki->structureWidget(), SLOT(update(KileDocument::Info*))); + + { + // FIXME: the whole structure updating stuff needs to be rewritten; updates should originate from + // the docinfo only, i.e. the structure view should just react to changes! + + // small 'trick' to select the right overloaded slot: + void (KileWidget::StructureWidget::*slot)(KileDocument::Info *) = &KileWidget::StructureWidget::update; + connect(docinfo, &KileDocument::Info::completed, m_ki->structureWidget(), slot); + } KILE_DEBUG_MAIN << "createDocument: url " << doc->url(); KILE_DEBUG_MAIN << "createDocument: SANITY check: " << (docinfo->getDoc() == docFor(docinfo->url())); -- 2.20.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor