Merge pull request #838 from blueyed/streamline-util.deprecate-calls

Streamline/cleanup util.deprecate calls
This commit is contained in:
Daniel Hahler 2016-04-19 10:49:24 +02:00
commit 4d49f76e16
2 changed files with 18 additions and 29 deletions

View File

@ -69,8 +69,7 @@ client.focus = require("awful.client.focus")
-- If it is a function, it will be called with the client and its first
-- tag as arguments.
function client.jumpto(c, merge)
util.deprecate "Use c:jump_to(merge) instead of awful.client.jumpto"
util.deprecate("Use c:jump_to(merge) instead of awful.client.jumpto")
client.object.jump_to(c, merge)
end
@ -316,7 +315,7 @@ end
-- @client[opt] c The client, otherwise focused one is used.
-- @see client.relative_move
function client.moveresize(x, y, w, h, c)
util.deprecate "Use c:relative_move(x, y, w, h) instead of awful.client.moveresize"
util.deprecate("Use c:relative_move(x, y, w, h) instead of awful.client.moveresize")
client.object.relative_move(c or capi.client.focus, x, y, w, h)
end
@ -342,7 +341,7 @@ end
-- @client[opt] c The client to move, otherwise the focused one is used.
-- @see client.move_to_tag
function client.movetotag(target, c)
util.deprecate "Use c:move_to_tag(target) instead of awful.client.movetotag"
util.deprecate("Use c:move_to_tag(target) instead of awful.client.movetotag")
client.object.move_to_tag(c or capi.client.focus, target)
end
@ -367,7 +366,7 @@ end
-- @client[opt] c The client to toggle, otherwise the focused one is used.
-- @see client.toggle_tag
function client.toggletag(target, c)
util.deprecate "Use c:toggle_tag(target) instead of awful.client.toggletag"
util.deprecate("Use c:toggle_tag(target) instead of awful.client.toggletag")
client.object.toggle_tag(c or capi.client.focus, target)
end
@ -403,8 +402,7 @@ end
-- @see screen
-- @see client.move_to_screen
function client.movetoscreen(c, s)
util.deprecate "Use c:move_to_screen(s) instead of awful.client.movetoscreen"
util.deprecate("Use c:move_to_screen(s) instead of awful.client.movetoscreen")
client.object.move_to_screen(c or capi.client.focus, s)
end
@ -504,8 +502,7 @@ end
-- @deprecated awful.client.mark
-- @client c The client to mark, the focused one if not specified.
function client.mark(c)
util.deprecate "Use c.marked = true instead of awful.client.mark"
util.deprecate("Use c.marked = true instead of awful.client.mark")
client.object.set_marked(c or capi.client.focus, true)
end
@ -513,8 +510,7 @@ end
-- @deprecated awful.client.unmark
-- @client c The client to unmark, or the focused one if not specified.
function client.unmark(c)
util.deprecate "Use c.marked = false instead of awful.client.unmark"
util.deprecate("Use c.marked = false instead of awful.client.unmark")
client.object.set_marked(c or capi.client.focus, false)
end
@ -522,8 +518,7 @@ end
-- @deprecated awful.client.ismarked
-- @client c The client to check, or the focused one otherwise.
function client.ismarked(c)
util.deprecate "Use c.marked instead of awful.client.ismarked"
util.deprecate("Use c.marked instead of awful.client.ismarked")
return client.object.get_marked(c or capi.client.focus)
end
@ -531,8 +526,7 @@ end
-- @deprecated awful.client.togglemarked
-- @client c The client to toggle mark.
function client.togglemarked(c)
util.deprecate "Use c.marked = not c.marked instead of awful.client.togglemarked"
util.deprecate("Use c.marked = not c.marked instead of awful.client.togglemarked")
c = c or capi.client.focus
if c then
c.marked = not c.marked
@ -561,7 +555,7 @@ end
-- @client c A client.
-- @param s True or false.
function client.floating.set(c, s)
util.deprecate "Use c.floating = true instead of awful.client.floating.set"
util.deprecate("Use c.floating = true instead of awful.client.floating.set")
client.object.set_floating(c, s)
end
@ -605,7 +599,7 @@ capi.client.connect_signal("property::geometry", store_floating_geometry)
-- @see is_fixed
-- @see size_hints_honor
function client.isfixed(c)
util.deprecate "Use c.is_fixed instead of awful.client.isfixed"
util.deprecate("Use c.is_fixed instead of awful.client.isfixed")
c = c or capi.client.focus
return client.object.is_fixed(c)
end
@ -644,7 +638,7 @@ end
-- did not set them manually. For example, windows with a type different than
-- normal.
function client.floating.get(c)
util.deprecate "Use c.floating instead of awful.client.floating.get"
util.deprecate("Use c.floating instead of awful.client.floating.get")
return client.object.get_floating(c)
end
@ -890,8 +884,7 @@ end
-- "toolbar" or "dock"
-- @deprecated awful.client.dockable.get
function client.dockable.get(c)
util.deprecate "Use c.dockable instead of awful.client.dockable.get"
util.deprecate("Use c.dockable instead of awful.client.dockable.get")
return client.object.get_dockable(c)
end
@ -929,7 +922,7 @@ end
-- @param value True or false.
-- @deprecated awful.client.dockable.set
function client.dockable.set(c, value)
util.deprecate "Use c.dockable = value instead of awful.client.dockable.set"
util.deprecate("Use c.dockable = value instead of awful.client.dockable.set")
client.property.set(c, "dockable", value)
end
@ -1093,7 +1086,6 @@ end
function client.is_transient_for(c, c2)
util.deprecate("Use c:is_transient_for(c2) instead of"..
"awful.client.is_transient_for")
return client.object.is_transient_for(c, c2)
end

View File

@ -52,8 +52,7 @@ end
-- @return The squared distance of the screen to the provided point
-- @see screen.get_square_distance
function screen.getdistance_sq(s, x, y)
util.deprecate "Use s:get_square_distance(x, y) instead of awful.screen.getdistance_sq"
util.deprecate("Use s:get_square_distance(x, y) instead of awful.screen.getdistance_sq")
return screen.object.get_square_distance(s, x, y)
end
@ -174,12 +173,10 @@ end
-- @treturn table A table with left, right, top and bottom number values.
-- @see padding
function screen.padding(_screen, padding)
util.deprecate "Use _screen.padding = value instead of awful.screen.padding"
util.deprecate("Use _screen.padding = value instead of awful.screen.padding")
if padding then
screen.object.set_padding(_screen, padding)
end
return screen.object.get_padding(_screen)
end