Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@pylaligand
Copy link
Contributor

No description provided.

void App::UpdateProcessLabel() {
std::string label = base_label_;
if (controllers_.size() >= 2) {
label += " (+" + std::to_string(controllers_.size() - 1) + ")";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the label would overflow with the added part, I'd truncate the label to MX_MAX_NAME_LEN - suffix.size() - 3 and then append "..." + suffix. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also do that in the case where controllers_.size() < 2, but obviously suffix would be empty in that case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jinks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@abarth
Copy link
Contributor

abarth commented Jun 23, 2017

LGTM

if (controllers_.size() >= 2) {
label += " (+" + std::to_string(controllers_.size() - 1) + ")";
}
mx::process::self().set_property(MX_PROP_NAME, label.c_str(), label.size());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kernel will truncate the name at MX_MAX_NAME_LEN - 1. Maybe there should be logic to truncate the base_label_ rather that losing the number of additional apps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@pylaligand pylaligand force-pushed the process_names branch 2 times, most recently from 93dd183 to c6ae158 Compare June 23, 2017 17:11
@ianloic
Copy link
Contributor

ianloic commented Jun 23, 2017

LGTM. Do you want to add this logic to //apps/dart_runner too? If not I can copy & paste it myself.

@pylaligand
Copy link
Contributor Author

Go for it :)

@abarth
Copy link
Contributor

abarth commented Jun 23, 2017

LGTM

@pylaligand pylaligand merged commit 8a2d337 into flutter:master Jun 23, 2017
@pylaligand pylaligand deleted the process_names branch June 23, 2017 20:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants