From 6ba68f868a7ba9eeb4bb3ea265fb87f23266ba77 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Fri, 2 Mar 2012 16:25:12 +0100 Subject: [PATCH] search and import "Ultrastar.db" --- Vocaluxe/Base/CDataBase.cs | 14 ++++++++++++++ Vocaluxe/Base/CSettings.cs | 1 + 2 files changed, 15 insertions(+) diff --git a/Vocaluxe/Base/CDataBase.cs b/Vocaluxe/Base/CDataBase.cs index 90b52a93..97d4278c 100644 --- a/Vocaluxe/Base/CDataBase.cs +++ b/Vocaluxe/Base/CDataBase.cs @@ -262,6 +262,20 @@ namespace Vocaluxe.Base private static bool InitHighscoreDB() { + string OldDBFilePath = Path.Combine(Environment.CurrentDirectory, CSettings.sFileOldHighscoreDB); + if (File.Exists(OldDBFilePath)) + { + if (File.Exists(_HighscoreFilePath)) + { + CLog.LogError("Found old Highscore DB (" + OldDBFilePath + "). If you want to import it just delete the new one (" + _HighscoreFilePath + ")"); + } + else + { + File.Copy(OldDBFilePath, _HighscoreFilePath); + File.Move(OldDBFilePath, OldDBFilePath + ".old"); + } + } + SQLiteConnection connection = new SQLiteConnection(); connection.ConnectionString = "Data Source=" + _HighscoreFilePath; SQLiteCommand command; diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index bbd6164f..a1aa2db7 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -69,6 +69,7 @@ namespace Vocaluxe.Base public const string sFileCover = "Cover.xml"; public const string sFileFonts = "Fonts.xml"; + public const string sFileOldHighscoreDB = "Ultrastar.db"; public static string sFileHighscoreDB = "HighscoreDB.sqlite"; public const string sFileCoverDB = "CoverDB.sqlite"; public const string sFilePerformanceLog = "Performance.log";