Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 6465fbe2d19315ec19629b34744ba27a746b0238 1 parent bba7c07
Pavel Holejsovsky authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/lgix/Gio.lua
11 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
Please sign in to comment.
Something went wrong with that request. Please try again.