rename: drop the last Ollie names; command pack -> DeftCommands
The transient core classes were already deleted in the split, but the shared
command library and a scattering of comments/ids still carried the old project
name. Finish de-Ollie-ing the tree so nothing but 'Deft' remains:
- src/commands: OllieCommands -> DeftCommands; files olliecommands.{h,cpp} ->
deftcommands.{h,cpp}; lib target olliecommands_lib -> deftcommands_lib; tests
test_olliecommands_live/test_ollieregistration -> test_deftcommands_live/
test_deftregistration (ctest names deftcommands_live/deftregistration).
palette plugin updated to match (include, fwd-decl, member type, ctor call,
runVerb call, CMake link).
- Config paths: radial's user config moves olliepalette/radials.json ->
deft/radials.json, matching the switch plugin's earlier olliepalette/ -> deft/
move; comments updated.
- Stale ollie: id prefixes in the project benchmark (ollie:file:/ollie:sym: ->
deft:file:/deft:sym:) and sample paths in test_palettemodel referencing the
deleted src/plugin/ollieplugin.cpp.
- Comments still naming OllieView/OlliePlugin corrected to the real post-split
classes (SamView, PlumbView) or to deft paths.
- README layout refreshed (deftcommands.{h,cpp}).
PLAN.md keeps the Ollie names inside its pre-split historical prose, as flagged
by the architecture note at its top.
Full clean rebuild + 18/18 ctest green; palette and radial reinstalled.
This commit is contained in:
parent
ed3bd4249b
commit
8d06c206bb
|
|
@ -142,7 +142,7 @@ src/
|
||||||
test_*.cpp QTest suites
|
test_*.cpp QTest suites
|
||||||
commands/
|
commands/
|
||||||
texttransforms.{h,cpp} pure text transforms (headless)
|
texttransforms.{h,cpp} pure text transforms (headless)
|
||||||
olliecommands.{h,cpp} ":"-verb KTextEditor::Command pack (used by palette)
|
deftcommands.{h,cpp} ":"-verb KTextEditor::Command pack (used by palette)
|
||||||
test_*.cpp QTest suites
|
test_*.cpp QTest suites
|
||||||
project/
|
project/
|
||||||
projectindex / symbolindex / projectindexer / kateprojectbridge
|
projectindex / symbolindex / projectindexer / kateprojectbridge
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,28 @@
|
||||||
add_library(olliecommands_lib STATIC
|
add_library(deftcommands_lib STATIC
|
||||||
texttransforms.cpp
|
texttransforms.cpp
|
||||||
texttransforms.h
|
texttransforms.h
|
||||||
olliecommands.cpp
|
deftcommands.cpp
|
||||||
olliecommands.h
|
deftcommands.h
|
||||||
)
|
)
|
||||||
target_link_libraries(olliecommands_lib PUBLIC
|
target_link_libraries(deftcommands_lib PUBLIC
|
||||||
Qt6::Core
|
Qt6::Core
|
||||||
KF6::TextEditor
|
KF6::TextEditor
|
||||||
KF6::I18n
|
KF6::I18n
|
||||||
)
|
)
|
||||||
target_include_directories(olliecommands_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(deftcommands_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
if(Qt6Test_FOUND)
|
if(Qt6Test_FOUND)
|
||||||
add_executable(test_texttransforms test_texttransforms.cpp texttransforms.cpp texttransforms.h)
|
add_executable(test_texttransforms test_texttransforms.cpp texttransforms.cpp texttransforms.h)
|
||||||
target_link_libraries(test_texttransforms PRIVATE Qt6::Core Qt6::Test)
|
target_link_libraries(test_texttransforms PRIVATE Qt6::Core Qt6::Test)
|
||||||
add_test(NAME texttransforms COMMAND test_texttransforms)
|
add_test(NAME texttransforms COMMAND test_texttransforms)
|
||||||
|
|
||||||
add_executable(test_olliecommands_live test_olliecommands_live.cpp)
|
add_executable(test_deftcommands_live test_deftcommands_live.cpp)
|
||||||
target_link_libraries(test_olliecommands_live PRIVATE
|
target_link_libraries(test_deftcommands_live PRIVATE
|
||||||
olliecommands_lib Qt6::Test KF6::TextEditor)
|
deftcommands_lib Qt6::Test KF6::TextEditor)
|
||||||
add_test(NAME olliecommands_live COMMAND test_olliecommands_live)
|
add_test(NAME deftcommands_live COMMAND test_deftcommands_live)
|
||||||
|
|
||||||
add_executable(test_ollieregistration test_ollieregistration.cpp)
|
add_executable(test_deftregistration test_deftregistration.cpp)
|
||||||
target_link_libraries(test_ollieregistration PRIVATE
|
target_link_libraries(test_deftregistration PRIVATE
|
||||||
olliecommands_lib Qt6::Test Qt6::Widgets KF6::TextEditor)
|
deftcommands_lib Qt6::Test Qt6::Widgets KF6::TextEditor)
|
||||||
add_test(NAME ollieregistration COMMAND test_ollieregistration)
|
add_test(NAME deftregistration COMMAND test_deftregistration)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||||
*/
|
*/
|
||||||
#include "olliecommands.h"
|
#include "deftcommands.h"
|
||||||
|
|
||||||
#include "texttransforms.h"
|
#include "texttransforms.h"
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace deft
|
||||||
|
|
||||||
using namespace texttransforms;
|
using namespace texttransforms;
|
||||||
|
|
||||||
QStringList OllieCommands::supportedCmds()
|
QStringList DeftCommands::supportedCmds()
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
// NOTE: "sort" is a built-in Kate command. The KTextEditor command
|
// NOTE: "sort" is a built-in Kate command. The KTextEditor command
|
||||||
|
|
@ -38,7 +38,7 @@ QStringList OllieCommands::supportedCmds()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
OllieCommands::OllieCommands(QObject *parent)
|
DeftCommands::DeftCommands(QObject *parent)
|
||||||
: KTextEditor::Command(supportedCmds(), parent)
|
: KTextEditor::Command(supportedCmds(), parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -67,13 +67,13 @@ void applyResult(KTextEditor::View *view, const Target &t, const QString &result
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
bool OllieCommands::exec(KTextEditor::View *view, const QString &cmd, QString &msg,
|
bool DeftCommands::exec(KTextEditor::View *view, const QString &cmd, QString &msg,
|
||||||
const KTextEditor::Range &)
|
const KTextEditor::Range &)
|
||||||
{
|
{
|
||||||
return runVerb(view, cmd, msg);
|
return runVerb(view, cmd, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OllieCommands::runVerb(KTextEditor::View *view, const QString &cmd, QString &msg)
|
bool DeftCommands::runVerb(KTextEditor::View *view, const QString &cmd, QString &msg)
|
||||||
{
|
{
|
||||||
if (!view) {
|
if (!view) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -176,7 +176,7 @@ bool OllieCommands::runVerb(KTextEditor::View *view, const QString &cmd, QString
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OllieCommands::help(KTextEditor::View *, const QString &cmd, QString &msg)
|
bool DeftCommands::help(KTextEditor::View *, const QString &cmd, QString &msg)
|
||||||
{
|
{
|
||||||
const QString verb = cmd.section(QLatin1Char(' '), 0, 0);
|
const QString verb = cmd.section(QLatin1Char(' '), 0, 0);
|
||||||
if (verb == QLatin1String("sort") || verb == QLatin1String("osort")) {
|
if (verb == QLatin1String("sort") || verb == QLatin1String("osort")) {
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||||
*
|
*
|
||||||
* OllieCommands registers a small vocabulary of ":" command-line verbs with
|
* DeftCommands registers a small vocabulary of ":" command-line verbs with
|
||||||
* the editor. Each verb transforms the current selection in place (or the whole
|
* the editor. Each verb transforms the current selection in place (or the whole
|
||||||
* document when nothing is selected). Verbs:
|
* document when nothing is selected). Verbs:
|
||||||
*
|
*
|
||||||
|
|
@ -15,20 +15,20 @@
|
||||||
* pipe <shell> replace the selection with the output of `sh -c <shell>`,
|
* pipe <shell> replace the selection with the output of `sh -c <shell>`,
|
||||||
* feeding the selection on stdin
|
* feeding the selection on stdin
|
||||||
*/
|
*/
|
||||||
#ifndef DEFT_OLLIECOMMANDS_H
|
#ifndef DEFT_DEFTCOMMANDS_H
|
||||||
#define DEFT_OLLIECOMMANDS_H
|
#define DEFT_DEFTCOMMANDS_H
|
||||||
|
|
||||||
#include <KTextEditor/Command>
|
#include <KTextEditor/Command>
|
||||||
|
|
||||||
namespace deft
|
namespace deft
|
||||||
{
|
{
|
||||||
|
|
||||||
class OllieCommands : public KTextEditor::Command
|
class DeftCommands : public KTextEditor::Command
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit OllieCommands(QObject *parent = nullptr);
|
explicit DeftCommands(QObject *parent = nullptr);
|
||||||
|
|
||||||
bool exec(KTextEditor::View *view, const QString &cmd, QString &msg,
|
bool exec(KTextEditor::View *view, const QString &cmd, QString &msg,
|
||||||
const KTextEditor::Range &range = KTextEditor::Range::invalid()) override;
|
const KTextEditor::Range &range = KTextEditor::Range::invalid()) override;
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||||
*
|
*
|
||||||
* Live test: run the ":"-verbs directly (OllieCommands::runVerb) on a real
|
* Live test: run the ":"-verbs directly (DeftCommands::runVerb) on a real
|
||||||
* KTextEditor Document/View and confirm the buffer is mutated. This is the path
|
* KTextEditor Document/View and confirm the buffer is mutated. This is the path
|
||||||
* the command palette uses, independent of the editor's command registry.
|
* the command palette uses, independent of the editor's command registry.
|
||||||
* Requires a (headless) QApplication; run with QT_QPA_PLATFORM=offscreen.
|
* Requires a (headless) QApplication; run with QT_QPA_PLATFORM=offscreen.
|
||||||
*/
|
*/
|
||||||
#include "olliecommands.h"
|
#include "deftcommands.h"
|
||||||
|
|
||||||
#include <KTextEditor/Document>
|
#include <KTextEditor/Document>
|
||||||
#include <KTextEditor/Editor>
|
#include <KTextEditor/Editor>
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
using namespace deft;
|
using namespace deft;
|
||||||
|
|
||||||
class TestOllieCommandsLive : public QObject
|
class TestDeftCommandsLive : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@ private Q_SLOTS:
|
||||||
KTextEditor::Document *doc = nullptr;
|
KTextEditor::Document *doc = nullptr;
|
||||||
KTextEditor::View *v = makeView(QStringLiteral("helloWorld"), doc);
|
KTextEditor::View *v = makeView(QStringLiteral("helloWorld"), doc);
|
||||||
QString msg;
|
QString msg;
|
||||||
QVERIFY2(OllieCommands::runVerb(v, QStringLiteral("case upper"), msg), qPrintable(msg));
|
QVERIFY2(DeftCommands::runVerb(v, QStringLiteral("case upper"), msg), qPrintable(msg));
|
||||||
QCOMPARE(doc->text(), QStringLiteral("HELLOWORLD"));
|
QCOMPARE(doc->text(), QStringLiteral("HELLOWORLD"));
|
||||||
delete v;
|
delete v;
|
||||||
delete doc;
|
delete doc;
|
||||||
|
|
@ -53,7 +53,7 @@ private Q_SLOTS:
|
||||||
KTextEditor::View *v = makeView(QStringLiteral("abc XYZ"), doc);
|
KTextEditor::View *v = makeView(QStringLiteral("abc XYZ"), doc);
|
||||||
v->setSelection(doc->documentRange());
|
v->setSelection(doc->documentRange());
|
||||||
QString msg;
|
QString msg;
|
||||||
QVERIFY(OllieCommands::runVerb(v, QStringLiteral("rot13"), msg));
|
QVERIFY(DeftCommands::runVerb(v, QStringLiteral("rot13"), msg));
|
||||||
QCOMPARE(doc->text(), QStringLiteral("nop KLM"));
|
QCOMPARE(doc->text(), QStringLiteral("nop KLM"));
|
||||||
delete v;
|
delete v;
|
||||||
delete doc;
|
delete doc;
|
||||||
|
|
@ -64,7 +64,7 @@ private Q_SLOTS:
|
||||||
KTextEditor::Document *doc = nullptr;
|
KTextEditor::Document *doc = nullptr;
|
||||||
KTextEditor::View *v = makeView(QStringLiteral("banana\napple\ncherry"), doc);
|
KTextEditor::View *v = makeView(QStringLiteral("banana\napple\ncherry"), doc);
|
||||||
QString msg;
|
QString msg;
|
||||||
QVERIFY(OllieCommands::runVerb(v, QStringLiteral("sort"), msg));
|
QVERIFY(DeftCommands::runVerb(v, QStringLiteral("sort"), msg));
|
||||||
QCOMPARE(doc->text(), QStringLiteral("apple\nbanana\ncherry"));
|
QCOMPARE(doc->text(), QStringLiteral("apple\nbanana\ncherry"));
|
||||||
delete v;
|
delete v;
|
||||||
delete doc;
|
delete doc;
|
||||||
|
|
@ -75,7 +75,7 @@ private Q_SLOTS:
|
||||||
KTextEditor::Document *doc = nullptr;
|
KTextEditor::Document *doc = nullptr;
|
||||||
KTextEditor::View *v = makeView(QString(), doc);
|
KTextEditor::View *v = makeView(QString(), doc);
|
||||||
QString msg;
|
QString msg;
|
||||||
QVERIFY(OllieCommands::runVerb(v, QStringLiteral("uuid"), msg));
|
QVERIFY(DeftCommands::runVerb(v, QStringLiteral("uuid"), msg));
|
||||||
QCOMPARE(doc->text().size(), 36); // 8-4-4-4-12 + 4 hyphens
|
QCOMPARE(doc->text().size(), 36); // 8-4-4-4-12 + 4 hyphens
|
||||||
delete v;
|
delete v;
|
||||||
delete doc;
|
delete doc;
|
||||||
|
|
@ -87,15 +87,15 @@ private Q_SLOTS:
|
||||||
KTextEditor::View *v = makeView(QStringLiteral("hello"), doc);
|
KTextEditor::View *v = makeView(QStringLiteral("hello"), doc);
|
||||||
v->setSelection(doc->documentRange());
|
v->setSelection(doc->documentRange());
|
||||||
QString msg;
|
QString msg;
|
||||||
QVERIFY(OllieCommands::runVerb(v, QStringLiteral("b64enc"), msg));
|
QVERIFY(DeftCommands::runVerb(v, QStringLiteral("b64enc"), msg));
|
||||||
QCOMPARE(doc->text(), QStringLiteral("aGVsbG8="));
|
QCOMPARE(doc->text(), QStringLiteral("aGVsbG8="));
|
||||||
v->setSelection(doc->documentRange());
|
v->setSelection(doc->documentRange());
|
||||||
QVERIFY(OllieCommands::runVerb(v, QStringLiteral("b64dec"), msg));
|
QVERIFY(DeftCommands::runVerb(v, QStringLiteral("b64dec"), msg));
|
||||||
QCOMPARE(doc->text(), QStringLiteral("hello"));
|
QCOMPARE(doc->text(), QStringLiteral("hello"));
|
||||||
delete v;
|
delete v;
|
||||||
delete doc;
|
delete doc;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
QTEST_MAIN(TestOllieCommandsLive)
|
QTEST_MAIN(TestDeftCommandsLive)
|
||||||
#include "test_olliecommands_live.moc"
|
#include "test_deftcommands_live.moc"
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||||
*
|
*
|
||||||
* Verifies that OllieCommands registers its verbs at the global
|
* Verifies that DeftCommands registers its verbs at the global
|
||||||
* KTextEditor::Editor instance so they are reachable from Kate's ":" command
|
* KTextEditor::Editor instance so they are reachable from Kate's ":" command
|
||||||
* line.
|
* line.
|
||||||
*
|
*
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
* silently dropped ALL of our verbs. We now register the sort verb as "osort";
|
* silently dropped ALL of our verbs. We now register the sort verb as "osort";
|
||||||
* this test guards against reintroducing a colliding name.
|
* this test guards against reintroducing a colliding name.
|
||||||
*/
|
*/
|
||||||
#include "olliecommands.h"
|
#include "deftcommands.h"
|
||||||
|
|
||||||
#include <KTextEditor/Command>
|
#include <KTextEditor/Command>
|
||||||
#include <KTextEditor/Editor>
|
#include <KTextEditor/Editor>
|
||||||
|
|
@ -20,13 +20,13 @@
|
||||||
|
|
||||||
using namespace deft;
|
using namespace deft;
|
||||||
|
|
||||||
class TestOllieRegistration : public QObject
|
class TestDeftRegistration : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void verbsRegisterAtGlobalEditor()
|
void verbsRegisterAtGlobalEditor()
|
||||||
{
|
{
|
||||||
auto *cmds = new OllieCommands();
|
auto *cmds = new DeftCommands();
|
||||||
auto *ed = KTextEditor::Editor::instance();
|
auto *ed = KTextEditor::Editor::instance();
|
||||||
QVERIFY(ed);
|
QVERIFY(ed);
|
||||||
|
|
||||||
|
|
@ -53,5 +53,5 @@ private Q_SLOTS:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
QTEST_MAIN(TestOllieRegistration)
|
QTEST_MAIN(TestDeftRegistration)
|
||||||
#include "test_ollieregistration.moc"
|
#include "test_deftregistration.moc"
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||||
*
|
*
|
||||||
* Pure text transforms used by the Ollie ":" command verbs. Kept free of any
|
* Pure text transforms used by the Deft ":" command verbs. Kept free of any
|
||||||
* KTextEditor dependency so they are unit testable in isolation; the command
|
* KTextEditor dependency so they are unit testable in isolation; the command
|
||||||
* glue in olliecommands.cpp feeds them the selection and writes back the result.
|
* glue in deftcommands.cpp feeds them the selection and writes back the result.
|
||||||
*/
|
*/
|
||||||
#ifndef DEFT_TEXTTRANSFORMS_H
|
#ifndef DEFT_TEXTTRANSFORMS_H
|
||||||
#define DEFT_TEXTTRANSFORMS_H
|
#define DEFT_TEXTTRANSFORMS_H
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ target_link_libraries(palette PUBLIC fuzzyranker Qt6::Core Qt6::Gui Qt6::Widgets
|
||||||
target_include_directories(palette PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(palette PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
# The command-palette plugin ([deft:util] palette). Needs KF6::TextEditor; the
|
# The command-palette plugin ([deft:util] palette). Needs KF6::TextEditor; the
|
||||||
# ":"-verb pack comes from olliecommands_lib, the widget/frecency from palette.
|
# ":"-verb pack comes from deftcommands_lib, the widget/frecency from palette.
|
||||||
if(KF6TextEditor_FOUND)
|
if(KF6TextEditor_FOUND)
|
||||||
kcoreaddons_add_plugin(deft_palette
|
kcoreaddons_add_plugin(deft_palette
|
||||||
SOURCES paletteplugin.cpp paletteplugin.h
|
SOURCES paletteplugin.cpp paletteplugin.h
|
||||||
|
|
@ -18,7 +18,7 @@ if(KF6TextEditor_FOUND)
|
||||||
)
|
)
|
||||||
target_link_libraries(deft_palette PRIVATE
|
target_link_libraries(deft_palette PRIVATE
|
||||||
palette
|
palette
|
||||||
olliecommands_lib
|
deftcommands_lib
|
||||||
KF6::TextEditor
|
KF6::TextEditor
|
||||||
KF6::XmlGui
|
KF6::XmlGui
|
||||||
KF6::CoreAddons
|
KF6::CoreAddons
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "palettewidget.h"
|
#include "palettewidget.h"
|
||||||
#include "frecencystore.h"
|
#include "frecencystore.h"
|
||||||
#include "olliecommands.h"
|
#include "deftcommands.h"
|
||||||
|
|
||||||
#include <KTextEditor/Document>
|
#include <KTextEditor/Document>
|
||||||
#include <KTextEditor/MainWindow>
|
#include <KTextEditor/MainWindow>
|
||||||
|
|
@ -75,7 +75,7 @@ PalettePlugin::PalettePlugin(QObject *parent, const QVariantList &args)
|
||||||
{
|
{
|
||||||
Q_UNUSED(args);
|
Q_UNUSED(args);
|
||||||
// The ":"-verb pack registers itself with the global editor on construction.
|
// The ":"-verb pack registers itself with the global editor on construction.
|
||||||
m_commands = new OllieCommands(this);
|
m_commands = new DeftCommands(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
PalettePlugin::~PalettePlugin() = default;
|
PalettePlugin::~PalettePlugin() = default;
|
||||||
|
|
@ -371,13 +371,13 @@ void PaletteView::runAction(const QString &actionId)
|
||||||
recordUsage(actionId);
|
recordUsage(actionId);
|
||||||
|
|
||||||
// A ":"-verb entry: execute the command directly on the active view.
|
// A ":"-verb entry: execute the command directly on the active view.
|
||||||
// We call OllieCommands::runVerb rather than Editor::queryCommand because
|
// We call DeftCommands::runVerb rather than Editor::queryCommand because
|
||||||
// our Command's auto-registration is not reliably visible to queryCommand.
|
// our Command's auto-registration is not reliably visible to queryCommand.
|
||||||
if (actionId.startsWith(kCmdPrefix)) {
|
if (actionId.startsWith(kCmdPrefix)) {
|
||||||
const QString command = actionId.mid(QString(kCmdPrefix).size());
|
const QString command = actionId.mid(QString(kCmdPrefix).size());
|
||||||
if (KTextEditor::View *view = m_mainWindow->activeView()) {
|
if (KTextEditor::View *view = m_mainWindow->activeView()) {
|
||||||
QString msg;
|
QString msg;
|
||||||
OllieCommands::runVerb(view, command, msg);
|
DeftCommands::runVerb(view, command, msg);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ namespace deft
|
||||||
{
|
{
|
||||||
|
|
||||||
class PaletteWidget;
|
class PaletteWidget;
|
||||||
class OllieCommands;
|
class DeftCommands;
|
||||||
|
|
||||||
class PalettePlugin : public KTextEditor::Plugin
|
class PalettePlugin : public KTextEditor::Plugin
|
||||||
{
|
{
|
||||||
|
|
@ -51,7 +51,7 @@ public:
|
||||||
QObject *createView(KTextEditor::MainWindow *mainWindow) override;
|
QObject *createView(KTextEditor::MainWindow *mainWindow) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OllieCommands *m_commands = nullptr; // ":"-verb pack, registered once globally
|
DeftCommands *m_commands = nullptr; // ":"-verb pack, registered once globally
|
||||||
};
|
};
|
||||||
|
|
||||||
class PaletteView : public QObject
|
class PaletteView : public QObject
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ private Q_SLOTS:
|
||||||
{
|
{
|
||||||
PaletteModel m;
|
PaletteModel m;
|
||||||
m.setItems({
|
m.setItems({
|
||||||
{QStringLiteral("a"), QStringLiteral("src/plugin/ollieplugin.cpp"), QString(), 0},
|
{QStringLiteral("a"), QStringLiteral("src/switch/switchplugin.cpp"), QString(), 0},
|
||||||
{QStringLiteral("b"), QStringLiteral("src/palette/palettemodel.cpp"), QString(), 0},
|
{QStringLiteral("b"), QStringLiteral("src/palette/palettemodel.cpp"), QString(), 0},
|
||||||
{QStringLiteral("c"), QStringLiteral("src/main.cpp"), QString(), 0},
|
{QStringLiteral("c"), QStringLiteral("src/main.cpp"), QString(), 0},
|
||||||
});
|
});
|
||||||
|
|
@ -150,7 +150,7 @@ private Q_SLOTS:
|
||||||
{
|
{
|
||||||
PaletteModel m;
|
PaletteModel m;
|
||||||
m.setItems({
|
m.setItems({
|
||||||
{QStringLiteral("a"), QStringLiteral("src/plugin/ollieplugin.cpp"), QString(), 0},
|
{QStringLiteral("a"), QStringLiteral("src/switch/switchplugin.cpp"), QString(), 0},
|
||||||
{QStringLiteral("b"), QStringLiteral("src/palette/palettemodel.cpp"), QString(), 0},
|
{QStringLiteral("b"), QStringLiteral("src/palette/palettemodel.cpp"), QString(), 0},
|
||||||
});
|
});
|
||||||
m.setQuery(QStringLiteral("palette model"));
|
m.setQuery(QStringLiteral("palette model"));
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class PlumbReader; // reader living on its own thread
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Facade used by the plugin. Owns the edit-port reader thread and offers a
|
* Facade used by the plugin. Owns the edit-port reader thread and offers a
|
||||||
* one-shot send(). Construct one per OllieView.
|
* one-shot send(). Construct one per PlumbView.
|
||||||
*/
|
*/
|
||||||
class Plumber : public QObject
|
class Plumber : public QObject
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -109,10 +109,10 @@ int main(int argc, char **argv)
|
||||||
fileItems.reserve(files.size());
|
fileItems.reserve(files.size());
|
||||||
for (const QString &rel : files) {
|
for (const QString &rel : files) {
|
||||||
PaletteItem item;
|
PaletteItem item;
|
||||||
item.id = QStringLiteral("ollie:file:") + rel;
|
item.id = QStringLiteral("deft:file:") + rel;
|
||||||
item.label = buildFileLabel(rel);
|
item.label = buildFileLabel(rel);
|
||||||
item.frecency = frecency.bonus(
|
item.frecency = frecency.bonus(
|
||||||
QStringLiteral("ollie:file:") + root + QLatin1Char('\t') + rel, now);
|
QStringLiteral("deft:file:") + root + QLatin1Char('\t') + rel, now);
|
||||||
fileItems.push_back(item);
|
fileItems.push_back(item);
|
||||||
}
|
}
|
||||||
rs << "files.buildItems_us\t" << t.us() << "\n";
|
rs << "files.buildItems_us\t" << t.us() << "\n";
|
||||||
|
|
@ -160,10 +160,10 @@ int main(int argc, char **argv)
|
||||||
for (const Symbol &s : symbols) {
|
for (const Symbol &s : symbols) {
|
||||||
PaletteItem item;
|
PaletteItem item;
|
||||||
const QString loc = s.file + QLatin1Char('\t') + QString::number(s.line);
|
const QString loc = s.file + QLatin1Char('\t') + QString::number(s.line);
|
||||||
item.id = QStringLiteral("ollie:sym:") + loc;
|
item.id = QStringLiteral("deft:sym:") + loc;
|
||||||
item.label = buildSymbolLabel(s);
|
item.label = buildSymbolLabel(s);
|
||||||
item.frecency = frecency.bonus(
|
item.frecency = frecency.bonus(
|
||||||
QStringLiteral("ollie:sym:") + root + QLatin1Char('\t') + loc, now);
|
QStringLiteral("deft:sym:") + root + QLatin1Char('\t') + loc, now);
|
||||||
symItems.push_back(item);
|
symItems.push_back(item);
|
||||||
}
|
}
|
||||||
rs << "symbols.buildItems_us\t" << t.us() << "\n";
|
rs << "symbols.buildItems_us\t" << t.us() << "\n";
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ struct Symbol {
|
||||||
QString file; // path relative to the project root
|
QString file; // path relative to the project root
|
||||||
int line = 0; // 1-based line number (0 if unknown)
|
int line = 0; // 1-based line number (0 if unknown)
|
||||||
QString kind; // ctags kind long name, e.g. "function", "class"
|
QString kind; // ctags kind long name, e.g. "function", "class"
|
||||||
QString scope; // enclosing scope value, e.g. "OllieCommands" (may be empty)
|
QString scope; // enclosing scope value, e.g. "DeftCommands" (may be empty)
|
||||||
|
|
||||||
bool operator==(const Symbol &o) const
|
bool operator==(const Symbol &o) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ QString RadialConfig::userConfigPath()
|
||||||
{
|
{
|
||||||
const QString cfgDir =
|
const QString cfgDir =
|
||||||
QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
|
QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
|
||||||
return QDir(cfgDir).filePath(QStringLiteral("olliepalette/radials.json"));
|
return QDir(cfgDir).filePath(QStringLiteral("deft/radials.json"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<RadialDef> RadialConfig::loadFile(const QString &path, QString *error)
|
QList<RadialDef> RadialConfig::loadFile(const QString &path, QString *error)
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ public:
|
||||||
static QList<RadialDef> fromJson(const QByteArray &json, QString *error = nullptr);
|
static QList<RadialDef> fromJson(const QByteArray &json, QString *error = nullptr);
|
||||||
|
|
||||||
/*! Standard user config path:
|
/*! Standard user config path:
|
||||||
* `$XDG_CONFIG_HOME/olliepalette/radials.json`. */
|
* `$XDG_CONFIG_HOME/deft/radials.json`. */
|
||||||
static QString userConfigPath();
|
static QString userConfigPath();
|
||||||
|
|
||||||
/*! Read and parse the file at \a path. On any failure (missing, unreadable,
|
/*! Read and parse the file at \a path. On any failure (missing, unreadable,
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ RadialView::~RadialView()
|
||||||
|
|
||||||
void RadialView::setupRadials()
|
void RadialView::setupRadials()
|
||||||
{
|
{
|
||||||
// Prefer the user's config (~/.config/olliepalette/radials.json); fall back
|
// Prefer the user's config (~/.config/deft/radials.json); fall back
|
||||||
// to the built-in set when it is absent, empty, or invalid.
|
// to the built-in set when it is absent, empty, or invalid.
|
||||||
m_radialDefs = RadialConfig::load();
|
m_radialDefs = RadialConfig::load();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Layout: a multi-line command editor on top, a Run button, and a read-only
|
* Layout: a multi-line command editor on top, a Run button, and a read-only
|
||||||
* output/log area below. The widget is pure UI: it emits runRequested() with
|
* output/log area below. The widget is pure UI: it emits runRequested() with
|
||||||
* the program text; OllieView does the document work (snapshot, engine, apply
|
* the program text; SamView does the document work (snapshot, engine, apply
|
||||||
* in an EditingTransaction) and calls showOutput()/showError() to report back.
|
* in an EditingTransaction) and calls showOutput()/showError() to report back.
|
||||||
*/
|
*/
|
||||||
#ifndef DEFT_SAMPANEL_H
|
#ifndef DEFT_SAMPANEL_H
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,7 @@ QList<PaletteItem> SwitchView::buildSymbolItems(const QString &root,
|
||||||
// Label: scope-qualified name, then kind + file as visible provenance.
|
// Label: scope-qualified name, then kind + file as visible provenance.
|
||||||
// The delegate renders only the label and FuzzyRanker scores against it,
|
// The delegate renders only the label and FuzzyRanker scores against it,
|
||||||
// so folding provenance in keeps it both visible and filterable (e.g.
|
// so folding provenance in keeps it both visible and filterable (e.g.
|
||||||
// "method olliecommands" narrows by name and file at once). The name
|
// "method deftcommands" narrows by name and file at once). The name
|
||||||
// leads, so a name hit scores highest and ranks first.
|
// leads, so a name hit scores highest and ranks first.
|
||||||
QString label = s.name;
|
QString label = s.name;
|
||||||
if (!s.scope.isEmpty()) {
|
if (!s.scope.isEmpty()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue