kdeplasma-addons: drop broken dictionary runner

and the fix is that easy

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-07-11 06:37:10 +03:00
parent 9b90a8609f
commit 353a6dbf0c
9 changed files with 0 additions and 438 deletions

View file

@ -4,5 +4,4 @@ add_subdirectory(datetime)
add_subdirectory(katesessions)
add_subdirectory(spellchecker)
add_subdirectory(characters)
add_subdirectory(dictionary)
add_subdirectory(konsolesessions)

View file

@ -1,19 +0,0 @@
set(dictionaryrunner_SRCS dictionaryrunner.cpp)
set(kcm_dictionaryrunner_SRCS dictionaryrunner_config.cpp)
kde4_add_plugin(krunner_dictionary ${dictionaryrunner_SRCS})
kde4_add_plugin(kcm_krunner_dictionary ${kcm_dictionaryrunner_SRCS})
target_link_libraries(krunner_dictionary KDE4::plasma)
target_link_libraries(kcm_krunner_dictionary KDE4::kcmutils)
install(
TARGETS krunner_dictionary kcm_krunner_dictionary
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
)
install(
FILES
plasma-runner-dictionary.desktop
plasma-runner-dictionary_config.desktop
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
)

View file

@ -1,2 +0,0 @@
#! /usr/bin/env bash
$XGETTEXT *.cpp -o $podir/plasma_runner_krunner_dictionary.pot

View file

@ -1,85 +0,0 @@
/*
* Copyright (C) 2010, 2012 Jason A. Donenfeld <Jason@zx2c4.com>
*/
#include "dictionaryrunner.h"
#include "dictionaryrunner_config.h"
#include <QApplication>
#include <QClipboard>
#include <KIcon>
#include <KDebug>
DictionaryRunner::DictionaryRunner(QObject *parent, const QVariantList &args)
: AbstractRunner(parent, args),
m_engine(nullptr)
{
setSpeed(SlowSpeed);
setPriority(LowPriority);
setObjectName(QLatin1String("Dictionary"));
setIgnoredTypes(
Plasma::RunnerContext::Directory | Plasma::RunnerContext::File |
Plasma::RunnerContext::NetworkLocation | Plasma::RunnerContext::Executable |
Plasma::RunnerContext::ShellCommand
);
}
void DictionaryRunner::init()
{
reloadConfiguration();
m_engine = dataEngine("dict");
}
void DictionaryRunner::reloadConfiguration()
{
KConfigGroup c = config();
m_triggerWord = c.readEntry(CONFIG_TRIGGERWORD, i18nc("Trigger word before word to define", "define"));
if (!m_triggerWord.isEmpty()) {
m_triggerWord.append(QLatin1Char(' '));
}
setSyntaxes(
QList<Plasma::RunnerSyntax>()
<< Plasma::RunnerSyntax(Plasma::RunnerSyntax(i18nc("Dictionary keyword", "%1:q:", m_triggerWord), i18n("Finds the definition of :q:."))
)
);
}
void DictionaryRunner::match(Plasma::RunnerContext &context)
{
if (!context.isValid()) {
return;
}
QString query = context.query();
if (!query.startsWith(m_triggerWord, Qt::CaseInsensitive)) {
return;
}
query.remove(0, m_triggerWord.length());
if (query.isEmpty()) {
return;
}
Plasma::DataEngine::Data enginedata = m_engine->query(query);
// qDebug() << Q_FUNC_INFO << query << enginedata;
const QString enginedefinition = enginedata.value("definition").toString();
if (!enginedefinition.isEmpty()) {
const QString engineexample = enginedata.value("example").toString();
Plasma::QueryMatch match(this);
match.setText(enginedefinition);
match.setSubtext(engineexample);
match.setData(enginedefinition);
match.setType(Plasma::QueryMatch::InformationalMatch);
match.setIcon(KIcon(QLatin1String("accessories-dictionary")));
context.addMatch(context.query(), match);
}
}
void DictionaryRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match)
{
Q_UNUSED(context)
const QString data = match.data().toString();
QApplication::clipboard()->setText(data);
}
K_EXPORT_PLASMA_RUNNER(krunner_dictionary, DictionaryRunner)
#include "moc_dictionaryrunner.cpp"

