File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 327
327
<system : String x : Key =" clearlogfolderMessage" >Are you sure you want to delete all logs?</system : String >
328
328
<system : String x : Key =" clearcachefolder" >Clear Caches</system : String >
329
329
<system : String x : Key =" clearcachefolderMessage" >Are you sure you want to delete all caches?</system : String >
330
+ <system : String x : Key =" clearfolderfailMessage" >Failed to clear folders and files</system : String >
330
331
<system : String x : Key =" welcomewindow" >Wizard</system : String >
331
332
<system : String x : Key =" userdatapath" >User Data Location</system : String >
332
333
<system : String x : Key =" userdatapathToolTip" >User settings and installed plugins are saved in the user data folder. This location may vary depending on whether it's in portable mode or not.</system : String >
Original file line number Diff line number Diff line change @@ -103,7 +103,15 @@ private void AskClearLogFolderConfirmation()
103
103
104
104
if ( confirmResult == MessageBoxResult . Yes )
105
105
{
106
- ClearLogFolder ( ) ;
106
+ try
107
+ {
108
+ ClearLogFolder ( ) ;
109
+ }
110
+ catch ( Exception e )
111
+ {
112
+ App . API . LogException ( nameof ( SettingsPaneAboutViewModel ) , "Failed to clear log folder" , e ) ;
113
+ App . API . ShowMsgBox ( App . API . GetTranslation ( "clearfolderfailMessage" ) ) ;
114
+ }
107
115
}
108
116
}
109
117
@@ -118,7 +126,15 @@ private void AskClearCacheFolderConfirmation()
118
126
119
127
if ( confirmResult == MessageBoxResult . Yes )
120
128
{
121
- ClearCacheFolder ( ) ;
129
+ try
130
+ {
131
+ ClearCacheFolder ( ) ;
132
+ }
133
+ catch ( Exception e )
134
+ {
135
+ App . API . LogException ( nameof ( SettingsPaneAboutViewModel ) , "Failed to clear cache folder" , e ) ;
136
+ App . API . ShowMsgBox ( App . API . GetTranslation ( "clearfolderfailMessage" ) ) ;
137
+ }
122
138
}
123
139
}
124
140
@@ -202,8 +218,7 @@ private static string BytesToReadableString(long bytes)
202
218
203
219
foreach ( string order in orders )
204
220
{
205
- if ( bytes > max )
206
- return $ "{ decimal . Divide ( bytes , max ) : ##.##} { order } ";
221
+ if ( bytes > max ) return $ "{ decimal . Divide ( bytes , max ) : ##.##} { order } ";
207
222
208
223
max /= scale ;
209
224
}
You can’t perform that action at this time.
0 commit comments