New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

menubar: handle nil Name in .desktop files #83

Merged
merged 1 commit into from Jan 23, 2015

Conversation

Projects
None yet
4 participants
@roysc-zz
Contributor

roysc-zz commented Jan 20, 2015

Fixes erroring out on gsub() call, which propagated to a nil result from menu_gen.generate()

@roysc-zz

This comment has been minimized.

Show comment
Hide comment
@roysc-zz

roysc-zz Jan 20, 2015

Contributor

Although the vast majority of desktop files have a Name, this would result in nameless menu entries for those that don't, but I'm not sure there's a much better solution.

Contributor

roysc-zz commented Jan 20, 2015

Although the vast majority of desktop files have a Name, this would result in nameless menu entries for those that don't, but I'm not sure there's a much better solution.

@blueyed

This comment has been minimized.

Show comment
Hide comment
@blueyed

blueyed Jan 20, 2015

Member

Using [no name] or [unnamed] might be better.

Where/how did you came across it?

Member

blueyed commented Jan 20, 2015

Using [no name] or [unnamed] might be better.

Where/how did you came across it?

@roysc-zz

This comment has been minimized.

Show comment
Hide comment
@roysc-zz

roysc-zz Jan 20, 2015

Contributor

When I tried to open the menubar, it failed with an error about a non
string argument to gsub. So it failed to generate the menu items, and
after that, the menubar fails with a nil argument to ipairs at
menubar/init.lua:152.

On 01/20/2015 03:29 PM, Daniel Hahler wrote:

Using |[no name]| or |[unnamed]| might be better.

Where/how did you came across it?


Reply to this email directly or view it on GitHub
#83 (comment).

Contributor

roysc-zz commented Jan 20, 2015

When I tried to open the menubar, it failed with an error about a non
string argument to gsub. So it failed to generate the menu items, and
after that, the menubar fails with a nil argument to ipairs at
menubar/init.lua:152.

On 01/20/2015 03:29 PM, Daniel Hahler wrote:

Using |[no name]| or |[unnamed]| might be better.

Where/how did you came across it?


Reply to this email directly or view it on GitHub
#83 (comment).

@blueyed

This comment has been minimized.

Show comment
Hide comment
@blueyed

blueyed Jan 20, 2015

Member

Ok. I was just curious about which desktop file might have caused it.

I think using the basename of file, with .desktop removed, in brackets, might be a good fallback.

So for /foo/bar/awesome.desktop without a Name, it would use [awesome].

Member

blueyed commented Jan 20, 2015

Ok. I was just curious about which desktop file might have caused it.

I think using the basename of file, with .desktop removed, in brackets, might be a good fallback.

So for /foo/bar/awesome.desktop without a Name, it would use [awesome].

@roysc-zz

This comment has been minimized.

Show comment
Hide comment
@roysc-zz

roysc-zz Jan 20, 2015

Contributor

Ah, it was actually a program that wasn't properly packaged anyway, but
I figured it's a case that should be handled.

That makes sense, will update the PR.

On 01/20/2015 04:30 PM, Daniel Hahler wrote:

Ok. I was just curious about which desktop file might have caused it.

I think using the basename of |file|, with |.desktop| removed, in
brackets, might be a good fallback.

So for /foo/bar/awesome.desktop without a Name, it would use |[awesome]|.


Reply to this email directly or view it on GitHub
#83 (comment).

Contributor

roysc-zz commented Jan 20, 2015

Ah, it was actually a program that wasn't properly packaged anyway, but
I figured it's a case that should be handled.

That makes sense, will update the PR.

On 01/20/2015 04:30 PM, Daniel Hahler wrote:

Ok. I was just curious about which desktop file might have caused it.

I think using the basename of |file|, with |.desktop| removed, in
brackets, might be a good fallback.

So for /foo/bar/awesome.desktop without a Name, it would use |[awesome]|.


Reply to this email directly or view it on GitHub
#83 (comment).

@roysc-zz

This comment has been minimized.

Show comment
Hide comment
@roysc-zz

roysc-zz Jan 20, 2015

Contributor

Updated.

Contributor

roysc-zz commented Jan 20, 2015

Updated.

@blueyed

This comment has been minimized.

Show comment
Hide comment
@blueyed

blueyed Jan 20, 2015

Member

👍

Member

blueyed commented Jan 20, 2015

👍

@psychon psychon merged commit d268dba into awesomeWM:master Jan 23, 2015

@iffer

This comment has been minimized.

Show comment
Hide comment
@iffer

iffer Jan 27, 2016

How comes this patch has been it into the master-branch for a year and didn't make it into 3.5?

iffer commented Jan 27, 2016

How comes this patch has been it into the master-branch for a year and didn't make it into 3.5?

@psychon

This comment has been minimized.

Show comment
Hide comment
@psychon

psychon Jan 27, 2016

Member

Because it didn't make it into the 3.5 branch yet. If it applies, I guess it should be cherry-picked.

Member

psychon commented Jan 27, 2016

Because it didn't make it into the 3.5 branch yet. If it applies, I guess it should be cherry-picked.

@blueyed

This comment has been minimized.

Show comment
Hide comment
@blueyed

blueyed Jan 29, 2016

Member

FTR: Cherry-picked in dd40e7a.
Thanks!

Member

blueyed commented Jan 29, 2016

FTR: Cherry-picked in dd40e7a.
Thanks!

@psychon

This comment has been minimized.

Show comment
Hide comment
@psychon

psychon Jan 30, 2016

Member

Sorry that I forgot to mention the cherry-pick here and thanks to @blueyed for fixing that oversight :)

Member

psychon commented Jan 30, 2016

Sorry that I forgot to mention the cherry-pick here and thanks to @blueyed for fixing that oversight :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment