Fix 'ROM Audit' mode not getting current active directory.

This commit is contained in:
Stephen Anthony 2020-03-15 19:14:57 -02:30
parent 336b72b2de
commit 725225934a
5 changed files with 20 additions and 7 deletions

View File

@ -75,9 +75,9 @@ const string& Launcher::selectedRomMD5()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const FilesystemNode& Launcher::currentNode() const const FilesystemNode& Launcher::currentDir() const
{ {
return (static_cast<LauncherDialog*>(myBaseDialog))->currentNode(); return (static_cast<LauncherDialog*>(myBaseDialog))->currentDir();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -55,9 +55,9 @@ class Launcher : public DialogContainer
const string& selectedRomMD5(); const string& selectedRomMD5();
/** /**
Wrapper for LauncherDialog::currentNode() method. Wrapper for LauncherDialog::currentDir() method.
*/ */
const FilesystemNode& currentNode() const; const FilesystemNode& currentDir() const;
/** /**
Wrapper for LauncherDialog::reload() method. Wrapper for LauncherDialog::reload() method.

View File

@ -261,6 +261,12 @@ const FilesystemNode& LauncherDialog::currentNode() const
return myList->selected(); return myList->selected();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const FilesystemNode& LauncherDialog::currentDir() const
{
return myList->currentDir();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LauncherDialog::reload() void LauncherDialog::reload()
{ {

View File

@ -74,12 +74,19 @@ class LauncherDialog : public Dialog
const string& selectedRomMD5(); const string& selectedRomMD5();
/** /**
Get node for the currently selected directory. Get node for the currently selected entry.
@return FilesystemNode currently active @return FilesystemNode currently selected
*/ */
const FilesystemNode& currentNode() const; const FilesystemNode& currentNode() const;
/**
Get node for the current directory.
@return FilesystemNode (directory) currently active
*/
const FilesystemNode& currentDir() const;
/** /**
Reload the current listing Reload the current listing
*/ */

View File

@ -99,7 +99,7 @@ RomAuditDialog::~RomAuditDialog()
void RomAuditDialog::loadConfig() void RomAuditDialog::loadConfig()
{ {
const string& currentdir = const string& currentdir =
instance().launcher().currentNode().getShortPath(); instance().launcher().currentDir().getShortPath();
const string& path = currentdir == "" ? const string& path = currentdir == "" ?
instance().settings().getString("romdir") : currentdir; instance().settings().getString("romdir") : currentdir;