|
25 | 25 | using System.Collections.Concurrent;
|
26 | 26 | using System.Diagnostics;
|
27 | 27 | using System.Collections.Specialized;
|
| 28 | +using Flow.Launcher.Infrastructure.UserSettings; |
28 | 29 |
|
29 | 30 | namespace Flow.Launcher
|
30 | 31 | {
|
@@ -228,21 +229,39 @@ public void SavePluginSettings()
|
228 | 229 |
|
229 | 230 | public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null)
|
230 | 231 | {
|
231 |
| - using var explorer = new Process(); |
| 232 | + var customExplorerList = _settingsVM.Settings.CustomExplorerList; |
232 | 233 | var explorerInfo = _settingsVM.Settings.CustomExplorer;
|
233 |
| - explorer.StartInfo = new ProcessStartInfo |
| 234 | + |
| 235 | + var qttabbarIndex = customExplorerList.FindIndex(e => e.Name.Equals("QTTABBAR", StringComparison.OrdinalIgnoreCase)); |
| 236 | + var isQttabbarSelected = qttabbarIndex >= 0 && _settingsVM.Settings.CustomExplorerIndex == qttabbarIndex; |
| 237 | + |
| 238 | + if (isQttabbarSelected) |
234 | 239 | {
|
235 |
| - FileName = explorerInfo.Path, |
236 |
| - UseShellExecute = true, |
237 |
| - Arguments = FileNameOrFilePath is null |
238 |
| - ? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath) |
239 |
| - : explorerInfo.FileArgument |
240 |
| - .Replace("%d", DirectoryPath) |
241 |
| - .Replace("%f", |
242 |
| - Path.IsPathRooted(FileNameOrFilePath) ? FileNameOrFilePath : Path.Combine(DirectoryPath, FileNameOrFilePath) |
243 |
| - ) |
244 |
| - }; |
245 |
| - explorer.Start(); |
| 240 | + Process.Start(new ProcessStartInfo |
| 241 | + { |
| 242 | + FileName = DirectoryPath, |
| 243 | + UseShellExecute = true, |
| 244 | + Verb = "open", |
| 245 | + Arguments = FileNameOrFilePath |
| 246 | + }); |
| 247 | + } |
| 248 | + else |
| 249 | + { |
| 250 | + using var explorer = new Process(); |
| 251 | + explorer.StartInfo = new ProcessStartInfo |
| 252 | + { |
| 253 | + FileName = explorerInfo.Path, |
| 254 | + UseShellExecute = true, |
| 255 | + Arguments = FileNameOrFilePath is null |
| 256 | + ? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath) |
| 257 | + : explorerInfo.FileArgument |
| 258 | + .Replace("%d", DirectoryPath) |
| 259 | + .Replace("%f", |
| 260 | + Path.IsPathRooted(FileNameOrFilePath) ? FileNameOrFilePath : Path.Combine(DirectoryPath, FileNameOrFilePath) |
| 261 | + ) |
| 262 | + }; |
| 263 | + explorer.Start(); |
| 264 | + } |
246 | 265 | }
|
247 | 266 |
|
248 | 267 | private void OpenUri(Uri uri, bool? inPrivate = null)
|
|
0 commit comments