Linux tabs restore
This commit is contained in:
@@ -63,7 +63,7 @@ namespace FileTime.Core.Components
|
|||||||
i.FullName == null && value?.FullName == null
|
i.FullName == null && value?.FullName == null
|
||||||
? i.Name == value?.Name
|
? i.Name == value?.Name
|
||||||
: i.FullName == value?.FullName);
|
: i.FullName == value?.FullName);
|
||||||
if (itemToSelect == null) throw new IndexOutOfRangeException("Provided item does not exists in the current container.");
|
if (itemToSelect == null) throw new IndexOutOfRangeException($"Provided item ({value.FullName ?? "unknwon"}) does not exists in the current container ({_currentLocation.FullName ?? "unknwon"}).");
|
||||||
}
|
}
|
||||||
|
|
||||||
CancellationToken newToken;
|
CancellationToken newToken;
|
||||||
|
|||||||
@@ -48,7 +48,14 @@ namespace FileTime.Avalonia.Application
|
|||||||
{
|
{
|
||||||
if (value != null)
|
if (value != null)
|
||||||
{
|
{
|
||||||
SetSelectedItemAsync(value, true).Wait();
|
try
|
||||||
|
{
|
||||||
|
SetSelectedItemAsync(value, true).Wait();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
//TODO: Debug, linux start after restore 3 tabs
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace FileTime.Avalonia.Services
|
|||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveStatesAsync()
|
public void SaveStates()
|
||||||
{
|
{
|
||||||
var state = new PersistenceRoot
|
var state = new PersistenceRoot
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ namespace FileTime.Avalonia.Views
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ViewModel?.StatePersistence.SaveStatesAsync();
|
ViewModel?.StatePersistence.SaveStates();
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,10 @@ namespace FileTime.Providers.Local
|
|||||||
public bool CanHandlePath(string path)
|
public bool CanHandlePath(string path)
|
||||||
{
|
{
|
||||||
var normalizedPath = NormalizePath(path);
|
var normalizedPath = NormalizePath(path);
|
||||||
return _rootContainers.Any(r => normalizedPath.StartsWith(NormalizePath(r.Name)));
|
Func<IContainer, bool> match = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
|
||||||
|
? c => normalizedPath.StartsWith(NormalizePath(c.Name))
|
||||||
|
: c => normalizedPath.StartsWith(NormalizePath("/" + c.Name));
|
||||||
|
return _rootContainers.Any(match);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetParent(IContainer container) => _parent = container;
|
public void SetParent(IContainer container) => _parent = container;
|
||||||
|
|||||||
Reference in New Issue
Block a user