[Scummvm-cvs-logs] SF.net SVN: scummvm: [23527] scummvm/trunk/backends/fs/gp32/gp32-fs.cpp

wonst719 at users.sourceforge.net wonst719 at users.sourceforge.net
Thu Jul 20 22:52:08 CEST 2006


Revision: 23527
          http://svn.sourceforge.net/scummvm/?rev=23527&view=rev
Author:   wonst719
Date:     2006-07-16 01:32:23 -0700 (Sun, 16 Jul 2006)

Log Message:
-----------
Fix FileSystem bug. Now 'Go Up' button works. :)

Modified Paths:
--------------
    scummvm/trunk/backends/fs/gp32/gp32-fs.cpp

Modified: scummvm/trunk/backends/fs/gp32/gp32-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/gp32/gp32-fs.cpp	2006-07-16 02:39:22 UTC (rev 23526)
+++ scummvm/trunk/backends/fs/gp32/gp32-fs.cpp	2006-07-16 08:32:23 UTC (rev 23527)
@@ -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 @@
 		_isRoot = true;
 		_displayName = "GP32 Root";
 	} else {
+		_isRoot = false;
 		_displayName = String(dsplName);
 	}
 	_isDirectory = true;
@@ -170,6 +171,7 @@
 		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,19 +206,13 @@
 	if(_isRoot)
 		return 0;
 
-	GP32FilesystemNode *p = new GP32FilesystemNode();
-	if (_path.size() > 4) {
-		const char *start = _path.c_str();
-		const char *end = lastPathComponent(_path);
+	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());
-	}
+	GP32FilesystemNode *p = new GP32FilesystemNode(String(start, end - start));
 
+	NP("%s", p->_path.c_str());
+
 	return p;
 }
 






More information about the Scummvm-git-logs mailing list