summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2014-01-19 11:46:51 (GMT)
committerRemko Tronçon <git@el-tramo.be>2014-01-19 16:49:19 (GMT)
commitcbd01a5368f0b761d2032d75c9f7dfde2bf61578 (patch)
tree5016505b1e977e84655cc3bba4435ef7cb80e811 /Sluift/core.lua
parent4083d6da47ac0e3b77da9c7c222a9439b3e1c04c (diff)
downloadswift-cbd01a5368f0b761d2032d75c9f7dfde2bf61578.zip
swift-cbd01a5368f0b761d2032d75c9f7dfde2bf61578.tar.bz2
Sluift: Add iTunes & PEP User Tune support
Change-Id: I25b3840bb40ce38531922cc737bc82828e026d3f
Diffstat (limited to 'Sluift/core.lua')
-rw-r--r--Sluift/core.lua18
1 files changed, 17 insertions, 1 deletions
diff --git a/Sluift/core.lua b/Sluift/core.lua
index f387354..1969690 100644
--- a/Sluift/core.lua
+++ b/Sluift/core.lua
@@ -72,7 +72,22 @@ local function register_table_tostring(table, print_functions)
metatable.__tostring = table_tostring
end
end
- return table
+end
+
+-- FIXME: Not really a good or efficiant equals, but does the trick for now
+local function table_equals(t1, t2)
+ return tostring(t1) == tostring(t2)
+end
+
+local function register_table_equals(table)
+ if type(table) == 'table' then
+ local metatable = getmetatable(table)
+ if not metatable then
+ metatable = {}
+ setmetatable(table, metatable)
+ end
+ metatable.__eq = table_equals
+ end
end
local function merge_tables(...)
@@ -983,6 +998,7 @@ return {
register_help = register_help,
register_class_help = register_class_help,
register_table_tostring = register_table_tostring,
+ register_table_equals = register_table_equals,
register_get_by_type_index = register_get_by_type_index,
process_pubsub_event = process_pubsub_event,
tprint = tprint,