Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Added support for Sync drive #16947

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Files.App/Utils/Cloud/CloudProviders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public enum CloudProviders

LucidLink,

kDrive
kDrive,

SyncDrive
}
}
1 change: 1 addition & 0 deletions src/Files.App/Utils/Cloud/Detector/CloudDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ private static IEnumerable<ICloudDetector> EnumerateDetectors()
yield return new GenericCloudDetector();
yield return new SynologyDriveCloudDetector();
yield return new LucidLinkCloudDetector();
yield return new SyncCloudDetector();
}
}
}
31 changes: 31 additions & 0 deletions src/Files.App/Utils/Cloud/Detector/SyncCloudDetector.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.IO;
using Windows.Storage;

namespace Files.App.Utils.Cloud
{
/// <summary>
/// Provides a utility for Sync Cloud detection.
/// </summary>
public sealed class SyncCloudDetector : AbstractCloudDetector
{
protected override async IAsyncEnumerable<ICloudProvider> GetProviders()
{
string syncFolderPath = Path.Combine(Constants.UserEnvironmentPaths.HomePath, "Sync");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't showing the cloud drive for me. The sync folder is in %userprofile%\Sync .

The storage location can also be changed by the user, although I haven't found out where to get it from since it not the registry marcofranzen99 found where it is in the last screenshot

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm aware of this, I haven't gotten round to migrating to finding the path in the Registry yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you change the path in the installer, this would not work.

I think it would be better to modify the DetectGenericCloudDrive method. This method detects the existing cloud drives from the registry. I think that only small changes need to be made so that the SyncDrive is also recognized.

image

image

image

image


if (Directory.Exists(syncFolderPath))
{
foreach (string directory in Directory.GetDirectories(syncFolderPath))
{
var folder = await StorageFolder.GetFolderFromPathAsync(directory);

yield return new CloudProvider(CloudProviders.SyncDrive)
{
Name = $"Sync - {folder.Name}",
SyncFolder = directory,
// IconData = (needs icon)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs icon

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There one in the install location C:\Program Files (x86)\Sync\folder.ico

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

};
}
}
}
}
}
Loading