Commit 903abee6 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

fix compile with Qt6

kate.git now fully compiles with current state of KF5 & Qt6
parent 91b8395b
Pipeline #154880 failed with stage
in 1 minute and 11 seconds
......@@ -105,10 +105,12 @@ SnippetView::SnippetView(KateSnippetGlobal *plugin, KTextEditor::MainWindow *mai
const bool newStuffAllowed = KAuthorized::authorize(QStringLiteral("ghns"));
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
m_putNewStuffAction = new QAction(QIcon::fromTheme(QStringLiteral("get-hot-new-stuff")), i18n("Publish Repository"), this);
m_putNewStuffAction->setVisible(newStuffAllowed);
connect(m_putNewStuffAction, &QAction::triggered, this, &SnippetView::slotSnippetToGHNS);
addAction(m_putNewStuffAction);
#endif
QAction *separator = new QAction(this);
separator->setSeparator(true);
......@@ -152,7 +154,10 @@ void SnippetView::validateActions()
m_addRepoAction->setEnabled(true);
m_editRepoAction->setEnabled(selectedRepo);
m_removeRepoAction->setEnabled(selectedRepo);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
m_putNewStuffAction->setEnabled(selectedRepo);
#endif
m_addSnippetAction->setEnabled(selectedRepo || selectedSnippet);
m_editSnippetAction->setEnabled(selectedSnippet);
......@@ -214,7 +219,10 @@ void SnippetView::contextMenu(const QPoint &pos)
menu.addAction(m_editRepoAction);
menu.addAction(m_removeRepoAction);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
menu.addAction(m_putNewStuffAction);
#endif
menu.exec(snippetTree->mapToGlobal(pos));
}
......@@ -345,6 +353,8 @@ void SnippetView::slotGHNS()
}
}
// will need complete re-implementation, API missing
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
void SnippetView::slotSnippetToGHNS()
{
QStandardItem *item = currentItem();
......@@ -362,6 +372,7 @@ void SnippetView::slotSnippetToGHNS()
dialog.setUploadName(repo->text());
dialog.exec();
}
#endif
bool SnippetView::eventFilter(QObject *obj, QEvent *e)
{
......
......@@ -81,10 +81,12 @@ private Q_SLOTS:
*/
void slotGHNS();
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
/**
* Slot to put the selected snippet to GHNS
*/
void slotSnippetToGHNS();
#endif
void contextMenu(const QPoint &pos);
/// disables or enables available actions based on the currently selected item
......@@ -106,7 +108,9 @@ private:
QAction *m_removeSnippetAction;
QAction *m_editSnippetAction;
QAction *m_getNewStuffAction;
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
QAction *m_putNewStuffAction;
#endif
};
#endif
......@@ -104,10 +104,10 @@ void KatePluginSymbolViewerView::parsePhpSymbols(void)
lineWithliterals = line;
// reduce literals to empty strings to not match comments separators in literals
line.replace(literalRegExp, QLatin1String("\\1\\1"));
line = literalRegExp.replaceIn(line, QLatin1String("\\1\\1"));
// kdDebug(13000) << debugBuffer.arg(i, 4).arg("-literals", 10).arg(line);
line.remove(blockCommentInline);
line = blockCommentInline.removeIn(line);
// kdDebug(13000) << debugBuffer.arg(i, 4).arg("-comments", 10).arg(line);
// trying to find comments and to remove commented parts
......
......@@ -361,7 +361,7 @@ bool PluginKateXMLCheckView::slotValidate()
// and needs to be ignored then):
QRegExp re("<!--.*-->");
re.setMinimal(true);
text_start.remove(re);
text_start = re.removeIn(text_start);
QRegExp re_doctype("<!DOCTYPE\\s+(.*)\\s+(?:PUBLIC\\s+[\"'].*[\"']\\s+[\"'](.*)[\"']|SYSTEM\\s+[\"'](.*)[\"'])", Qt::CaseInsensitive);
re_doctype.setMinimal(true);
......
Supports Markdown
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