diff options
author | Won Star | 2006-07-16 08:32:23 +0000 |
---|---|---|
committer | Won Star | 2006-07-16 08:32:23 +0000 |
commit | 167a1e5912f688501a2f611b1b5f06d2be6b164a (patch) | |
tree | fce624536f456c637aa8e3463f07f990653a0fb3 | |
parent | 993cc4bd66564d38828fb3643287389fc978fe24 (diff) | |
download | scummvm-rg350-167a1e5912f688501a2f611b1b5f06d2be6b164a.tar.gz scummvm-rg350-167a1e5912f688501a2f611b1b5f06d2be6b164a.tar.bz2 scummvm-rg350-167a1e5912f688501a2f611b1b5f06d2be6b164a.zip |
Fix FileSystem bug. Now 'Go Up' button works. :)
svn-id: r23527
-rw-r--r-- | backends/fs/gp32/gp32-fs.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/backends/fs/gp32/gp32-fs.cpp b/backends/fs/gp32/gp32-fs.cpp index 9e59a8ccdd..c9e615b05c 100644 --- a/backends/fs/gp32/gp32-fs.cpp +++ b/backends/fs/gp32/gp32-fs.cpp @@ -1,8 +1,8 @@ /* ScummVM - Scumm Interpreter * Copyright (C) 2001-2006 The ScummVM project * Copyright (C) 2002 Ph0x - GP32 Backend - * Copyright (C) 2003/2004 DJWillis - GP32 Backend - * Copyright (C) 2005 Won Star - GP32 Backend + * Copyright (C) 2003-2004 DJWillis - GP32 Backend + * Copyright (C) 2005-2006 Won Star - GP32 Backend * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -141,6 +141,7 @@ GP32FilesystemNode::GP32FilesystemNode(const String &path) { _isRoot = true; _displayName = "GP32 Root"; } else { + _isRoot = false; _displayName = String(dsplName); } _isDirectory = true; @@ -170,6 +171,7 @@ bool GP32FilesystemNode::listDir(AbstractFSList &myList, ListMode mode) const { entry._displayName = dirEntry.name; entry._path = _path; entry._path += dirEntry.name; + entry._isRoot = false; GpFileAttr(entry._path.c_str(), &attr); entry._isDirectory = attr.attr & (1 << 4); @@ -204,18 +206,12 @@ AbstractFilesystemNode *GP32FilesystemNode::parent() const { if(_isRoot) return 0; - GP32FilesystemNode *p = new GP32FilesystemNode(); - if (_path.size() > 4) { - const char *start = _path.c_str(); - const char *end = lastPathComponent(_path); - - p->_path = String(start, end - start); - p->_isDirectory = true; - p->_displayName = lastPathComponent(p->_path); - p->_isRoot = false; - - GPDEBUG("%s", p->_path.c_str()); - } + const char *start = _path.c_str(); + const char *end = lastPathComponent(_path); + + GP32FilesystemNode *p = new GP32FilesystemNode(String(start, end - start)); + + NP("%s", p->_path.c_str()); return p; } |