View file

@ -1,29 +0,0 @@
/*
* Copyright (C) 2010, 2012 Jason A. Donenfeld <Jason@zx2c4.com>
*/
#ifndef DICTIONARYRUNNER_H
#define DICTIONARYRUNNER_H
#include <Plasma/AbstractRunner>
#include <Plasma/DataEngine>
class DictionaryRunner : public Plasma::AbstractRunner
{
Q_OBJECT
public:
DictionaryRunner(QObject *parent, const QVariantList &args);
void match(Plasma::RunnerContext &context);
void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match);
void reloadConfiguration();
private:
QString m_triggerWord;
Plasma::DataEngine *m_engine;
protected slots:
void init();
};
#endif // DICTIONARYRUNNER_H

View file

@ -1,50 +0,0 @@
/*
* Copyright (C) 2010, 2012 Jason A. Donenfeld <Jason@zx2c4.com>
*/
#include "dictionaryrunner_config.h"
#include <Plasma/AbstractRunner>
#include <QFormLayout>
#include <QLineEdit>
K_EXPORT_RUNNER_CONFIG(dictionary, DictionaryRunnerConfig)
DictionaryRunnerConfig::DictionaryRunnerConfig(QWidget* parent, const QVariantList& args) :
KCModule(DictionaryRunnerConfigFactory::componentData(), parent, args)
{
QFormLayout *layout = new QFormLayout;
m_triggerWord = new QLineEdit;
layout->addRow(i18n("Trigger Word"), m_triggerWord);
setLayout(layout);
connect(m_triggerWord, SIGNAL(textChanged(QString)), this, SLOT(changed()));
load();
}
void DictionaryRunnerConfig::load()
{
KCModule::load();
KSharedConfig::Ptr cfg = KSharedConfig::openConfig(QLatin1String("krunnerrc"));
KConfigGroup grp = cfg->group("Runners");
grp = KConfigGroup(&grp, "Dictionary");
m_triggerWord->setText(grp.readEntry(CONFIG_TRIGGERWORD, i18nc("Trigger word before word to define", "define")));
emit changed(false);
}
void DictionaryRunnerConfig::save()
{
KCModule::save();
KSharedConfig::Ptr cfg = KSharedConfig::openConfig(QLatin1String("krunnerrc"));
KConfigGroup grp = cfg->group("Runners");
grp = KConfigGroup(&grp, "Dictionary");
grp.writeEntry(CONFIG_TRIGGERWORD, m_triggerWord->text());
emit changed(false);
}
void DictionaryRunnerConfig::defaults()
{
KCModule::defaults();
m_triggerWord->setText(i18nc("Trigger word before word to define", "define"));
emit changed(true);
}
#include "moc_dictionaryrunner_config.cpp"

View file

@ -1,29 +0,0 @@
/*
* Copyright (C) 2010, 2012 Jason A. Donenfeld <Jason@zx2c4.com>
*/
#ifndef DICTIONARYRUNNERCONFIG_H
#define DICTIONARYRUNNERCONFIG_H
#include <KCModule>
#include <QLineEdit>
static const char CONFIG_TRIGGERWORD[] = "triggerWord";
class DictionaryRunnerConfig : public KCModule
{
Q_OBJECT
public:
DictionaryRunnerConfig(QWidget* parent = 0, const QVariantList& args = QVariantList());
public slots:
void save();
void load();
void defaults();
private:
QLineEdit *m_triggerWord;
};
#endif

View file

@ -1,113 +0,0 @@
[Desktop Entry]
Name=Dictionary
Name[ar]=قاموس
Name[ast]=Diccionariu
Name[bs]=rječnik
Name[ca]=Diccionari
Name[ca@valencia]=Diccionari
Name[cs]=Slovník
Name[csb]=Slowôrz
Name[da]=Ordbog
Name[de]=Wörterbuch
Name[el]=Λεξικό
Name[en_GB]=Dictionary
Name[eo]=Vortaro
Name[es]=Diccionario
Name[et]=Sõnaraamat
Name[eu]=Hiztegia
Name[fi]=Sanakirja
Name[fr]=Dictionnaire
Name[ga]=Foclóir
Name[gl]=Dicionario
Name[he]=מילון
Name[hr]=Rječnik
Name[hu]=Szótár
Name[is]=Orðabók
Name[it]=Dizionario
Name[ja]=
Name[kk]=Сөздік
Name[km]=
Name[ko]=
Name[ku]=Ferheng
Name[lt]=Žodynas
Name[lv]=Vārdnīca
Name[mr]=
Name[ms]=Kamus
Name[nb]=Ordbok
Name[nds]=Wöörbook
Name[nl]=Woordenboek
Name[nn]=Ordbok
Name[oc]=Diccionari
Name[pa]=ਿ
Name[pl]=Słownik
Name[pt]=Dicionário
Name[pt_BR]=Dicionário
Name[ro]=Dicționar
Name[ru]=Словарь
Name[sk]=Slovník
Name[sl]=Slovar
Name[sq]=Fjalori
Name[sr]=речник
Name[sr@ijekavian]=рјечник
Name[sr@ijekavianlatin]=rječnik
Name[sr@latin]=rečnik
Name[sv]=Ordlista
Name[th]=
Name[tr]=Sözlük
Name[ug]=لۇغەت
Name[uk]=Словник
Name[wa]=Motî
Name[x-test]=xxDictionaryxx
Name[zh_CN]=
Name[zh_TW]=
Comment=Define words
Comment[ar]=تعريف الكلمات
Comment[bs]=Definipi riječi
Comment[ca]=Defineix mots
Comment[ca@valencia]=Defineix mots
Comment[cs]=Definujte slova
Comment[da]=Definér ord
Comment[de]=Wörter definieren
Comment[el]=Ορισμός λέξεων
Comment[en_GB]=Define words
Comment[es]=Definir palabras
Comment[et]=Sõnade definitsioonid
Comment[fi]=Määrittele sanoja
Comment[fr]=Définir des mots
Comment[ga]=Sainmhínigh focail
Comment[gl]=Definir palabras.
Comment[hu]=Szavak meghatározása
Comment[it]=Definizione delle parole
Comment[kk]=Сөздерді анықтау
Comment[ko]=
Comment[mr]=
Comment[nb]=Definer ord
Comment[nds]=Wöör fastleggen
Comment[nl]=Woorden definiëren
Comment[pl]=Słowa z definicją
Comment[pt]=Definir as palavras
Comment[pt_BR]=Definição de palavras
Comment[ro]=Definește cuvinte
Comment[ru]=Определение слов
Comment[sk]=Definovať slová
Comment[sl]=Definicije besed
Comment[sr]=Дефиниције речи
Comment[sr@ijekavian]=Дефиниције ријечи
Comment[sr@ijekavianlatin]=Definicije riječi
Comment[sr@latin]=Definicije reči
Comment[sv]=Definiera ord
Comment[tr]=Kelime tanımlayın
Comment[uk]=Визначення термінів
Comment[x-test]=xxDefine wordsxx
Comment[zh_CN]=
Comment[zh_TW]=
X-KDE-ServiceTypes=Plasma/Runner
Type=Service
Icon=accessories-dictionary
X-KDE-Library=krunner_dictionary
X-KDE-PluginInfo-Author=Jason A. Donenfeld
X-KDE-PluginInfo-Email=Jason@zx2c4.com
X-KDE-PluginInfo-Name=Dictionary
X-KDE-PluginInfo-Version=1.0
X-KDE-PluginInfo-License=LGPL
X-KDE-PluginInfo-EnabledByDefault=true

