Merge pull request #1607 from duplicati/kenneth_staging

Minor fixes, including a fix for issue #1606
This commit is contained in:
Kenneth Skovhede
2016-03-11 01:01:00 +01:00
4 changed files with 21 additions and 8 deletions
+1 -1
View File
@@ -413,7 +413,7 @@ namespace Duplicati.Library.Main
{
m_encryption = DynamicLoader.EncryptionLoader.GetModule(m_options.EncryptionModule, m_options.Passphrase, m_options.RawOptions);
if (m_encryption == null)
throw new Exception(string.Format("Encryption method not supported: ", m_options.EncryptionModule));
throw new Exception(string.Format("Encryption method not supported: {0}", m_options.EncryptionModule));
}
if (m_taskControl != null)
+17 -4
View File
@@ -380,6 +380,16 @@ namespace Duplicati.Library.Main
m_currentTaskThread = null;
}
}
/// <summary>
/// Attempts to set the locale, but delays linking to the calls as they are missing in some environments
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private static void DoSetLocale(System.Globalization.CultureInfo locale, System.Globalization.CultureInfo uiLocale)
{
System.Globalization.CultureInfo.DefaultThreadCurrentCulture = locale;
System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = uiLocale;
}
private void OnOperationComplete(object result)
{
@@ -407,10 +417,12 @@ namespace Duplicati.Library.Main
if (m_doResetLocale)
{
System.Globalization.CultureInfo.DefaultThreadCurrentCulture = m_resetLocale;
System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = m_resetLocaleUI;
// Wrap the call to avoid loading issues for the setLocale method
DoSetLocale(m_resetLocale, m_resetLocaleUI);
m_doResetLocale = false;
m_resetLocale = null;
m_resetLocaleUI = null;
}
if (m_resetKeys != null)
@@ -524,8 +536,9 @@ namespace Duplicati.Library.Main
m_resetLocale = System.Globalization.CultureInfo.DefaultThreadCurrentCulture;
m_resetLocaleUI = System.Globalization.CultureInfo.DefaultThreadCurrentUICulture;
m_doResetLocale = true;
System.Globalization.CultureInfo.DefaultThreadCurrentCulture = locale;
System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = locale;
// Wrap the call to avoid loading issues for the setLocale method
DoSetLocale(locale, locale);
}
if (!string.IsNullOrEmpty(m_options.ThreadPriority))
@@ -112,7 +112,7 @@ namespace Duplicati.Library.Main.Operation
if (doubles.Count > 0)
{
var s = string.Format("Found remote files reported as duplicates, either the backend module is broken or you need to manually remove the extra copies.\nThe following files were found multiple times: ", string.Join(", ", doubles.Keys));
var s = string.Format("Found remote files reported as duplicates, either the backend module is broken or you need to manually remove the extra copies.\nThe following files were found multiple times: {0}", string.Join(", ", doubles.Keys));
log.AddError(s, null);
throw new Exception(s);
}
+2 -2
View File
@@ -690,12 +690,12 @@ namespace Duplicati.Library.Main
/// <summary>
/// Gets a value indicating whether a temporary folder has been specified
/// Gets a value indicating whether the user has forced the locale
/// </summary>
public bool HasForcedLocale { get { return m_options.ContainsKey("force-locale"); } }
/// <summary>
/// Gets the folder where temporary files are stored
/// Gets the forced locale for the current user
/// </summary>
public System.Globalization.CultureInfo ForcedLocale
{