small idx fix to saving an auto-profile entry in cases where new window title is empty.

This commit is contained in:
mika-n 2019-07-12 00:32:24 +03:00
parent 08779ba1cd
commit 5207d7dee8

View File

@ -361,10 +361,14 @@ namespace DS4Windows.Forms
lVPrograms.SelectedItems[0].SubItems[0].Text = Path.GetFileNameWithoutExtension(newPath); lVPrograms.SelectedItems[0].SubItems[0].Text = Path.GetFileNameWithoutExtension(newPath);
lVPrograms.SelectedItems[0].SubItems[1].Text = newPath; lVPrograms.SelectedItems[0].SubItems[1].Text = newPath;
if (lVPrograms.SelectedItems[0].SubItems.Count < 3) if (lVPrograms.SelectedItems[0].SubItems.Count < 3)
if(!String.IsNullOrEmpty(newTitle)) {
if (!String.IsNullOrEmpty(newTitle))
lVPrograms.SelectedItems[0].SubItems.Add(newTitle); lVPrograms.SelectedItems[0].SubItems.Add(newTitle);
}
else else
{
lVPrograms.SelectedItems[0].SubItems[2].Text = newTitle; lVPrograms.SelectedItems[0].SubItems[2].Text = newTitle;
}
if (!String.IsNullOrEmpty(newTitle)) if (!String.IsNullOrEmpty(newTitle))
lVPrograms.SelectedItems[0].ToolTipText = $"{newPath} [{newTitle}]"; lVPrograms.SelectedItems[0].ToolTipText = $"{newPath} [{newTitle}]";