Skip to content

Commit

Permalink
Changes for Kobo Aura H2O.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frenzie committed Oct 15, 2014
1 parent ef80cc6 commit 629c32f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/ui/device.lua
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function Device:hasFrontlight()
if self.has_front_light ~= nil then return self.has_front_light end
local model = self:getModel()
self.has_front_light = (model == "KindlePaperWhite") or (model == "KindlePaperWhite2")
or (model == "Kobo_dragon") or (model == "Kobo_kraken") or (model == "Kobo_phoenix")
or (model == "Kobo_dahlia") or (model == "Kobo_dragon") or (model == "Kobo_kraken") or (model == "Kobo_phoenix")
or util.isEmulated()
return self.has_front_light
end
Expand Down
2 changes: 1 addition & 1 deletion frontend/ui/device/screen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function Screen:getDPI()
self.dpi = 212
elseif model == "Kobo_phoenix" then
self.dpi = 212.8
elseif model == "Kobo_dragon" then
elseif model == "Kobo_dragon" or model == "Kobo_dahlia" then
self.dpi = 265
elseif model == "Kobo_pixie" then
self.dpi = 200
Expand Down
2 changes: 1 addition & 1 deletion frontend/ui/input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ function Input:init()
end
end

if Device:getModel() ~= 'Kobo_phoenix' then
if Device:getModel() ~= 'Kobo_phoenix' and Device:getModel() ~= 'Kobo_dahlia' then

This comment has been minimized.

Copy link
@pazos

pazos Oct 15, 2014

Member

I think the "and" is wrong. It should be:

if Device:getModel() ~= 'Kobo_phoenix' or Device:getModel() ~= 'Kobo_dahlia' then

This comment has been minimized.

Copy link
@hwhw

hwhw Oct 15, 2014

Member

I don't think so. Note it's ~=, not ==.

This comment has been minimized.

Copy link
@chrox

chrox Oct 16, 2014

Member

Or more intuitive form:

if Device:getModel() == 'Kobo_phoenix' or Device:getModel() == 'Kobo_dahlia' then
        function Input:handleTouchEv(ev)
            return Input:handlePhoenixTouchEv(ev)
        end
else
        function Input:handleTouchEv(ev)
            return Input:handleTypeBTouchEv(ev)
        end
end
function Input:handleTouchEv(ev)
return Input:handleTypeBTouchEv(ev)
end
Expand Down

2 comments on commit 629c32f

@Frenzie
Copy link
Member Author

Choose a reason for hiding this comment

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

The and is correct, otherwise Device:getModel() ~= 'Kobo_phoenix' would evaluate as true on the H2O and vice versa on the Kobo Aura. However, I definitely prefer what @chrox wrote. The whole idea of "if not specific case then do generic stuff else do specific stuff" as opposed to "if specific case then do specific stuff else do generic stuff" felt odd to me from the get-go.I'll make another pull request with this change if you want.

@chrox
Copy link
Member

@chrox chrox commented on 629c32f Oct 16, 2014

Choose a reason for hiding this comment

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

Yes, I agree. Please send another PR, thanks.

Please sign in to comment.