Skip to content

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

Closed
wants to merge 2 commits into from

Conversation

ayan4m1
Copy link
Contributor

@ayan4m1 ayan4m1 commented Oct 23, 2016

This started off as a TODO, figured I'd develop it and it also led to making the SettingsDialog unit testable.

@ayan4m1 ayan4m1 added Enhancement New features or functionality GUI Issues affecting the interactive GUI labels Oct 23, 2016
@politas
Copy link
Member

politas commented Oct 23, 2016

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?

@ayan4m1
Copy link
Contributor Author

ayan4m1 commented Oct 24, 2016

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 GameDir() and CkanDir() and outside the scope of the GUI-only Configuration object.

I had a branch going where I was working on substantial refactoring to the Main class - part of that should be making one consistent configuration object - right now all of the GUI config is managed by a class that is not available to the core project.

@politas
Copy link
Member

politas commented Oct 25, 2016

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");
Copy link
Contributor Author

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.

Copy link
Member

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.

@politas
Copy link
Member

politas commented Oct 26, 2016

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"?

@ayan4m1
Copy link
Contributor Author

ayan4m1 commented Oct 26, 2016

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.

@politas
Copy link
Member

politas commented Oct 26, 2016

Adding some logging sounds fine. They'll see the simple fact of a failure to clear the cache in the dialog box.

@ayan4m1 ayan4m1 closed this Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New features or functionality GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants