Commit 7a218d72 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Exclude old style connects that can't be ported from clang-format

Otherwise clang-format would mess up the normalized signatures.
parent 999c9ddd
......@@ -460,10 +460,12 @@ void KateFileTreeModel::connectDocument(const KTextEditor::Document *doc)
connect(doc, &KTextEditor::Document::documentNameChanged, this, &KateFileTreeModel::documentNameChanged);
connect(doc, &KTextEditor::Document::documentUrlChanged, this, &KateFileTreeModel::documentNameChanged);
connect(doc, &KTextEditor::Document::modifiedChanged, this, &KateFileTreeModel::documentModifiedChanged);
// clang-format off
connect(doc,
SIGNAL(modifiedOnDisk(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
SIGNAL(modifiedOnDisk(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
this,
SLOT(documentModifiedOnDisc(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
SLOT(documentModifiedOnDisc(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
// clang-format on
}
QModelIndex KateFileTreeModel::docIndex(const KTextEditor::Document *doc) const
......@@ -823,10 +825,12 @@ void KateFileTreeModel::slotAboutToDeleteDocuments(const QList<KTextEditor::Docu
disconnect(doc, &KTextEditor::Document::documentNameChanged, this, &KateFileTreeModel::documentNameChanged);
disconnect(doc, &KTextEditor::Document::documentUrlChanged, this, &KateFileTreeModel::documentNameChanged);
disconnect(doc, &KTextEditor::Document::modifiedChanged, this, &KateFileTreeModel::documentModifiedChanged);
// clang-format off
disconnect(doc,
SIGNAL(modifiedOnDisk(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
SIGNAL(modifiedOnDisk(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
this,
SLOT(documentModifiedOnDisc(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
SLOT(documentModifiedOnDisc(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
// clang-format on
}
}
......
......@@ -626,24 +626,26 @@ void KateBuildView::addMarks(KTextEditor::Document *doc, bool mark)
}
// ensure cleanup
// clang-format off
if (miface) {
auto conn = connect(doc,
SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document *)),
SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document*)),
this,
SLOT(slotInvalidateMoving(KTextEditor::Document *)),
SLOT(slotInvalidateMoving(KTextEditor::Document*)),
Qt::UniqueConnection);
conn = connect(doc,
SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document *)),
SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document*)),
this,
SLOT(slotInvalidateMoving(KTextEditor::Document *)),
SLOT(slotInvalidateMoving(KTextEditor::Document*)),
Qt::UniqueConnection);
}
connect(doc,
SIGNAL(markClicked(KTextEditor::Document *, KTextEditor::Mark, bool &)),
SIGNAL(markClicked(KTextEditor::Document*,KTextEditor::Mark,bool&)),
this,
SLOT(slotMarkClicked(KTextEditor::Document *, KTextEditor::Mark, bool &)),
SLOT(slotMarkClicked(KTextEditor::Document*,KTextEditor::Mark,bool&)),
Qt::UniqueConnection);
// clang-format on
}
void KateBuildView::slotInvalidateMoving(KTextEditor::Document *doc)
......
......@@ -211,7 +211,9 @@ void KateConsole::loadConsoleIfNeeded()
m_part->widget()->show();
connect(m_part, &KParts::ReadOnlyPart::destroyed, this, &KateConsole::slotDestroyed);
connect(m_part, SIGNAL(overrideShortcut(QKeyEvent *, bool &)), this, SLOT(overrideShortcut(QKeyEvent *, bool &)));
// clang-format off
connect(m_part, SIGNAL(overrideShortcut(QKeyEvent*,bool&)), this, SLOT(overrideShortcut(QKeyEvent*,bool&)));
// clang-format on
slotSync();
}
......
......@@ -227,16 +227,18 @@ public:
}
mr = miface->newMovingRange(range);
ranges[doc] = mr;
// clang-format off
connect(doc,
SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document *)),
SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document*)),
this,
SLOT(clear(KTextEditor::Document *)),
SLOT(clear(KTextEditor::Document*)),
Qt::UniqueConnection);
connect(doc,
SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document *)),
SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document*)),
this,
SLOT(clear(KTextEditor::Document *)),
SLOT(clear(KTextEditor::Document*)),
Qt::UniqueConnection);
// clang-format on
}
static KTextEditor::Attribute::Ptr attr;
......@@ -1016,26 +1018,28 @@ public:
}
// ensure runtime match
// clang-format off
connect(doc,
SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document *)),
SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document*)),
this,
SLOT(clearAllMarks(KTextEditor::Document *)),
SLOT(clearAllMarks(KTextEditor::Document*)),
Qt::UniqueConnection);
connect(doc,
SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document *)),
SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document*)),
this,
SLOT(clearAllMarks(KTextEditor::Document *)),
SLOT(clearAllMarks(KTextEditor::Document*)),
Qt::UniqueConnection);
// reload might save/restore marks before/after above signals, so let's clear before that
connect(doc, &KTextEditor::Document::aboutToReload, this, &self_type::clearAllMarks, Qt::UniqueConnection);
if (handleClick) {
connect(doc,
SIGNAL(markClicked(KTextEditor::Document *, KTextEditor::Mark, bool &)),
SIGNAL(markClicked(KTextEditor::Document*,KTextEditor::Mark,bool&)),
this,
SLOT(onMarkClicked(KTextEditor::Document *, KTextEditor::Mark, bool &)),
SLOT(onMarkClicked(KTextEditor::Document*,KTextEditor::Mark,bool&)),
Qt::UniqueConnection);
}
// clang-format on
}
void addMarksRec(KTextEditor::Document *doc, QStandardItem *item, RangeCollection *ranges, DocumentCollection *docs)
......@@ -2100,16 +2104,18 @@ public:
}
// ensure runtime match
// clang-format off
connect(document,
SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document *)),
SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document*)),
this,
SLOT(clearSemanticHighlighting(KTextEditor::Document *)),
SLOT(clearSemanticHighlighting(KTextEditor::Document*)),
Qt::UniqueConnection);
connect(document,
SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document *)),
SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document*)),
this,
SLOT(clearSemanticHighlighting(KTextEditor::Document *)),
SLOT(clearSemanticHighlighting(KTextEditor::Document*)),
Qt::UniqueConnection);
// clang-format on
// TODO: make schema attributes accessible via some new interface,
// or at least add configuration to the lsp plugin config
......
......@@ -150,10 +150,12 @@ public:
// make sure revision is cleared when needed and no longer used (to unlock or otherwise)
// see e.g. implementation in katetexthistory.cpp and assert's in place there
auto conn = connect(doc, SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document *)), this, SLOT(clearRevisions(KTextEditor::Document *)));
// clang-format off
auto conn = connect(doc, SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document*)), this, SLOT(clearRevisions(KTextEditor::Document*)));
Q_ASSERT(conn);
conn = connect(doc, SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document *)), this, SLOT(clearRevisions(KTextEditor::Document *)));
conn = connect(doc, SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document*)), this, SLOT(clearRevisions(KTextEditor::Document*)));
Q_ASSERT(conn);
// clang-format on
m_guards.emplace(doc->url(), doc);
}
......
......@@ -338,12 +338,13 @@ void KateProject::registerDocument(KTextEditor::Document *document)
KateProjectItem *item = itemForFile(document->url().toLocalFile());
// if we got one, we are done, else create a dummy!
// clang-format off
if (item) {
disconnect(document, &KTextEditor::Document::modifiedChanged, this, &KateProject::slotModifiedChanged);
disconnect(document,
SIGNAL(modifiedOnDisk(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
SIGNAL(modifiedOnDisk(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
this,
SLOT(slotModifiedOnDisk(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
SLOT(slotModifiedOnDisk(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
item->slotModifiedChanged(document);
/*FIXME item->slotModifiedOnDisk(document,document->isModified(),qobject_cast<KTextEditor::ModificationInterface*>(document)->modifiedOnDisk());
......@@ -351,12 +352,13 @@ void KateProject::registerDocument(KTextEditor::Document *document)
connect(document, &KTextEditor::Document::modifiedChanged, this, &KateProject::slotModifiedChanged);
connect(document,
SIGNAL(modifiedOnDisk(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
SIGNAL(modifiedOnDisk(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
this,
SLOT(slotModifiedOnDisk(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
SLOT(slotModifiedOnDisk(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
return;
}
// clang-format on
registerUntrackedDocument(document);
}
......@@ -375,10 +377,12 @@ void KateProject::registerUntrackedDocument(KTextEditor::Document *document)
fileItem->setData(document->url().toLocalFile(), Qt::ToolTipRole);
fileItem->slotModifiedChanged(document);
connect(document, &KTextEditor::Document::modifiedChanged, this, &KateProject::slotModifiedChanged);
// clang-format off
connect(document,
SIGNAL(modifiedOnDisk(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
SIGNAL(modifiedOnDisk(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
this,
SLOT(slotModifiedOnDisk(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
SLOT(slotModifiedOnDisk(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
// clang-format on
bool inserted = false;
for (int i = 0; i < m_untrackedDocumentsRoot->rowCount(); ++i) {
......
......@@ -96,7 +96,9 @@ void KateProjectInfoViewTerminal::loadTerminal()
* guard destruction, create new terminal!
*/
connect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &KateProjectInfoViewTerminal::loadTerminal);
connect(m_konsolePart, SIGNAL(overrideShortcut(QKeyEvent *, bool &)), this, SLOT(overrideShortcut(QKeyEvent *, bool &)));
// clang-format off
connect(m_konsolePart, SIGNAL(overrideShortcut(QKeyEvent*,bool&)), this, SLOT(overrideShortcut(QKeyEvent*,bool&)));
// clang-format on
}
void KateProjectInfoViewTerminal::overrideShortcut(QKeyEvent *, bool &override)
......
......@@ -1525,7 +1525,9 @@ void KatePluginSearchView::updateMatchMarks()
return;
}
connect(doc, SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document *)), this, SLOT(clearMarksAndRanges()), Qt::UniqueConnection);
// clang-format off
connect(doc, SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document*)), this, SLOT(clearMarksAndRanges()), Qt::UniqueConnection);
// clang-format on
// Re-add the highlighting on document reload
connect(doc, &KTextEditor::Document::reloaded, this, &KatePluginSearchView::updateMatchMarks, Qt::UniqueConnection);
......
......@@ -85,10 +85,12 @@ KTextEditor::Document *KateDocManager::createDoc(const KateDocumentInfo &docInfo
// connect internal signals...
connect(doc, &KTextEditor::Document::modifiedChanged, this, &KateDocManager::slotModChanged1);
// clang-format off
connect(doc,
SIGNAL(modifiedOnDisk(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
SIGNAL(modifiedOnDisk(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)),
this,
SLOT(slotModifiedOnDisc(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
SLOT(slotModifiedOnDisc(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)));
// clang-format on
// we have a new document, show it the world
emit documentCreated(doc);
......@@ -563,7 +565,9 @@ void KateDocManager::slotModChanged(KTextEditor::Document *doc)
void KateDocManager::slotModChanged1(KTextEditor::Document *doc)
{
QMetaObject::invokeMethod(KateApp::self()->activeKateMainWindow(), "queueModifiedOnDisc", Qt::QueuedConnection, Q_ARG(KTextEditor::Document *, doc));
// clang-format off
QMetaObject::invokeMethod(KateApp::self()->activeKateMainWindow(), "queueModifiedOnDisc", Qt::QueuedConnection, Q_ARG(KTextEditor::Document*,doc));
// clang-format on
}
void KateDocManager::documentOpened()
......
......@@ -447,7 +447,9 @@ KTextEditor::View *KateViewManager::createView(KTextEditor::Document *doc, KateV
delete view->actionCollection()->action(QStringLiteral("set_confdlg"));
delete view->actionCollection()->action(QStringLiteral("editor_options"));
connect(view, SIGNAL(dropEventPass(QDropEvent *)), mainWindow(), SLOT(slotDropEvent(QDropEvent *)));
// clang-format off
connect(view, SIGNAL(dropEventPass(QDropEvent*)), mainWindow(), SLOT(slotDropEvent(QDropEvent*)));
// clang-format on
connect(view, &KTextEditor::View::focusIn, this, &KateViewManager::activateSpace);
viewCreated(view);
......
......@@ -71,7 +71,9 @@ KWrite::KWrite(KTextEditor::Document *doc, KWriteApplication *app)
connect(m_view->document(), &KTextEditor::Document::documentUrlChanged, this, &KWrite::urlChanged);
setAcceptDrops(true);
connect(m_view, SIGNAL(dropEventPass(QDropEvent *)), this, SLOT(slotDropEvent(QDropEvent *)));
// clang-format off
connect(m_view, SIGNAL(dropEventPass(QDropEvent*)), this, SLOT(slotDropEvent(QDropEvent*)));
// clang-format on
setXMLFile(QStringLiteral("kwriteui.rc"));
createShellGUI(true);
......
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