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
KDevelop
KDevelop
Commits
dc530a28
Commit
dc530a28
authored
Oct 12, 2022
by
Igor Kushnir
Browse files
Extract postErrorMessage()
parent
1494a5cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/heaptrack/plugin.cpp
View file @
dc530a28
...
...
@@ -37,6 +37,14 @@
K_PLUGIN_FACTORY_WITH_JSON
(
HeaptrackFactory
,
"kdevheaptrack.json"
,
registerPlugin
<
Heaptrack
::
Plugin
>
();)
namespace
{
void
postErrorMessage
(
const
QString
&
messageText
)
{
auto
*
const
message
=
new
Sublime
::
Message
(
messageText
,
Sublime
::
Message
::
Error
);
KDevelop
::
ICore
::
self
()
->
uiController
()
->
postMessage
(
message
);
}
}
namespace
Heaptrack
{
...
...
@@ -83,9 +91,7 @@ void Plugin::launchHeaptrack()
executePlugin
=
plugin
->
extension
<
IExecutePlugin
>
();
}
else
{
auto
pluginInfo
=
pluginController
->
infoForPluginId
(
QStringLiteral
(
"kdevexecute"
));
const
QString
messageText
=
i18n
(
"Unable to start Heaptrack analysis -
\"
%1
\"
plugin is not loaded."
,
pluginInfo
.
name
());
auto
*
message
=
new
Sublime
::
Message
(
messageText
,
Sublime
::
Message
::
Error
);
KDevelop
::
ICore
::
self
()
->
uiController
()
->
postMessage
(
message
);
postErrorMessage
(
i18n
(
"Unable to start Heaptrack analysis -
\"
%1
\"
plugin is not loaded."
,
pluginInfo
.
name
()));
return
;
}
...
...
@@ -97,9 +103,7 @@ void Plugin::launchHeaptrack()
// TODO: catch if still no defaultLaunch
if
(
!
defaultLaunch
->
type
()
->
launcherForId
(
QStringLiteral
(
"nativeAppLauncher"
)))
{
const
QString
messageText
=
i18n
(
"Heaptrack analysis can be started only for native applications."
);
auto
*
message
=
new
Sublime
::
Message
(
messageText
,
Sublime
::
Message
::
Error
);
KDevelop
::
ICore
::
self
()
->
uiController
()
->
postMessage
(
message
);
postErrorMessage
(
i18n
(
"Heaptrack analysis can be started only for native applications."
));
return
;
}
...
...
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