Commit dda6dc54 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated methods

parent 5056e68c
Pipeline #73576 passed with stage
in 8 minutes and 39 seconds
find_package(KF5KIO ${KF5_DEP_VERSION} QUIET)
find_package(KF5KBookmarks ${KF5_DEP_VERSION} QUIET)
set_package_properties(KF5KIO PROPERTIES PURPOSE "Required to build the filebrowser addon")
if(NOT KF5KIO_FOUND)
......@@ -14,6 +15,7 @@ target_link_libraries(
KF5::I18n
KF5::TextEditor
KF5::KIOFileWidgets
KF5::Bookmarks
)
target_sources(
......
......@@ -12,6 +12,7 @@
#include <KBookmarkManager>
#include <KBookmarkMenu>
#include <KBookmarkOwner>
class KateFileBrowser;
class QMenu;
......
......@@ -99,7 +99,7 @@ KatePluginGDBView::KatePluginGDBView(KTextEditor::Plugin *plugin, KTextEditor::M
// input
m_inputArea = new KHistoryComboBox(true);
connect(m_inputArea, static_cast<void (KHistoryComboBox::*)()>(&KHistoryComboBox::returnPressed), this, &KatePluginGDBView::slotSendCommand);
connect(m_inputArea, static_cast<void (KHistoryComboBox::*)(const QString &)>(&KHistoryComboBox::returnPressed), this, &KatePluginGDBView::slotSendCommand);
QHBoxLayout *inputLayout = new QHBoxLayout();
inputLayout->addWidget(m_inputArea, 10);
inputLayout->setContentsMargins(0, 0, 0, 0);
......
......@@ -83,7 +83,7 @@ KateSQLView::KateSQLView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *m
connect(m_manager, &SQLManager::queryActivated, this, &KateSQLView::slotQueryActivated);
connect(m_manager, &SQLManager::connectionCreated, this, &KateSQLView::slotConnectionCreated);
connect(m_manager, &SQLManager::connectionAboutToBeClosed, this, &KateSQLView::slotConnectionAboutToBeClosed);
connect(m_connectionsComboBox, QOverload<const QString &>::of(&QComboBox::currentIndexChanged), this, &KateSQLView::slotConnectionChanged);
connect(m_connectionsComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &KateSQLView::slotConnectionChanged);
stateChanged(QStringLiteral("has_connection_selected"), KXMLGUIClient::StateReverse);
}
......@@ -177,11 +177,14 @@ void KateSQLView::slotConnectionSelectedFromMenu(QAction *action)
m_connectionsComboBox->setCurrentItem(action->text());
}
void KateSQLView::slotConnectionChanged(const QString &connection)
void KateSQLView::slotConnectionChanged(int index)
{
stateChanged(QStringLiteral("has_connection_selected"), (connection.isEmpty()) ? KXMLGUIClient::StateReverse : KXMLGUIClient::StateNoReverse);
if (index >= 0) {
const QString connection = m_connectionsComboBox->itemText(index);
stateChanged(QStringLiteral("has_connection_selected"), (connection.isEmpty()) ? KXMLGUIClient::StateReverse : KXMLGUIClient::StateNoReverse);
m_schemaBrowserWidget->schemaWidget()->buildTree(connection);
m_schemaBrowserWidget->schemaWidget()->buildTree(connection);
}
}
void KateSQLView::slotGlobalSettingsChanged()
......
......@@ -54,7 +54,7 @@ public Q_SLOTS:
void slotConnectionEdit();
void slotConnectionRemove();
void slotConnectionReconnect();
void slotConnectionChanged(const QString &connection);
void slotConnectionChanged(int currentIndex);
void slotRunQuery();
void slotError(const QString &message);
void slotSuccess(const QString &message);
......
......@@ -422,8 +422,8 @@ KatePluginSearchView::KatePluginSearchView(KTextEditor::Plugin *plugin, KTextEdi
connect(m_ui.searchCombo->lineEdit(), &QLineEdit::returnPressed, this, &KatePluginSearchView::startSearch);
// connecting to returnPressed() of the folderRequester doesn't work, I haven't found out why yet. But connecting to the linedit works:
connect(m_ui.folderRequester->comboBox()->lineEdit(), &QLineEdit::returnPressed, this, &KatePluginSearchView::startSearch);
connect(m_ui.filterCombo, static_cast<void (KComboBox::*)()>(&KComboBox::returnPressed), this, &KatePluginSearchView::startSearch);
connect(m_ui.excludeCombo, static_cast<void (KComboBox::*)()>(&KComboBox::returnPressed), this, &KatePluginSearchView::startSearch);
connect(m_ui.filterCombo, static_cast<void (KComboBox::*)(const QString &)>(&KComboBox::returnPressed), this, &KatePluginSearchView::startSearch);
connect(m_ui.excludeCombo, static_cast<void (KComboBox::*)(const QString &)>(&KComboBox::returnPressed), this, &KatePluginSearchView::startSearch);
connect(m_ui.searchButton, &QPushButton::clicked, this, &KatePluginSearchView::startSearch);
connect(m_ui.displayOptions, &QToolButton::toggled, this, &KatePluginSearchView::toggleOptions);
......
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