Commit 772ea918 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated method in qt5.15

parent 4f1a80ba
...@@ -90,8 +90,14 @@ KateSQLView::KateSQLView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *m ...@@ -90,8 +90,14 @@ KateSQLView::KateSQLView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *m
connect(m_manager, &SQLManager::queryActivated, this, &KateSQLView::slotQueryActivated); connect(m_manager, &SQLManager::queryActivated, this, &KateSQLView::slotQueryActivated);
connect(m_manager, &SQLManager::connectionCreated, this, &KateSQLView::slotConnectionCreated); connect(m_manager, &SQLManager::connectionCreated, this, &KateSQLView::slotConnectionCreated);
connect(m_manager, &SQLManager::connectionAboutToBeClosed, this, &KateSQLView::slotConnectionAboutToBeClosed); connect(m_manager, &SQLManager::connectionAboutToBeClosed, this, &KateSQLView::slotConnectionAboutToBeClosed);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(m_connectionsComboBox, QOverload<const QString &>::of(&QComboBox::currentIndexChanged), this, &KateSQLView::slotConnectionChanged); connect(m_connectionsComboBox, QOverload<const QString &>::of(&QComboBox::currentIndexChanged), this, &KateSQLView::slotConnectionChanged);
#else
connect(m_connectionsComboBox, QOverload<int, const QString &>::of(&QComboBox::currentIndexChanged), this, [this](int index, const QString &connection) {
Q_UNUSED(index);
slotConnectionChanged(connection);
});
#endif
stateChanged(QStringLiteral("has_connection_selected"), KXMLGUIClient::StateReverse); stateChanged(QStringLiteral("has_connection_selected"), KXMLGUIClient::StateReverse);
} }
......
...@@ -69,7 +69,11 @@ KateDocManager::~KateDocManager() ...@@ -69,7 +69,11 @@ KateDocManager::~KateDocManager()
// purge saved filesessions // purge saved filesessions
if (m_daysMetaInfos > 0) { if (m_daysMetaInfos > 0) {
const QStringList groups = m_metaInfos.groupList(); const QStringList groups = m_metaInfos.groupList();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QDateTime def(QDate(1970, 1, 1)); QDateTime def(QDate(1970, 1, 1));
#else
QDateTime def(QDate(1970, 1, 1).startOfDay());
#endif
for (const auto &group : groups) { for (const auto &group : groups) {
QDateTime last = m_metaInfos.group(group).readEntry("Time", def); QDateTime last = m_metaInfos.group(group).readEntry("Time", def);
if (last.daysTo(QDateTime::currentDateTimeUtc()) > m_daysMetaInfos) { if (last.daysTo(QDateTime::currentDateTimeUtc()) > m_daysMetaInfos) {
......
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