mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Try to avoid recurion and comment
This commit is contained in:
parent
7270c9f35d
commit
a70b9fcb2d
2 changed files with 5 additions and 3 deletions
|
|
@ -519,6 +519,10 @@ namespace Flow.Launcher
|
|||
{
|
||||
if (DateFormat != null && TimeFormat != null)
|
||||
{
|
||||
if (DateFormat.SelectedIndex == -1 || TimeFormat.SelectedIndex == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
viewModel.UpdateDateTimeDisplayList(DateFormat.SelectedIndex, TimeFormat.SelectedIndex);
|
||||
DateFormat.Items.Refresh();
|
||||
TimeFormat.Items.Refresh(); // selected = -1
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace Flow.Launcher.ViewModel
|
|||
int tmp = 0;
|
||||
TimeFormatIndex = (tmp = TimeFormatList.FindIndex(x => x.Equals(Settings.TimeFormat))) >= 0 ? tmp : 0;
|
||||
DateFormatIndex = (tmp = DateFormatList.FindIndex(x => x.Equals(Settings.DateFormat))) >= 0 ? tmp : 0;
|
||||
|
||||
// TODO: CurrentCulture may equal to settings.language when this is constructed
|
||||
TimeFormatDisplayList = TimeFormatList.Select(x => DateTime.Now.ToString(x, CultureInfo.CurrentCulture)).ToList();
|
||||
DateFormatDisplayList = DateFormatList.Select(x => DateTime.Now.ToString(x, CultureInfo.CurrentCulture)).ToList();
|
||||
UpdateSettingsDateTimeFormat(); // just in case something wrong
|
||||
|
|
@ -492,8 +492,6 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
public void UpdateDateTimeDisplayList(int dateIndex, int timeIndex)
|
||||
{
|
||||
if (dateIndex == -1 || timeIndex == -1)
|
||||
return;
|
||||
DateFormatIndex = dateIndex;
|
||||
TimeFormatIndex = timeIndex;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue