Skip to content

Commit ae07ddf

Browse files
authored
Feature: Hide pCloud from drives list (#14084)
1 parent f0badb2 commit ae07ddf

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/Files.App/Data/Models/AppModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,15 @@ public string GoogleDrivePath
101101
get => googleDrivePath;
102102
set => SetProperty(ref googleDrivePath, value);
103103
}
104+
105+
private string pCloudDrivePath = string.Empty;
106+
/// <summary>
107+
/// Gets or sets a value indicating the path for pCloud Drive.
108+
/// </summary>
109+
public string PCloudDrivePath
110+
{
111+
get => pCloudDrivePath;
112+
set => SetProperty(ref pCloudDrivePath, value);
113+
}
104114
}
105115
}

src/Files.App/Services/RemovableDrivesService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public async IAsyncEnumerable<ILocatableFolder> GetDrivesAsync()
2020
{
2121
var list = DriveInfo.GetDrives();
2222
var googleDrivePath = App.AppModel.GoogleDrivePath;
23+
var pCloudDrivePath = App.AppModel.PCloudDrivePath;
2324

2425
foreach (var drive in list)
2526
{
@@ -43,7 +44,7 @@ public async IAsyncEnumerable<ILocatableFolder> GetDrivesAsync()
4344
var driveItem = await DriveItem.CreateFromPropertiesAsync(res.Result, drive.Name.TrimEnd('\\'), label, type, thumbnail);
4445

4546
// Don't add here because Google Drive is already displayed under cloud drives
46-
if (drive.Name == googleDrivePath)
47+
if (drive.Name == googleDrivePath || drive.Name == pCloudDrivePath)
4748
continue;
4849

4950
App.Logger.LogInformation($"Drive added: {driveItem.Path}, {driveItem.Type}");

src/Files.App/Utils/Cloud/CloudDrivesDetector.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ private static Task<IEnumerable<ICloudProvider>> DetectpCloudDrive()
245245
string iconPath = Path.Combine(programFilesFolder, "pCloud Drive", "pCloud.exe");
246246
var iconFile = Win32API.ExtractSelectedIconsFromDLL(iconPath, new List<int>() { 32512 }, 32).FirstOrDefault();
247247

248+
App.AppModel.PCloudDrivePath = syncedFolder;
249+
248250
results.Add(new CloudProvider(CloudProviders.pCloud)
249251
{
250252
Name = $"pCloud Drive",

0 commit comments

Comments
 (0)