Commit 11aebe48 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Clean up defunct KNS3::UploadDialog usage

parent 7e16075b
......@@ -105,13 +105,6 @@ 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);
addAction(separator);
......@@ -155,10 +148,6 @@ void SnippetView::validateActions()
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);
m_removeSnippetAction->setEnabled(selectedSnippet);
......@@ -220,10 +209,6 @@ 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));
}
}
......@@ -353,27 +338,6 @@ 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();
if (!item) {
return;
}
SnippetRepository *repo = dynamic_cast<SnippetRepository *>(item);
if (!repo) {
return;
}
KNS3::UploadDialog dialog(QStringLiteral(":/katesnippets/ktexteditor_codesnippets_core.knsrc"), this);
dialog.setUploadFile(QUrl::fromLocalFile(repo->file()));
dialog.setUploadName(repo->text());
dialog.exec();
}
#endif
bool SnippetView::eventFilter(QObject *obj, QEvent *e)
{
// no, listening to activated() is not enough since that would also trigger the edit mode which we _dont_ want here
......
......@@ -81,13 +81,6 @@ 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
void validateActions();
......@@ -108,9 +101,6 @@ private:
QAction *m_removeSnippetAction;
QAction *m_editSnippetAction;
QAction *m_getNewStuffAction;
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
QAction *m_putNewStuffAction;
#endif
};
#endif
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