Commit 30bde6d4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated method in qt5.15

parent 5b5c32aa
......@@ -118,7 +118,11 @@ ConfigView::ConfigView(QWidget *parent, KTextEditor::MainWindow *mainWin)
m_advanced->hide();
connect(m_targetCombo, &QComboBox::editTextChanged, this, &ConfigView::slotTargetEdited);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(m_targetCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &ConfigView::slotTargetSelected);
#else
connect(m_targetCombo, static_cast<void (QComboBox::*)(int, const QString &)>(&QComboBox::currentIndexChanged) , this, &ConfigView::slotTargetSelected);
#endif
connect(m_addTarget, &QToolButton::clicked, this, &ConfigView::slotAddTarget);
connect(m_copyTarget, &QToolButton::clicked, this, &ConfigView::slotCopyTarget);
connect(m_deleteTarget, &QToolButton::clicked, this, &ConfigView::slotDeleteTarget);
......
......@@ -81,7 +81,7 @@ void DebugView::runDebugger(const GDBTargetConf &conf, const QStringList &ioFifo
connect(&m_debugProcess, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, &DebugView::slotDebugFinished);
m_debugProcess.start(m_targetConf.gdbCmd);
m_debugProcess.start(m_targetConf.gdbCmd, QStringList());
m_nextCommands << QStringLiteral("set pagination off");
m_state = ready;
......
......@@ -137,7 +137,11 @@ KatePluginGDBView::KatePluginGDBView(KTextEditor::Plugin *plugin, KTextEditor::M
m_stackTree->setAutoScroll(false);
connect(m_stackTree, &QTreeWidget::itemActivated, this, &KatePluginGDBView::stackFrameSelected);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(m_threadCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &KatePluginGDBView::threadSelected);
#else
connect(m_threadCombo, static_cast<void (QComboBox::*)(int, const QString &)>(&QComboBox::currentIndexChanged) , this, &KatePluginGDBView::threadSelected);
#endif
m_localsView = new LocalsView();
......
......@@ -220,7 +220,7 @@ void KateCTagsConfigPage::updateGlobalDB()
}
QString command = QStringLiteral("%1 -f %2 %3").arg(m_confUi.cmdEdit->text(), file, targets);
m_proc.start(command);
m_proc.start(command, QStringList());
if (!m_proc.waitForStarted(500)) {
KMessageBox::error(nullptr, i18n("Failed to run \"%1\". exitStatus = %2", command, m_proc.exitStatus()));
......
......@@ -516,7 +516,7 @@ void KateCTagsView::updateSessionDB()
QString command = QStringLiteral("%1 -f %2 %3").arg(m_ctagsUi.cmdEdit->text(), m_ctagsUi.tagsFile->text(), targets);
m_proc.start(command);
m_proc.start(command, QStringList());
if (!m_proc.waitForStarted(500)) {
KMessageBox::error(nullptr, i18n("Failed to run \"%1\". exitStatus = %2", command, m_proc.exitStatus()));
......
......@@ -67,7 +67,11 @@ KateProjectInfoViewCodeAnalysis::KateProjectInfoViewCodeAnalysis(KateProjectPlug
* Connect selection change callback
* and attach model to code analysis selector
*/
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(m_toolSelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &KateProjectInfoViewCodeAnalysis::slotToolSelectionChanged);
#else
connect(m_toolSelector, static_cast<void (QComboBox::*)(int, const QString &)>(&QComboBox::currentIndexChanged) , this, &KateProjectInfoViewCodeAnalysis::slotToolSelectionChanged);
#endif
m_toolSelector->setModel(KateProjectCodeAnalysisSelector::model(this));
/**
......
......@@ -83,7 +83,11 @@ KateProjectPluginView::KateProjectPluginView(KateProjectPlugin *plugin, KTextEdi
m_stackedProjectViews = new QStackedWidget(m_toolView);
m_stackedProjectInfoViews = new QStackedWidget(m_toolInfoView);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(m_projectsCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &KateProjectPluginView::slotCurrentChanged);
#else
connect(m_projectsCombo, static_cast<void (QComboBox::*)(int, const QString &)>(&QComboBox::currentIndexChanged) , this, &KateProjectPluginView::slotCurrentChanged);
#endif
connect(m_reloadButton, &QToolButton::clicked, this, &KateProjectPluginView::slotProjectReload);
/**
......
......@@ -418,8 +418,16 @@ KatePluginSearchView::KatePluginSearchView(KTextEditor::Plugin *plugin, KTextEdi
connect(m_ui.searchButton, &QPushButton::clicked, this, &KatePluginSearchView::startSearch);
connect(m_ui.displayOptions, &QToolButton::toggled, this, &KatePluginSearchView::toggleOptions);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(m_ui.searchPlaceCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &KatePluginSearchView::searchPlaceChanged);
#else
connect(m_ui.searchPlaceCombo, static_cast<void (QComboBox::*)(int, const QString &)>(&QComboBox::currentIndexChanged) , this, &KatePluginSearchView::searchPlaceChanged);
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(m_ui.searchPlaceCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this](int) {
#else
connect(m_ui.searchPlaceCombo, static_cast<void (QComboBox::*)(int, const QString &)>(&QComboBox::currentIndexChanged) , this, [this](int) {
#endif
if (m_ui.searchPlaceCombo->currentIndex() == Folder) {
m_ui.displayOptions->setChecked(true);
}
......
......@@ -162,7 +162,11 @@ KateConfigDialog::KateConfigDialog(KateMainWindow *parent, KTextEditor::View *vi
m_cmbQuickOpenMatchMode->addItem(i18n("Filepath"), QVariant(KateQuickOpenModel::Columns::FilePath));
m_cmbQuickOpenMatchMode->setCurrentIndex(m_cmbQuickOpenMatchMode->findData(m_mainWindow->quickOpenMatchMode()));
m_mainWindow->setQuickOpenMatchMode(m_cmbQuickOpenMatchMode->currentData().toInt());
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(m_cmbQuickOpenMatchMode, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &KateConfigDialog::slotChanged);
#else
connect(m_cmbQuickOpenMatchMode, static_cast<void (QComboBox::*)(int, const QString &)>(&QComboBox::currentIndexChanged) , this, &KateConfigDialog::slotChanged);
#endif
vbox->addLayout(hlayout);
// quick open list mode
hlayout = new QHBoxLayout;
......@@ -175,7 +179,11 @@ KateConfigDialog::KateConfigDialog(KateMainWindow *parent, KTextEditor::View *vi
m_cmbQuickOpenListMode->addItem(i18n("All Projects Files"), QVariant(KateQuickOpenModel::List::AllProjects));
m_cmbQuickOpenListMode->setCurrentIndex(m_cmbQuickOpenListMode->findData(m_mainWindow->quickOpenListMode()));
m_mainWindow->setQuickOpenListMode(static_cast<KateQuickOpenModel::List>(m_cmbQuickOpenListMode->currentData().toInt()));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(m_cmbQuickOpenListMode, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &KateConfigDialog::slotChanged);
#else
connect(m_cmbQuickOpenListMode, static_cast<void (QComboBox::*)(int, const QString &)>(&QComboBox::currentIndexChanged) , this, &KateConfigDialog::slotChanged);
#endif
vbox->addLayout(hlayout);
layout->addWidget(buttonGroup);
......
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