From fcff6dc2b758504a5341377ee346a58997d42e8c Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Wed, 6 Feb 2019 10:41:11 -0600 Subject: [PATCH] Handle OS properly when importing configurations --- GBM/Forms/frmAdvancedImport.vb | 47 +--------------------------------- GBM/Managers/mgrMonitorList.vb | 2 +- GBM/Managers/mgrXML.vb | 10 +++++++- 3 files changed, 11 insertions(+), 48 deletions(-) diff --git a/GBM/Forms/frmAdvancedImport.vb b/GBM/Forms/frmAdvancedImport.vb index a35125b..ba42877 100644 --- a/GBM/Forms/frmAdvancedImport.vb +++ b/GBM/Forms/frmAdvancedImport.vb @@ -51,7 +51,7 @@ Public Class frmAdvancedImport lstGames.BeginUpdate() bSelectAll = Not bSelectAll For i As Integer = 0 To lstGames.Items.Count - 1 - lstGames.Items(i).Checked = bSelectAll + lstGames.Items(i).Checked = bSelectAll Next lstGames.EndUpdate() Cursor.Current = Cursors.Default @@ -66,46 +66,6 @@ Public Class frmAdvancedImport End If End Sub - Private Sub ModTags(ByRef oTags As List(Of Tag)) - Dim bExists As Boolean - Dim oTag As Tag - Dim oNewTag As Tag - Dim oRemoveTag As New Tag - Dim sTag As String - Dim sAddTags() As String = {"Wine"} - Dim sRemoveTags() As String = {"Official"} - - For Each sTag In sAddTags - bExists = False - For Each oTag In oTags - If oTag.Name = sTag Then - bExists = True - Exit For - End If - Next - If Not bExists Then - oNewTag = New Tag - oNewTag.Name = sTag - oTags.Add(oNewTag) - End If - Next - - For Each sTag In sRemoveTags - bExists = False - For Each oTag In oTags - If oTag.Name = sTag Then - bExists = True - oRemoveTag = oTag - Exit For - End If - Next - If bExists Then - oTags.Remove(oRemoveTag) - End If - Next - - End Sub - Private Function CheckIgnoreTags(ByVal oTags As List(Of Tag)) As Boolean Dim oTag As Tag Dim sTag As String @@ -142,11 +102,6 @@ Public Class frmAdvancedImport bAddItem = False oApp = DirectCast(de.Value, clsGame) - 'Run any required tag mods - If ModWinConfigsForLinux Then - ModTags(oApp.ImportTags) - End If - sTags = String.Empty oApp.ImportTags.Sort(AddressOf mgrCommon.CompareImportTagsByName) For Each oTag As Tag In oApp.ImportTags diff --git a/GBM/Managers/mgrMonitorList.vb b/GBM/Managers/mgrMonitorList.vb index d36ec7e..2931137 100644 --- a/GBM/Managers/mgrMonitorList.vb +++ b/GBM/Managers/mgrMonitorList.vb @@ -835,7 +835,7 @@ Public Class mgrMonitorList Cursor.Current = Cursors.WaitCursor - If Not mgrXML.ReadMonitorList(sLocation, oExportInfo, hshCompareFrom, bWebRead) Then + If Not mgrXML.ReadMonitorList(sLocation, oExportInfo, hshCompareFrom, bWebRead, bWinConfigsInLinux) Then Exit Sub End If diff --git a/GBM/Managers/mgrXML.vb b/GBM/Managers/mgrXML.vb index 39c3984..6920e8d 100644 --- a/GBM/Managers/mgrXML.vb +++ b/GBM/Managers/mgrXML.vb @@ -6,7 +6,7 @@ Imports System.Net Public Class mgrXML - Public Shared Function ReadMonitorList(ByVal sLocation As String, ByRef oExportInfo As ExportData, ByRef hshList As Hashtable, Optional ByVal bWebRead As Boolean = False) As Boolean + Public Shared Function ReadMonitorList(ByVal sLocation As String, ByRef oExportInfo As ExportData, ByRef hshList As Hashtable, Optional ByVal bWebRead As Boolean = False, Optional ByVal bWinConfigsInLinux As Boolean = False) As Boolean Dim oList As List(Of Game) Dim hshDupeList As New Hashtable Dim oExportData As New ExportData @@ -43,6 +43,14 @@ Public Class mgrXML oGame.IsRegEx = g.IsRegEx oGame.RecurseSubFolders = g.RecurseSubFolders oGame.OS = g.OS + 'Retain compatability when the OS value is not set + If oGame.OS = 0 Then + If bWinConfigsInLinux Then + oGame.OS = clsGame.eOS.Windows + Else + oGame.OS = mgrCommon.GetCurrentOS + End If + End If For Each t As Tag In g.Tags oGame.ImportTags.Add(t) Next