FreeBSD Bugzilla – Attachment 231557 Details for
Bug 261719
textproc/kf5-syntax-highlighting: Not discoverable with cmake
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
test-KSyntaxHighlighting.shar
test-KSyntaxHighlighting.shar (text/plain), 2.22 KB, created by
Yuri Victorovich
on 2022-02-04 19:50:39 UTC
(
hide
)
Description:
test-KSyntaxHighlighting.shar
Filename:
MIME Type:
Creator:
Yuri Victorovich
Created:
2022-02-04 19:50:39 UTC
Size:
2.22 KB
patch
obsolete
># This is a shell archive. Save it in a file, remove anything before ># this line, and then unpack it by entering "sh file". Note, it may ># create directories; files and directories will be owned by you and ># have default permissions. ># ># This archive contains: ># ># test-KSyntaxHighlighting ># test-KSyntaxHighlighting/CMakeLists.txt ># test-KSyntaxHighlighting/main.cpp ># >echo c - test-KSyntaxHighlighting >mkdir -p test-KSyntaxHighlighting > /dev/null 2>&1 >echo x - test-KSyntaxHighlighting/CMakeLists.txt >sed 's/^X//' >test-KSyntaxHighlighting/CMakeLists.txt << 'af61a9afdac1a1a171008a754dc62f0a' >Xcmake_minimum_required (VERSION 3.22.1) >Xproject (X) >X >Xfind_package(Qt5 COMPONENTS Core Widgets REQUIRED) >Xfind_package(KF5SyntaxHighlighting REQUIRED) >X >Xadd_executable(minimal main.cpp) >Xtarget_link_libraries(minimal Qt5::Widgets KF5SyntaxHighlighting) >af61a9afdac1a1a171008a754dc62f0a >echo x - test-KSyntaxHighlighting/main.cpp >sed 's/^X//' >test-KSyntaxHighlighting/main.cpp << 'a80240a2b405156d0462e0f796a96d8c' >X#include <QApplication> >X#include <QCommandLineParser> >X#include <QDebug> >X#include <QPlainTextEdit> >X >X#include <definition.h> >X#include <foldingregion.h> >X#include <repository.h> >X#include <syntaxhighlighter.h> >X#include <theme.h> >X >Xint main(int argc, char **argv) >X{ >X QApplication app(argc, argv); >X >X QCommandLineParser parser; >X parser.addHelpOption(); >X parser.addPositionalArgument(QStringLiteral("source"), QStringLiteral("The source file to highlight.")); >X parser.process(app); >X >X KSyntaxHighlighting::Repository repository; >X for (const QString &file : parser.positionalArguments()) { >X const auto url = QUrl::fromUserInput(file, {}, QUrl::UserInputResolutionOption::AssumeLocalFile); >X QFile f(url.toLocalFile()); >X if (!f.open(QIODevice::ReadOnly)) >X continue; >X >X auto view = new QPlainTextEdit(); >X view->setPlainText(QString::fromUtf8(f.readAll())); >X view->resize(500, 500); >X >X auto highlighter = new KSyntaxHighlighting::SyntaxHighlighter(view->document()); >X highlighter->setDefinition(repository.definitionForFileName(url.toLocalFile())); >X >X view->show(); >X } >X >X return app.exec(); >X} >a80240a2b405156d0462e0f796a96d8c >exit >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 261719
: 231557