aboutsummaryrefslogtreecommitdiff
path: root/backends/fs
diff options
context:
space:
mode:
authorLars Persson2007-02-28 21:25:05 +0000
committerLars Persson2007-02-28 21:25:05 +0000
commitab605c6a4108ee9d7ded6bbd982f8e1c8f92b796 (patch)
tree82e214748dc2ff7fdc3201a17be372ec2f6f6c21 /backends/fs
parent61e2a9eb78ebf681a6472e81efaac65d5a373445 (diff)
downloadscummvm-rg350-ab605c6a4108ee9d7ded6bbd982f8e1c8f92b796.tar.gz
scummvm-rg350-ab605c6a4108ee9d7ded6bbd982f8e1c8f92b796.tar.bz2
scummvm-rg350-ab605c6a4108ee9d7ded6bbd982f8e1c8f92b796.zip
Updated Symbian File handling to be able support AGI games, but do work due to a fluke in the AGI detection.
svn-id: r25912
Diffstat (limited to 'backends/fs')
-rw-r--r--backends/fs/symbian/symbian-fs.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/backends/fs/symbian/symbian-fs.cpp b/backends/fs/symbian/symbian-fs.cpp
index 3642e73159..4752134372 100644
--- a/backends/fs/symbian/symbian-fs.cpp
+++ b/backends/fs/symbian/symbian-fs.cpp
@@ -70,7 +70,9 @@ static const char *lastPathComponent(const Common::String &str) {
}
AbstractFilesystemNode *AbstractFilesystemNode::getCurrentDirectory() {
- return AbstractFilesystemNode::getRoot();
+ char path[MAXPATHLEN];
+ getcwd(path, MAXPATHLEN);
+ return new SymbianFilesystemNode(path);
}
AbstractFilesystemNode *AbstractFilesystemNode::getRoot() {
@@ -97,16 +99,20 @@ SymbianFilesystemNode::SymbianFilesystemNode(const String &path) {
_isPseudoRoot = false;
_path = path;
- const char *dsplName = NULL, *pos = path.c_str();
- // FIXME -- why is this code scanning for a slash '/' when the rest of
- // the code in this file uses backslashes '\' ?
- // TODO: Use lastPathComponent here.
- while (*pos)
- if (*pos++ == '/')
- dsplName = pos;
- _displayName = String(dsplName);
- _isValid = true;
- _isDirectory = true;
+ _displayName = lastPathComponent(_path);
+
+ TEntry fileAttribs;
+ TFileName fname;
+ TPtrC8 ptr((const unsigned char*)_path.c_str(),_path.size());
+ fname.Copy(ptr);
+
+ if (CEikonEnv::Static()->FsSession().Entry(fname, fileAttribs) == KErrNone) {
+ _isValid = true;
+ _isDirectory = fileAttribs.IsDir();
+ } else {
+ _isValid = false;
+ _isDirectory = false;
+ }
}
bool SymbianFilesystemNode::listDir(AbstractFSList &myList, ListMode mode) const {