Skip to content

Commit

Permalink
Drop support for KF5 older than 5.56
Browse files Browse the repository at this point in the history
  • Loading branch information
zrax committed Oct 9, 2024
1 parent d04e068 commit deb52af
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 57 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(Qt5_FOUND AND NOT TARGET Qt::Core)
endforeach()
endif()

find_package(KF${QT_VERSION_MAJOR}SyntaxHighlighting REQUIRED)
find_package(KF${QT_VERSION_MAJOR}SyntaxHighlighting 5.56 REQUIRED)
set_package_properties(KF${QT_VERSION_MAJOR}SyntaxHighlighting PROPERTIES
URL "https://community.kde.org/Frameworks"
DESCRIPTION "Syntax Highlighting framework for Qt${QT_VERSION_MAJOR}"
Expand Down
1 change: 0 additions & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
add_library(syntaxtextedit "")
target_sources(syntaxtextedit
PRIVATE
kf_version.h
syntaxhighlighter.h
syntaxhighlighter.cpp
syntaxtextedit.h
Expand Down
35 changes: 0 additions & 35 deletions lib/kf_version.h

This file was deleted.

8 changes: 7 additions & 1 deletion src/aboutdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QMessageBox>
#include <ksyntaxhighlighting_version.h>

#include "appversion.h"
#include "charsets.h"
#include "kf_version.h"

AboutDialog::AboutDialog(QWidget *parent)
: QDialog(parent)
Expand Down Expand Up @@ -78,7 +78,13 @@ AboutDialog::AboutDialog(QWidget *parent)
"<li>Oxygen Icons</li>"
"</ul>")
.arg(QString::fromLatin1(qVersion()),
#if defined(KSYNTAXHIGHLIGHTING_VERSION)
QStringLiteral(KSYNTAXHIGHLIGHTING_VERSION_STRING),
#elif defined(SyntaxHighlighting_VERSION)
QStringLiteral(SyntaxHighlighting_VERSION),
#else
# error Unsupported <ksyntaxhighlighting_version.h> header format
#endif
TextCodec::icuVersion())
);
libVersions->setMargin(10);
Expand Down
4 changes: 0 additions & 4 deletions src/definitiondownload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

#include "definitiondownload.h"

#ifdef SUPPORT_DEFINITION_DOWNLOADER

#include <QPlainTextEdit>
#include <QDialogButtonBox>
#include <QPushButton>
Expand Down Expand Up @@ -105,5 +103,3 @@ void DefinitionDownloadDialog::closeEvent(QCloseEvent *e)
if (!m_buttonBox->button(QDialogButtonBox::Close)->isEnabled())
e->ignore();
}

#endif // SUPPORT_DEFINITION_DOWNLOADER
6 changes: 0 additions & 6 deletions src/definitiondownload.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
#ifndef QTEXTPAD_DEFINITIONDOWNLOAD_H
#define QTEXTPAD_DEFINITIONDOWNLOAD_H

#include "kf_version.h"

#ifdef SUPPORT_DEFINITION_DOWNLOADER

#include <QDialog>
#include <QElapsedTimer>

Expand Down Expand Up @@ -53,6 +49,4 @@ public Q_SLOTS:
QElapsedTimer m_timer;
};

#endif // SUPPORT_DEFINITION_DOWNLOADER

#endif // QTEXTPAD_DEFINITIONDOWNLOAD_H
7 changes: 0 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@
#include <QStyle>
#endif

#include "kf_version.h"
#include <KSyntaxHighlighting/Repository>
#include <KSyntaxHighlighting/Definition>
#ifdef SUPPORT_DEFINITION_DOWNLOADER
#include <KSyntaxHighlighting/DefinitionDownloader>
#endif

#include "qtextpadwindow.h"
#include "syntaxtextedit.h"
Expand Down Expand Up @@ -133,15 +130,12 @@ int main(int argc, char *argv[])
parser.addOption(encodingOption);
parser.addOption(syntaxOption);

#ifdef SUPPORT_DEFINITION_DOWNLOADER
const QCommandLineOption updateOption(QStringList{QStringLiteral("update-definitions")},
QCoreApplication::translate("main", "Download updated syntax definitions from the internet and exit."));
parser.addOption(updateOption);
#endif

parser.process(app);

#ifdef SUPPORT_DEFINITION_DOWNLOADER
if (parser.isSet(updateOption)) {
// Handle this before any GUI objects are created
KSyntaxHighlighting::Repository syntaxRepo;
Expand All @@ -155,7 +149,6 @@ int main(int argc, char *argv[])
downloader.start();
return QApplication::exec();
}
#endif

setDefaultIconTheme();

Expand Down
2 changes: 0 additions & 2 deletions src/qtextpadwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,6 @@ void QTextPadWindow::populateSyntaxMenu()
connect(item, &QAction::triggered, this, [this, def] { setSyntax(def); });
}

#ifdef SUPPORT_DEFINITION_DOWNLOADER
(void) m_syntaxMenu->addSeparator();
auto updateAction = m_syntaxMenu->addAction(tr("Update Definitions"));
connect(updateAction, &QAction::triggered, this, [this] {
Expand All @@ -1650,7 +1649,6 @@ void QTextPadWindow::populateSyntaxMenu()
downloadDialog->raise();
downloadDialog->activateWindow();
});
#endif
}

void QTextPadWindow::populateThemeMenu()
Expand Down

0 comments on commit deb52af

Please sign in to comment.