-
-
Notifications
You must be signed in to change notification settings - Fork 345
Allow user to specify build map URL #1925
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
Conversation
… to support unit tests
I see some changes to the cache location, but it doesn't look like you've made that configurable? We've got an outstanding issue to do that. While you're working with this bit of code, can you sneak that in? |
Sure, but there's no sneaking really. The download cache directory is obtained by calling a method on a KSP instance, which has access to I had a branch going where I was working on substantial refactoring to the |
Ah, ok. So your changes here are just making the GUI properly show the downloads directory as stored in the KSP instance, rather than assuming the /downloads folder? |
@@ -67,47 +133,45 @@ private void RefreshReposListBox() | |||
|
|||
private void UpdateCacheInfo() | |||
{ | |||
m_cacheSize = 0; | |||
m_cacheFileCount = 0; | |||
var cachePath = Path.Combine(Main.Instance.CurrentInstance.CkanDir(), "downloads"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, we assumed "${CkanDir}/downloads" here - now there is a method which is more amenable to future refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'm understanding that change correctly, then.
I note that you've changed the cache clearing from removing all the files to deleting the directory. That's going to cause issues for all of us who make their downloads folder a symlink to a single location. (Though, admittedly, we're less likely to ever actually clear the cache that way). Is there a particular reason for deleting the directory rather than the files other than "it's faster"? |
The existing code tries to delete each file once, but silently gobbles all exceptions, so you'd never know if the issue was permissions vs filename not matching. Makes sense about the symlink though, I can probably just add a log line to the old catch block. |
Adding some logging sounds fine. They'll see the simple fact of a failure to clear the cache in the dialog box. |
This started off as a TODO, figured I'd develop it and it also led to making the SettingsDialog unit testable.