Skip to content

Commit e05809d

Browse files
committed
Read file name and selected path after show dialog function
1 parent 1cfb69d commit e05809d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,12 @@ private void SelectPath_OnClick(object commandParameter, RoutedEventArgs e)
164164
CheckPathExists = true
165165
};
166166

167-
var path = openFileDialog.FileName;
168167
if (openFileDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK ||
169-
string.IsNullOrEmpty(path))
168+
string.IsNullOrEmpty(openFileDialog.FileName))
170169
return;
171170

172171
// Remove ending directory separator because it can cause path type checking issues
173-
path = Path.TrimEndingDirectorySeparator(path);
174-
SelectedPath = path;
172+
SelectedPath = Path.TrimEndingDirectorySeparator(openFileDialog.FileName);
175173
}
176174
else // Folder selection
177175
{
@@ -180,14 +178,12 @@ private void SelectPath_OnClick(object commandParameter, RoutedEventArgs e)
180178
ShowNewFolderButton = true
181179
};
182180

183-
var path = folderBrowserDialog.SelectedPath;
184181
if (folderBrowserDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK ||
185-
string.IsNullOrEmpty(path))
182+
string.IsNullOrEmpty(folderBrowserDialog.SelectedPath))
186183
return;
187184

188185
// Remove ending directory separator because it can cause path type checking issues
189-
path = Path.TrimEndingDirectorySeparator(path);
190-
SelectedPath = path;
186+
SelectedPath = Path.TrimEndingDirectorySeparator(folderBrowserDialog.SelectedPath);
191187
}
192188
}
193189

0 commit comments

Comments
 (0)