Author: mherger
Date: Fri Apr 16 04:41:38 2010
New Revision: 8708
URL: http://svn.slimdevices.com/jive?rev=8708&view=rev
Log:
Bug: n/a
Description: allow overriding of configured local image path
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceCard.lua
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceLocalStorage.lua
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceCard.lua
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceCard.lua?rev=8708&r1=8707&r2=8708&view=diff
==============================================================================
---
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceCard.lua
(original)
+++
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceCard.lua
Fri Apr 16 04:41:38 2010
@@ -28,14 +28,6 @@
module(...)
ImageSourceCard = oo.class(_M, ImageSourceLocalStorage)
-
-function readImageList(self)
- local imgpath = self:getFolder()
-
- if imgpath and lfs.attributes(imgpath, "mode") == "directory" then
- self:scanFolder(imgpath)
- end
-end
function getFolder(self)
return self:_getFolder("(/media/mmc%w*)")
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceLocalStorage.lua
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceLocalStorage.lua?rev=8708&r1=8707&r2=8708&view=diff
==============================================================================
---
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceLocalStorage.lua
(original)
+++
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceLocalStorage.lua
Fri Apr 16 04:41:38 2010
@@ -38,12 +38,18 @@
module(...)
ImageSourceLocalStorage = oo.class(_M, ImageSource)
-function __init(self, applet)
+function __init(self, applet, paramOverride)
log:debug("initialize ImageSourceLocalStorage")
obj = oo.rawnew(self, ImageSource(applet))
obj.imgFiles = {}
obj.scanning = false
+
+ -- caller can force a path
+ if paramOverride and paramOverride.path then
+ log:debug("overriding configured image path: ",
paramOverride.path)
+ obj.pathOverride = paramOverride.path
+ end
return obj
end
@@ -128,15 +134,19 @@
function readImageList(self)
- local imgpath = self.applet:getSettings()["card.path"]
+ local imgpath = self:getFolder()
if lfs.attributes(imgpath, "mode") == "directory" then
self:scanFolder(imgpath)
end
end
+function getFolder(self)
+ return self.pathOverride or self.applet:getSettings()["card.path"]
+end
+
function getImage(self)
- if self.imgFiles[self.currentImage] != nil then
+ if self.imgFiles[self.currentImage] ~= nil then
local file = self.imgFiles[self.currentImage]
log:info("Next image in queue: ", file)
local image = Surface:loadImage(file)
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins