Permalink
Browse files

Add workaround for file_new_for_path() vs. File.new_for_path() issue

  • Loading branch information...
1 parent bba7c07 commit 6465fbe2d19315ec19629b34744ba27a746b0238 @pavouk committed Nov 7, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/lgix/Gio.lua
View
@@ -12,3 +12,14 @@ local select, type, pairs = select, type, pairs
local lgi = require 'lgi'
local Gio = lgi.Gio
local GObject = lgi.GObject
+
+-- GOI < 1.30 did not map static factory method into interface
+-- namespace. The prominent example of this fault was teh
+-- Gio.File.new_for_path had to be accessed as
+-- Gio.file_new_for_path(). Create a compatibility layer to mask this
+-- flaw.
+for _, name in pairs { 'path', 'uri', 'commandline_arg' } do
+ if not Gio.File['new_for_' .. name] then
+ Gio.File._method['new_for_' .. name] = Gio['file_new_for_' .. name]
+ end
+end

0 comments on commit 6465fbe

Please sign in to comment.