Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
72cebd84
Commit
72cebd84
authored
Jun 15, 2020
by
Alexander Lohnau
💬
Browse files
Cleanup runners
parent
73f96c83
Changes
19
Hide whitespace changes
Inline
Side-by-side
runners/appstream/appstreamrunner.cpp
View file @
72cebd84
...
...
@@ -37,9 +37,7 @@ K_EXPORT_PLASMA_RUNNER(installer, InstallerRunner)
InstallerRunner
::
InstallerRunner
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
AbstractRunner
(
parent
,
args
)
{
Q_UNUSED
(
args
)
setObjectName
(
"Installation Suggestions"
);
setObjectName
(
QStringLiteral
(
"Installation Suggestions"
));
setPriority
(
AbstractRunner
::
HighestPriority
);
addSyntax
(
Plasma
::
RunnerSyntax
(
":q:"
,
i18n
(
"Looks for non-installed components according to :q:"
)));
...
...
runners/bookmarks/bookmarksrunner.cpp
View file @
72cebd84
...
...
@@ -43,9 +43,7 @@ K_EXPORT_PLASMA_RUNNER(bookmarksrunner, BookmarksRunner)
BookmarksRunner
::
BookmarksRunner
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
AbstractRunner
(
parent
,
args
),
m_browser
(
nullptr
),
m_browserFactory
(
new
BrowserFactory
(
this
))
{
Q_UNUSED
(
args
)
//qDebug() << "Creating BookmarksRunner";
setObjectName
(
QStringLiteral
(
"Bookmarks"
));
setObjectName
(
QStringLiteral
(
"Bookmarks"
));
addSyntax
(
Plasma
::
RunnerSyntax
(
QStringLiteral
(
":q:"
),
i18n
(
"Finds web browser bookmarks matching :q:."
)));
setDefaultSyntax
(
Plasma
::
RunnerSyntax
(
i18nc
(
"list of all web browser bookmarks"
,
"bookmarks"
),
i18n
(
"List all web browser bookmarks"
)));
...
...
@@ -53,10 +51,7 @@ BookmarksRunner::BookmarksRunner( QObject* parent, const QVariantList &args )
connect
(
this
,
&
Plasma
::
AbstractRunner
::
prepare
,
this
,
&
BookmarksRunner
::
prep
);
}
BookmarksRunner
::~
BookmarksRunner
()
{
}
BookmarksRunner
::~
BookmarksRunner
()
=
default
;
void
BookmarksRunner
::
prep
()
{
...
...
@@ -69,11 +64,8 @@ void BookmarksRunner::prep()
m_browser
->
prepare
();
}
void
BookmarksRunner
::
match
(
Plasma
::
RunnerContext
&
context
)
{
if
(
!
m_browser
)
return
;
const
QString
term
=
context
.
query
();
if
((
term
.
length
()
<
3
)
&&
(
!
context
.
singleRunnerQueryMode
()))
{
return
;
...
...
runners/bookmarks/browserfactory.cpp
View file @
72cebd84
...
...
@@ -26,9 +26,9 @@
#include
"browsers/chromefindprofile.h"
#include
"browsers/chrome.h"
Browser
*
BrowserFactory
::
find
(
const
QString
&
browserName
,
QObject
*
parent
)
Browser
*
BrowserFactory
::
find
(
const
QString
&
browserName
,
QObject
*
parent
)
{
if
(
m_previousBrowserName
==
browserName
)
{
if
(
m_previousBrowserName
==
browserName
)
{
return
m_previousBrowser
;
}
delete
m_previousBrowser
;
...
...
runners/bookmarks/fetchsqlite.cpp
View file @
72cebd84
...
...
@@ -45,10 +45,9 @@ void FetchSqlite::prepare()
void
FetchSqlite
::
teardown
()
{
QString
connectionPrefix
=
m_databaseFile
+
"-"
;
const
QString
connectionPrefix
=
m_databaseFile
+
"-"
;
const
auto
connections
=
QSqlDatabase
::
connectionNames
();
for
(
auto
c
:
connections
)
{
for
(
const
auto
&
c
:
connections
)
{
if
(
c
.
startsWith
(
connectionPrefix
))
{
qCDebug
(
RUNNER_BOOKMARKS
)
<<
"Closing connection"
<<
c
;
QSqlDatabase
::
removeDatabase
(
c
);
...
...
runners/calculator/calculatorrunner.cpp
View file @
72cebd84
...
...
@@ -36,21 +36,17 @@
#include
<KLocalizedString>
#include
<krunner/querymatch.h>
static
const
QString
s_copyToClipboardId
=
QStringLiteral
(
"copyToClipboard"
);
K_EXPORT_PLASMA_RUNNER
(
calculatorrunner
,
CalculatorRunner
)
CalculatorRunner
::
CalculatorRunner
(
QObject
*
parent
,
const
QVariantList
&
args
)
CalculatorRunner
::
CalculatorRunner
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
AbstractRunner
(
parent
,
args
)
{
Q_UNUSED
(
args
)
#ifdef ENABLE_QALCULATE
m_engine
=
new
QalculateEngine
;
setSpeed
(
SlowSpeed
);
#endif
setObjectName
(
QStringLiteral
(
"Calculator"
));
setObjectName
(
QStringLiteral
(
"Calculator"
));
setIgnoredTypes
(
Plasma
::
RunnerContext
::
Directory
|
Plasma
::
RunnerContext
::
File
|
Plasma
::
RunnerContext
::
NetworkLocation
|
Plasma
::
RunnerContext
::
Executable
|
Plasma
::
RunnerContext
::
ShellCommand
);
...
...
@@ -61,7 +57,7 @@ CalculatorRunner::CalculatorRunner( QObject* parent, const QVariantList &args )
addSyntax
(
Plasma
::
RunnerSyntax
(
QStringLiteral
(
"=:q:"
),
description
));
addSyntax
(
Plasma
::
RunnerSyntax
(
QStringLiteral
(
":q:="
),
description
));
addAction
(
s_
copyToClipboard
Id
,
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-copy"
)),
i18n
(
"Copy to Clipboard"
));
addAction
(
QStringLiteral
(
"
copyToClipboard
"
)
,
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-copy"
)),
i18n
(
"Copy to Clipboard"
));
}
CalculatorRunner
::~
CalculatorRunner
()
...
...
@@ -71,7 +67,7 @@ CalculatorRunner::~CalculatorRunner()
#endif
}
void
CalculatorRunner
::
powSubstitutions
(
QString
&
cmd
)
void
CalculatorRunner
::
powSubstitutions
(
QString
&
cmd
)
{
if
(
cmd
.
contains
(
QLatin1String
(
"e+"
),
Qt
::
CaseInsensitive
))
{
cmd
.
replace
(
QLatin1String
(
"e+"
),
QLatin1String
(
"*10^"
),
Qt
::
CaseInsensitive
);
...
...
@@ -328,8 +324,8 @@ QString CalculatorRunner::calculate(const QString& term, bool *isApproximate)
void
CalculatorRunner
::
run
(
const
Plasma
::
RunnerContext
&
context
,
const
Plasma
::
QueryMatch
&
match
)
{
Q_UNUSED
(
context
)
;
if
(
match
.
selectedAction
()
==
action
(
s_copyToClipboardId
)
)
{
Q_UNUSED
(
context
)
if
(
match
.
selectedAction
())
{
#ifdef ENABLE_QALCULATE
m_engine
->
copyToClipboard
();
#else
...
...
@@ -342,7 +338,7 @@ QList<QAction *> CalculatorRunner::actionsForMatch(const Plasma::QueryMatch &mat
{
Q_UNUSED
(
match
)
return
{
action
(
s_copyToClipboardId
)}
;
return
action
s
().
values
()
;
}
QMimeData
*
CalculatorRunner
::
mimeDataForMatch
(
const
Plasma
::
QueryMatch
&
match
)
...
...
runners/calculator/calculatorrunner.h
View file @
72cebd84
...
...
@@ -36,7 +36,7 @@ class CalculatorRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
CalculatorRunner
(
QObject
*
parent
,
const
QVariantList
&
args
);
CalculatorRunner
(
QObject
*
parent
,
const
QVariantList
&
args
);
~
CalculatorRunner
()
override
;
void
match
(
Plasma
::
RunnerContext
&
context
)
override
;
...
...
@@ -47,10 +47,10 @@ class CalculatorRunner : public Plasma::AbstractRunner
QMimeData
*
mimeDataForMatch
(
const
Plasma
::
QueryMatch
&
match
)
override
;
private:
QString
calculate
(
const
QString
&
term
,
bool
*
isApproximate
);
void
userFriendlySubstitutions
(
QString
&
cmd
);
void
powSubstitutions
(
QString
&
cmd
);
void
hexSubstitutions
(
QString
&
cmd
);
QString
calculate
(
const
QString
&
term
,
bool
*
isApproximate
);
void
userFriendlySubstitutions
(
QString
&
cmd
);
void
powSubstitutions
(
QString
&
cmd
);
void
hexSubstitutions
(
QString
&
cmd
);
#ifdef ENABLE_QALCULATE
QalculateEngine
*
m_engine
;
...
...
runners/calculator/qalculate_engine.cpp
View file @
72cebd84
...
...
@@ -40,7 +40,6 @@ QAtomicInt QalculateEngine::s_counter;
QalculateEngine
::
QalculateEngine
(
QObject
*
parent
)
:
QObject
(
parent
)
{
m_lastResult
=
""
;
s_counter
.
ref
();
if
(
!
CALCULATOR
)
{
new
Calculator
();
...
...
@@ -66,7 +65,7 @@ void QalculateEngine::updateExchangeRates()
QUrl
dest
=
QUrl
::
fromLocalFile
(
QFile
::
decodeName
(
CALCULATOR
->
getExchangeRatesFileName
().
c_str
()));
KIO
::
Job
*
getJob
=
KIO
::
file_copy
(
source
,
dest
,
-
1
,
KIO
::
Overwrite
|
KIO
::
HideProgressInfo
);
connect
(
getJob
,
&
KJob
::
result
,
this
,
&
QalculateEngine
::
updateResult
);
connect
(
getJob
,
&
KJob
::
result
,
this
,
&
QalculateEngine
::
updateResult
);
}
void
QalculateEngine
::
updateResult
(
KJob
*
job
)
...
...
@@ -79,10 +78,10 @@ void QalculateEngine::updateResult(KJob* job)
}
}
QString
QalculateEngine
::
evaluate
(
const
QString
&
expression
,
bool
*
isApproximate
)
QString
QalculateEngine
::
evaluate
(
const
QString
&
expression
,
bool
*
isApproximate
)
{
if
(
expression
.
isEmpty
())
{
return
""
;
return
QString
()
;
}
QString
input
=
expression
;
...
...
runners/calculator/qalculate_engine.h
View file @
72cebd84
...
...
@@ -35,7 +35,7 @@ public:
QString
lastResult
()
const
{
return
m_lastResult
;
}
public
Q_SLOTS
:
QString
evaluate
(
const
QString
&
expression
,
bool
*
isApproximate
=
nullptr
);
QString
evaluate
(
const
QString
&
expression
,
bool
*
isApproximate
=
nullptr
);
void
updateExchangeRates
();
void
copyToClipboard
(
bool
flag
=
true
);
...
...
runners/kill/killrunner_config.cpp
View file @
72cebd84
...
...
@@ -88,7 +88,7 @@ void KillRunnerConfig::defaults()
m_ui
->
triggerWord
->
setText
(
i18n
(
"kill"
));
m_ui
->
sorting
->
setCurrentIndex
(
m_ui
->
sorting
->
findData
((
int
)
NONE
));
emit
markAsChanged
();
markAsChanged
();
}
#include
"killrunner_config.moc"
runners/locations/locationrunner.cpp
View file @
72cebd84
...
...
@@ -38,7 +38,6 @@ K_EXPORT_PLASMA_RUNNER(locations, LocationsRunner)
LocationsRunner
::
LocationsRunner
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
AbstractRunner
(
parent
,
args
)
{
Q_UNUSED
(
args
);
// set the name shown after the result in krunner window
setObjectName
(
QStringLiteral
(
"Locations"
));
setIgnoredTypes
(
Plasma
::
RunnerContext
::
Executable
|
Plasma
::
RunnerContext
::
ShellCommand
);
...
...
@@ -183,9 +182,6 @@ void LocationsRunner::run(const Plasma::RunnerContext &context, const Plasma::Qu
location
=
convertCaseInsensitivePath
(
location
);
//qDebug() << "command: " << context.query();
//qDebug() << "url: " << location << data;
QUrl
urlToRun
(
KUriFilter
::
self
()
->
filteredUri
(
location
,
{
QStringLiteral
(
"kshorturifilter"
)}));
new
KRun
(
urlToRun
,
nullptr
);
...
...
runners/places/placesrunner.cpp
View file @
72cebd84
...
...
@@ -36,9 +36,7 @@ K_EXPORT_PLASMA_RUNNER(placesrunner, PlacesRunner)
PlacesRunner
::
PlacesRunner
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
AbstractRunner
(
parent
,
args
)
{
// qRegisterMetaType
Q_UNUSED
(
args
)
setObjectName
(
QStringLiteral
(
"Places"
));
setObjectName
(
QStringLiteral
(
"Places"
));
Plasma
::
RunnerSyntax
defaultSyntax
(
i18n
(
"places"
),
i18n
(
"Lists all file manager locations"
));
setDefaultSyntax
(
defaultSyntax
);
addSyntax
(
defaultSyntax
);
...
...
runners/powerdevil/PowerDevilRunner.cpp
View file @
72cebd84
...
...
@@ -40,7 +40,7 @@ PowerDevilRunner::PowerDevilRunner(QObject *parent, const QVariantList &args)
{
qDBusRegisterMetaType
<
StringStringMap
>
();
setObjectName
(
QLatin1String
(
"PowerDevil"
));
setObjectName
(
QStringLiteral
(
"PowerDevil"
));
setIgnoredTypes
(
Plasma
::
RunnerContext
::
Directory
|
Plasma
::
RunnerContext
::
File
|
Plasma
::
RunnerContext
::
NetworkLocation
|
Plasma
::
RunnerContext
::
Help
);
updateStatus
();
...
...
runners/recentdocuments/recentdocuments.cpp
View file @
72cebd84
...
...
@@ -38,17 +38,14 @@ using namespace KActivities::Stats::Terms;
K_EXPORT_PLASMA_RUNNER
(
recentdocuments
,
RecentDocuments
)
static
const
QString
s_openParentDirId
=
QStringLiteral
(
"openParentDir"
);
RecentDocuments
::
RecentDocuments
(
QObject
*
parent
,
const
QVariantList
&
args
)
RecentDocuments
::
RecentDocuments
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
AbstractRunner
(
parent
,
args
)
{
Q_UNUSED
(
args
);
setObjectName
(
QStringLiteral
(
"Recent Documents"
));
setObjectName
(
QStringLiteral
(
"Recent Documents"
));
addSyntax
(
Plasma
::
RunnerSyntax
(
QStringLiteral
(
":q:"
),
i18n
(
"Looks for documents recently used with names matching :q:."
)));
addAction
(
s_
openParentDir
Id
,
QIcon
::
fromTheme
(
QStringLiteral
(
"document-open-folder"
)),
i18n
(
"Open Containing Folder"
));
addAction
(
QStringLiteral
(
"
openParentDir
"
)
,
QIcon
::
fromTheme
(
QStringLiteral
(
"document-open-folder"
)),
i18n
(
"Open Containing Folder"
));
}
RecentDocuments
::~
RecentDocuments
()
...
...
@@ -72,11 +69,11 @@ void RecentDocuments::match(Plasma::RunnerContext &context)
|
Agent
::
any
()
// we search only on file name, as KActivity does not support better options
|
Url
(
"/*/"
+
term
+
"*"
)
|
Limit
(
3
0
);
|
Limit
(
2
0
);
const
auto
result
=
new
ResultModel
(
query
);
for
(
int
i
=
0
;
i
<
result
->
rowCount
();
i
++
)
{
for
(
int
i
=
0
;
i
<
result
->
rowCount
();
++
i
)
{
const
auto
index
=
result
->
index
(
i
,
0
);
const
auto
url
=
QUrl
::
fromUserInput
(
result
->
data
(
index
,
ResultModel
::
ResourceRole
).
toString
(),
...
...
@@ -92,7 +89,7 @@ void RecentDocuments::match(Plasma::RunnerContext &context)
if
(
url
.
fileName
()
==
term
)
{
relevance
=
1.0
;
match
.
setType
(
Plasma
::
QueryMatch
::
ExactMatch
);
}
else
if
(
url
.
fileName
().
startsWith
(
term
))
{
}
else
if
(
url
.
fileName
().
startsWith
(
term
))
{
relevance
=
0.9
;
match
.
setType
(
Plasma
::
QueryMatch
::
PossibleMatch
);
}
...
...
@@ -114,7 +111,7 @@ void RecentDocuments::run(const Plasma::RunnerContext &context, const Plasma::Qu
const
QUrl
url
=
match
.
data
().
toUrl
();
if
(
match
.
selectedAction
()
==
action
(
s_openParentDirId
)
)
{
if
(
match
.
selectedAction
())
{
KIO
::
highlightInFileManager
({
url
});
return
;
}
...
...
@@ -125,17 +122,12 @@ void RecentDocuments::run(const Plasma::RunnerContext &context, const Plasma::Qu
QList
<
QAction
*>
RecentDocuments
::
actionsForMatch
(
const
Plasma
::
QueryMatch
&
match
)
{
Q_UNUSED
(
match
)
QList
<
QAction
*>
actions
;
const
QUrl
url
=
match
.
data
().
toUrl
();
if
(
url
.
isLocalFile
())
{
actions
<<
action
(
s_openParentDirId
);
return
actions
().
values
(
);
}
return
actions
;
return
{}
;
}
QMimeData
*
RecentDocuments
::
mimeDataForMatch
(
const
Plasma
::
QueryMatch
&
match
)
...
...
runners/services/autotests/servicerunnertest.cpp
View file @
72cebd84
...
...
@@ -51,7 +51,8 @@ void ServiceRunnerTest::initTestCase()
QDir
(
appsPath
).
removeRecursively
();
QVERIFY
(
QDir
().
mkpath
(
appsPath
));
auto
fixtureDir
=
QDir
(
QFINDTESTDATA
(
"fixtures"
));
for
(
auto
fileInfo
:
fixtureDir
.
entryInfoList
(
QDir
::
Files
))
{
const
auto
infoList
=
fixtureDir
.
entryInfoList
(
QDir
::
Files
);
for
(
const
auto
&
fileInfo
:
infoList
)
{
auto
source
=
fileInfo
.
absoluteFilePath
();
auto
target
=
appsPath
+
QDir
::
separator
()
+
fileInfo
.
fileName
();
QVERIFY2
(
QFile
::
copy
(
fileInfo
.
absoluteFilePath
(),
target
),
...
...
@@ -82,7 +83,8 @@ void ServiceRunnerTest::testChromeAppsRelevance()
bool
chromeFound
=
false
;
bool
signalFound
=
false
;
for
(
auto
match
:
context
.
matches
())
{
const
auto
matches
=
context
.
matches
();
for
(
const
auto
&
match
:
matches
)
{
qDebug
()
<<
"matched"
<<
match
.
text
();
if
(
!
match
.
text
().
contains
(
QLatin1String
(
"ServiceRunnerTest"
)))
{
continue
;
...
...
@@ -112,7 +114,8 @@ void ServiceRunnerTest::testKonsoleVsYakuakeComment()
bool
konsoleFound
=
false
;
bool
yakuakeFound
=
false
;
for
(
auto
match
:
context
.
matches
())
{
const
auto
matches
=
context
.
matches
();
for
(
const
auto
&
match
:
matches
)
{
qDebug
()
<<
"matched"
<<
match
.
text
();
if
(
!
match
.
text
().
contains
(
QLatin1String
(
"ServiceRunnerTest"
)))
{
continue
;
...
...
@@ -146,7 +149,8 @@ void ServiceRunnerTest::testSystemSettings()
bool
systemSettingsFound
=
false
;
bool
foreignSystemSettingsFound
=
false
;
for
(
auto
match
:
context
.
matches
())
{
const
auto
matches
=
context
.
matches
();
for
(
const
auto
&
match
:
matches
)
{
qDebug
()
<<
"matched"
<<
match
.
text
();
if
(
match
.
text
()
==
QLatin1String
(
"System Settings ServiceRunnerTest"
))
{
systemSettingsFound
=
true
;
...
...
runners/services/servicerunner.cpp
View file @
72cebd84
...
...
@@ -404,9 +404,7 @@ private:
ServiceRunner
::
ServiceRunner
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
AbstractRunner
(
parent
,
args
)
{
Q_UNUSED
(
args
)
setObjectName
(
QStringLiteral
(
"Application"
));
setObjectName
(
QStringLiteral
(
"Application"
));
setPriority
(
AbstractRunner
::
HighestPriority
);
addSyntax
(
Plasma
::
RunnerSyntax
(
QStringLiteral
(
":q:"
),
i18n
(
"Finds applications whose name or description match :q:"
)));
...
...
@@ -416,10 +414,7 @@ ServiceRunner::~ServiceRunner() = default;
QStringList
ServiceRunner
::
categories
()
const
{
QStringList
cat
;
cat
<<
i18n
(
"Applications"
)
<<
i18n
(
"System Settings"
);
return
cat
;
return
{
i18n
(
"Applications"
),
i18n
(
"System Settings"
)};
}
QIcon
ServiceRunner
::
categoryIcon
(
const
QString
&
category
)
const
...
...
@@ -444,7 +439,7 @@ void ServiceRunner::match(Plasma::RunnerContext &context)
void
ServiceRunner
::
run
(
const
Plasma
::
RunnerContext
&
context
,
const
Plasma
::
QueryMatch
&
match
)
{
Q_UNUSED
(
context
)
;
Q_UNUSED
(
context
)
const
QUrl
dataUrl
=
match
.
data
().
toUrl
();
...
...
runners/sessions/sessionrunner.cpp
View file @
72cebd84
...
...
@@ -32,7 +32,7 @@ K_EXPORT_PLASMA_RUNNER(calculatorrunner, SessionRunner)
SessionRunner
::
SessionRunner
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
AbstractRunner
(
parent
,
args
)
{
setObjectName
(
QLatin1String
(
"Sessions"
));
setObjectName
(
QStringLiteral
(
"Sessions"
));
setPriority
(
LowPriority
);
setIgnoredTypes
(
Plasma
::
RunnerContext
::
Directory
|
Plasma
::
RunnerContext
::
File
|
Plasma
::
RunnerContext
::
NetworkLocation
);
...
...
runners/webshortcuts/webshortcutrunner.cpp
View file @
72cebd84
...
...
@@ -27,7 +27,6 @@ WebshortcutRunner::WebshortcutRunner(QObject *parent, const QVariantList& args)
:
Plasma
::
AbstractRunner
(
parent
,
args
),
m_match
(
this
),
m_filterBeforeRun
(
false
)
{
Q_UNUSED
(
args
);
setObjectName
(
QStringLiteral
(
"Web Shortcut"
));
setIgnoredTypes
(
Plasma
::
RunnerContext
::
Directory
|
Plasma
::
RunnerContext
::
File
|
Plasma
::
RunnerContext
::
Executable
);
...
...
runners/windowedwidgets/windowedwidgetsrunner.cpp
View file @
72cebd84
...
...
@@ -36,9 +36,7 @@ K_EXPORT_PLASMA_RUNNER(windowedwidgets, WindowedWidgetsRunner)
WindowedWidgetsRunner
::
WindowedWidgetsRunner
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
AbstractRunner
(
parent
,
args
)
{
Q_UNUSED
(
args
)
setObjectName
(
QLatin1String
(
"WindowedWidgets"
));
setObjectName
(
QStringLiteral
(
"WindowedWidgets"
));
setPriority
(
AbstractRunner
::
HighestPriority
);
addSyntax
(
Plasma
::
RunnerSyntax
(
QStringLiteral
(
":q:"
),
i18n
(
"Finds Plasma widgets whose name or description match :q:"
)));
...
...
runners/windows/windowsrunner.cpp
View file @
72cebd84
...
...
@@ -39,8 +39,7 @@ WindowsRunner::WindowsRunner(QObject* parent, const QVariantList& args)
:
AbstractRunner
(
parent
,
args
),
m_inSession
(
false
)
{
Q_UNUSED
(
args
)
setObjectName
(
QLatin1String
(
"Windows"
)
);
setObjectName
(
QStringLiteral
(
"Windows"
));
addSyntax
(
Plasma
::
RunnerSyntax
(
QStringLiteral
(
":q:"
),
i18n
(
"Finds windows whose name, window class or window role match :q:. "
"It is possible to interact with the windows by using one of the following keywords: "
...
...
@@ -125,14 +124,14 @@ void WindowsRunner::matchSessionComplete()
// Called in the secondary thread
void
WindowsRunner
::
match
(
Plasma
::
RunnerContext
&
context
)
{
// will run block as long as gatherInfo has not finished
QMutexLocker
locker
(
&
m_mutex
);
QString
term
=
context
.
query
();
if
(
!
context
.
singleRunnerQueryMode
()
&&
(
term
.
length
()
<
3
))
{
return
;
}
// will run block as long as gatherInfo has not finished
QMutexLocker
locker
(
&
m_mutex
);
QList
<
Plasma
::
QueryMatch
>
matches
;
// check if the search term ends with an action keyword
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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