View file

@ -1,110 +0,0 @@
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-Library=kcm_krunner_dictionary
X-KDE-ParentComponents=Dictionary
X-KDE-PluginKeyword=kcm_krunner_dictionary
Name=Dictionary
Name[ar]=قاموس
Name[ast]=Diccionariu
Name[bs]=rječnik
Name[ca]=Diccionari
Name[ca@valencia]=Diccionari
Name[cs]=Slovník
Name[csb]=Slowôrz
Name[da]=Ordbog
Name[de]=Wörterbuch
Name[el]=Λεξικό
Name[en_GB]=Dictionary
Name[eo]=Vortaro
Name[es]=Diccionario
Name[et]=Sõnaraamat
Name[eu]=Hiztegia
Name[fi]=Sanakirja
Name[fr]=Dictionnaire
Name[ga]=Foclóir
Name[gl]=Dicionario
Name[he]=מילון
Name[hr]=Rječnik
Name[hu]=Szótár
Name[is]=Orðabók
Name[it]=Dizionario
Name[ja]=
Name[kk]=Сөздік
Name[km]=
Name[ko]=
Name[ku]=Ferheng
Name[lt]=Žodynas
Name[lv]=Vārdnīca
Name[mr]=
Name[ms]=Kamus
Name[nb]=Ordbok
Name[nds]=Wöörbook
Name[nl]=Woordenboek
Name[nn]=Ordbok
Name[oc]=Diccionari
Name[pa]=ਿ
Name[pl]=Słownik
Name[pt]=Dicionário
Name[pt_BR]=Dicionário
Name[ro]=Dicționar
Name[ru]=Словарь
Name[sk]=Slovník
Name[sl]=Slovar
Name[sq]=Fjalori
Name[sr]=речник
Name[sr@ijekavian]=рјечник
Name[sr@ijekavianlatin]=rječnik
Name[sr@latin]=rečnik
Name[sv]=Ordlista
Name[th]=
Name[tr]=Sözlük
Name[ug]=لۇغەت
Name[uk]=Словник
Name[wa]=Motî
Name[x-test]=xxDictionaryxx
Name[zh_CN]=
Name[zh_TW]=
Comment=Define words
Comment[ar]=تعريف الكلمات
Comment[bs]=Definipi riječi
Comment[ca]=Defineix mots
Comment[ca@valencia]=Defineix mots
Comment[cs]=Definujte slova
Comment[da]=Definér ord
Comment[de]=Wörter definieren
Comment[el]=Ορισμός λέξεων
Comment[en_GB]=Define words
Comment[es]=Definir palabras
Comment[et]=Sõnade definitsioonid
Comment[fi]=Määrittele sanoja
Comment[fr]=Définir des mots
Comment[ga]=Sainmhínigh focail
Comment[gl]=Definir palabras.
Comment[hu]=Szavak meghatározása
Comment[it]=Definizione delle parole
Comment[kk]=Сөздерді анықтау
Comment[ko]=
Comment[mr]=
Comment[nb]=Definer ord
Comment[nds]=Wöör fastleggen
Comment[nl]=Woorden definiëren
Comment[pl]=Słowa z definicją
Comment[pt]=Definir as palavras
Comment[pt_BR]=Definição de palavras
Comment[ro]=Definește cuvinte
Comment[ru]=Определение слов
Comment[sk]=Definovať slová
Comment[sl]=Definicije besed
Comment[sr]=Дефиниције речи
Comment[sr@ijekavian]=Дефиниције ријечи
Comment[sr@ijekavianlatin]=Definicije riječi
Comment[sr@latin]=Definicije reči
Comment[sv]=Definiera ord
Comment[tr]=Kelime tanımlayın
Comment[uk]=Визначення термінів
Comment[x-test]=xxDefine wordsxx
Comment[zh_CN]=
Comment[zh_TW]=