a small and pointless code refactor in the record movie dialog
This commit is contained in:
parent
26ef424bdf
commit
ee93e988bc
|
@ -11,8 +11,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public partial class RecordMovie : Form
|
public partial class RecordMovie : Form
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO - Allow relative paths in record textbox
|
||||||
// Allow relative paths in record textbox
|
|
||||||
public RecordMovie()
|
public RecordMovie()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
@ -20,24 +19,23 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private string MakePath()
|
private string MakePath()
|
||||||
{
|
{
|
||||||
if (RecordBox.Text.Length == 0)
|
|
||||||
{
|
|
||||||
return string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
var path = RecordBox.Text;
|
var path = RecordBox.Text;
|
||||||
if (path.LastIndexOf(Path.DirectorySeparatorChar) == -1)
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(path))
|
||||||
{
|
{
|
||||||
if (path[0] != Path.DirectorySeparatorChar)
|
if (path.LastIndexOf(Path.DirectorySeparatorChar) == -1)
|
||||||
{
|
{
|
||||||
path = path.Insert(0, Path.DirectorySeparatorChar.ToString());
|
if (path[0] != Path.DirectorySeparatorChar)
|
||||||
}
|
{
|
||||||
|
path = path.Insert(0, Path.DirectorySeparatorChar.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
path = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPathFragment, null) + path;
|
path = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPathFragment, null) + path;
|
||||||
|
|
||||||
if (path[path.Length - 4] != '.') // If no file extension, add movie extension
|
if (path[path.Length - 4] != '.') // If no file extension, add movie extension
|
||||||
{
|
{
|
||||||
path += "." + Global.MovieSession.Movie.PreferredExtension;
|
path += "." + Global.MovieSession.Movie.PreferredExtension;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue