Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Plasma
Plasma Add-ons
Commits
eda917eb
Commit
eda917eb
authored
Sep 19, 2020
by
Alexander Lohnau
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify runners using new method
parent
fe86cf62
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
16 deletions
+2
-16
runners/converter/converterrunner.cpp
runners/converter/converterrunner.cpp
+1
-7
runners/converter/converterrunner.h
runners/converter/converterrunner.h
+0
-1
runners/spellchecker/spellcheck.cpp
runners/spellchecker/spellcheck.cpp
+1
-7
runners/spellchecker/spellcheck.h
runners/spellchecker/spellcheck.h
+0
-1
No files found.
runners/converter/converterrunner.cpp
View file @
eda917eb
...
...
@@ -127,19 +127,13 @@ void ConverterRunner::match(Plasma::RunnerContext &context)
}
match
.
setData
(
outputValue
.
number
());
match
.
setRelevance
(
1.0
-
std
::
abs
(
std
::
log10
(
outputValue
.
number
()))
/
50.0
);
match
.
setActions
(
actionList
);
matches
.
append
(
match
);
}
context
.
addMatches
(
matches
);
}
QList
<
QAction
*>
ConverterRunner
::
actionsForMatch
(
const
Plasma
::
QueryMatch
&
match
)
{
Q_UNUSED
(
match
)
return
actionList
;
}
void
ConverterRunner
::
run
(
const
Plasma
::
RunnerContext
&
context
,
const
Plasma
::
QueryMatch
&
match
)
{
Q_UNUSED
(
context
)
...
...
runners/converter/converterrunner.h
View file @
eda917eb
...
...
@@ -41,7 +41,6 @@ public:
~
ConverterRunner
()
override
;
void
match
(
Plasma
::
RunnerContext
&
context
)
override
;
QList
<
QAction
*>
actionsForMatch
(
const
Plasma
::
QueryMatch
&
match
)
override
;
void
run
(
const
Plasma
::
RunnerContext
&
context
,
const
Plasma
::
QueryMatch
&
match
)
override
;
private:
...
...
runners/spellchecker/spellcheck.cpp
View file @
eda917eb
...
...
@@ -245,6 +245,7 @@ void SpellCheckRunner::match(Plasma::RunnerContext &context)
match
.
setType
(
Plasma
::
QueryMatch
::
InformationalMatch
);
match
.
setIconName
(
QStringLiteral
(
"data-error"
));
match
.
setText
(
i18n
(
"No dictionary found, please install hspell"
));
match
.
setActions
(
m_actions
);
context
.
addMatch
(
match
);
}
}
...
...
@@ -256,13 +257,6 @@ void SpellCheckRunner::run(const Plasma::RunnerContext &context, const Plasma::Q
QGuiApplication
::
clipboard
()
->
setText
(
match
.
data
().
toString
());
}
QList
<
QAction
*>
SpellCheckRunner
::
actionsForMatch
(
const
Plasma
::
QueryMatch
&
match
)
{
Q_UNUSED
(
match
)
return
m_actions
;
}
QMimeData
*
SpellCheckRunner
::
mimeDataForMatch
(
const
Plasma
::
QueryMatch
&
match
)
{
QMimeData
*
result
=
new
QMimeData
();
...
...
runners/spellchecker/spellcheck.h
View file @
eda917eb
...
...
@@ -43,7 +43,6 @@ public:
protected
Q_SLOTS
:
void
init
()
override
;
QList
<
QAction
*>
actionsForMatch
(
const
Plasma
::
QueryMatch
&
match
)
override
;
QMimeData
*
mimeDataForMatch
(
const
Plasma
::
QueryMatch
&
match
)
override
;
void
loadData
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment