diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/browser.cpp | 13 | ||||
-rw-r--r-- | gui/browser.h | 10 | ||||
-rw-r--r-- | gui/launcher.cpp | 14 | ||||
-rw-r--r-- | gui/massadd.cpp | 10 | ||||
-rw-r--r-- | gui/massadd.h | 4 | ||||
-rw-r--r-- | gui/options.cpp | 10 | ||||
-rw-r--r-- | gui/themebrowser.cpp | 10 | ||||
-rw-r--r-- | gui/themebrowser.h | 2 |
8 files changed, 36 insertions, 37 deletions
diff --git a/gui/browser.cpp b/gui/browser.cpp index 41d3d15bb6..978187c17e 100644 --- a/gui/browser.cpp +++ b/gui/browser.cpp @@ -107,7 +107,7 @@ int BrowserDialog::runModal() { err = FSRefMakePath(&ref, (UInt8*)buf, sizeof(buf)-1); assert(err == noErr); - _choice = FilesystemNode(buf); + _choice = Common::FilesystemNode(buf); choiceMade = true; } @@ -160,9 +160,9 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser) void BrowserDialog::open() { if (ConfMan.hasKey("browser_lastpath")) - _node = FilesystemNode(ConfMan.get("browser_lastpath")); + _node = Common::FilesystemNode(ConfMan.get("browser_lastpath")); if (!_node.isDirectory()) - _node = FilesystemNode("."); + _node = Common::FilesystemNode("."); // Alway refresh file list updateListing(); @@ -227,8 +227,9 @@ void BrowserDialog::updateListing() { ConfMan.set("browser_lastpath", _node.getPath()); // Read in the data from the file system - FilesystemNode::ListMode listMode = _isDirBrowser ? FilesystemNode::kListDirectoriesOnly - : FilesystemNode::kListAll; + Common::FilesystemNode::ListMode listMode = + _isDirBrowser ? Common::FilesystemNode::kListDirectoriesOnly + : Common::FilesystemNode::kListAll; if (!_node.getChildren(_nodeContent, listMode)) { _nodeContent.clear(); } else { @@ -237,7 +238,7 @@ void BrowserDialog::updateListing() { // Populate the ListWidget Common::StringList list; - for (FSList::iterator i = _nodeContent.begin(); i != _nodeContent.end(); ++i) { + for (Common::FSList::iterator i = _nodeContent.begin(); i != _nodeContent.end(); ++i) { if (!_isDirBrowser && i->isDirectory()) list.push_back(i->getDisplayName() + "/"); else diff --git a/gui/browser.h b/gui/browser.h index d330e32269..c8bdec26a2 100644 --- a/gui/browser.h +++ b/gui/browser.h @@ -39,8 +39,6 @@ class ListWidget; class StaticTextWidget; class BrowserDialog : public Dialog { - typedef Common::String String; - typedef Common::StringList StringList; public: BrowserDialog(const char *title, bool dirBrowser); @@ -52,7 +50,7 @@ public: virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); #endif - const FilesystemNode &getResult() { return _choice; } + const Common::FilesystemNode &getResult() { return _choice; } protected: #ifdef MACOSX @@ -60,10 +58,10 @@ protected: #else ListWidget *_fileList; StaticTextWidget *_currentPath; - FilesystemNode _node; - FSList _nodeContent; + Common::FilesystemNode _node; + Common::FSList _nodeContent; #endif - FilesystemNode _choice; + Common::FilesystemNode _choice; bool _isDirBrowser; #ifndef MACOSX diff --git a/gui/launcher.cpp b/gui/launcher.cpp index c266446612..1c155f3583 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -394,7 +394,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat if (browser.runModal() > 0) { // User made this choice... - FilesystemNode file(browser.getResult()); + Common::FilesystemNode file(browser.getResult()); _soundFont->setLabel(file.getPath()); if (!file.getPath().empty() && (file.getPath() != "None")) @@ -412,7 +412,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat BrowserDialog browser("Select directory with game data", true); if (browser.runModal() > 0) { // User made his choice... - FilesystemNode dir(browser.getResult()); + Common::FilesystemNode dir(browser.getResult()); // TODO: Verify the game can be found in the new directory... Best // done with optional specific gameid to pluginmgr detectgames? @@ -430,7 +430,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat BrowserDialog browser("Select additional game directory", true); if (browser.runModal() > 0) { // User made his choice... - FilesystemNode dir(browser.getResult()); + Common::FilesystemNode dir(browser.getResult()); _extraPathWidget->setLabel(dir.getPath()); draw(); } @@ -442,7 +442,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat BrowserDialog browser("Select directory for saved games", true); if (browser.runModal() > 0) { // User made his choice... - FilesystemNode dir(browser.getResult()); + Common::FilesystemNode dir(browser.getResult()); _savePathWidget->setLabel(dir.getPath()); draw(); } @@ -798,9 +798,9 @@ void LauncherDialog::addGame() { if (_browser->runModal() > 0) { // User made his choice... - FilesystemNode dir(_browser->getResult()); - FSList files; - if (!dir.getChildren(files, FilesystemNode::kListAll)) { + Common::FilesystemNode dir(_browser->getResult()); + Common::FSList files; + if (!dir.getChildren(files, Common::FilesystemNode::kListAll)) { error("browser returned a node that is not a directory: '%s'", dir.getPath().c_str()); } diff --git a/gui/massadd.cpp b/gui/massadd.cpp index 6842466ad9..c34c190776 100644 --- a/gui/massadd.cpp +++ b/gui/massadd.cpp @@ -58,7 +58,7 @@ enum { -MassAddDialog::MassAddDialog(const FilesystemNode &startDir) +MassAddDialog::MassAddDialog(const Common::FilesystemNode &startDir) : Dialog("massadddialog"), _dirsScanned(0), _okButton(0), @@ -156,10 +156,10 @@ void MassAddDialog::handleTickle() { // Perform a breadth-first scan of the filesystem. while (!_scanStack.empty() && (g_system->getMillis() - t) < kMaxScanTime) { - FilesystemNode dir = _scanStack.pop(); + Common::FilesystemNode dir = _scanStack.pop(); - FSList files; - if (!dir.getChildren(files, FilesystemNode::kListAll)) { + Common::FSList files; + if (!dir.getChildren(files, Common::FilesystemNode::kListAll)) { error("browser returned a node that is not a directory: '%s'", dir.getPath().c_str()); } @@ -206,7 +206,7 @@ void MassAddDialog::handleTickle() { // Recurse into all subdirs - for (FSList::const_iterator file = files.begin(); file != files.end(); ++file) { + for (Common::FSList::const_iterator file = files.begin(); file != files.end(); ++file) { if (file->isDirectory()) { _scanStack.push(*file); } diff --git a/gui/massadd.h b/gui/massadd.h index e0eff75c64..733559cf37 100644 --- a/gui/massadd.h +++ b/gui/massadd.h @@ -38,14 +38,14 @@ class StaticTextWidget; class MassAddDialog : public Dialog { public: - MassAddDialog(const FilesystemNode &startDir); + MassAddDialog(const Common::FilesystemNode &startDir); //void open(); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleTickle(); private: - Common::Stack<FilesystemNode> _scanStack; + Common::Stack<Common::FilesystemNode> _scanStack; GameList _games; /** diff --git a/gui/options.cpp b/gui/options.cpp index d6f5306ce2..335d4bc3d0 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -835,7 +835,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 BrowserDialog browser("Select directory for savegames", true); if (browser.runModal() > 0) { // User made his choice... - FilesystemNode dir(browser.getResult()); + Common::FilesystemNode dir(browser.getResult()); if (dir.isWritable()) { _savePath->setLabel(dir.getPath()); } else { @@ -851,7 +851,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 BrowserDialog browser("Select directory for GUI themes", true); if (browser.runModal() > 0) { // User made his choice... - FilesystemNode dir(browser.getResult()); + Common::FilesystemNode dir(browser.getResult()); _themePath->setLabel(dir.getPath()); draw(); } @@ -861,7 +861,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 BrowserDialog browser("Select directory for extra files", true); if (browser.runModal() > 0) { // User made his choice... - FilesystemNode dir(browser.getResult()); + Common::FilesystemNode dir(browser.getResult()); _extraPath->setLabel(dir.getPath()); draw(); } @@ -872,7 +872,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 BrowserDialog browser("Select directory for plugins", true); if (browser.runModal() > 0) { // User made his choice... - FilesystemNode dir(browser.getResult()); + Common::FilesystemNode dir(browser.getResult()); _pluginsPath->setLabel(dir.getPath()); draw(); } @@ -883,7 +883,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 BrowserDialog browser("Select SoundFont", false); if (browser.runModal() > 0) { // User made his choice... - FilesystemNode file(browser.getResult()); + Common::FilesystemNode file(browser.getResult()); _soundFont->setLabel(file.getPath()); if (!file.getPath().empty() && (file.getPath() != "None")) diff --git a/gui/themebrowser.cpp b/gui/themebrowser.cpp index 98e6df8565..bf718d5e4a 100644 --- a/gui/themebrowser.cpp +++ b/gui/themebrowser.cpp @@ -141,16 +141,16 @@ void ThemeBrowser::addDir(ThList &list, const Common::String &dir, int level) { if (level < 0) return; - FilesystemNode node(dir); + Common::FilesystemNode node(dir); if (!node.exists() || !node.isReadable()) return; - FSList fslist; - if (!node.getChildren(fslist, FilesystemNode::kListAll)) + Common::FSList fslist; + if (!node.getChildren(fslist, Common::FilesystemNode::kListAll)) return; - for (FSList::const_iterator i = fslist.begin(); i != fslist.end(); ++i) { + for (Common::FSList::const_iterator i = fslist.begin(); i != fslist.end(); ++i) { if (i->isDirectory()) { addDir(list, i->getPath(), level-1); } else { @@ -171,7 +171,7 @@ void ThemeBrowser::addDir(ThList &list, const Common::String &dir, int level) { } } -bool ThemeBrowser::isTheme(const FilesystemNode &node, Entry &out) { +bool ThemeBrowser::isTheme(const Common::FilesystemNode &node, Entry &out) { Common::ConfigFile cfg; Common::String type; diff --git a/gui/themebrowser.h b/gui/themebrowser.h index 9351648d24..e16a329c0e 100644 --- a/gui/themebrowser.h +++ b/gui/themebrowser.h @@ -58,7 +58,7 @@ private: void updateListing(); void addDir(ThList &list, const Common::String &dir, int level = 4); - bool isTheme(const FilesystemNode &node, Entry &out); + bool isTheme(const Common::FilesystemNode &node, Entry &out); }; } // end of namespace GUI |