attempt to fix LDC build

This commit is contained in:
Vadim Lopatin 2020-07-29 09:28:30 +03:00
parent 2b1057b037
commit 21cbc9b6d3
1 changed files with 4 additions and 14 deletions

View File

@ -1402,12 +1402,7 @@ class ListWidget : WidgetGroup, OnScrollHandler, OnAdapterChangeHandler {
class StringListWidget : ListWidget { class StringListWidget : ListWidget {
import std.conv : to; import std.conv : to;
version(DigitalMars) {
import std.datetime.stopwatch : StopWatch; import std.datetime.stopwatch : StopWatch;
} else {
import std.datetime.stopwatch : StopWatch;
import std.datetime : dto = to;
}
import core.time : dur; import core.time : dur;
private dstring _searchString; private dstring _searchString;
@ -1486,15 +1481,10 @@ class StringListWidget : ListWidget {
if (event.action == KeyAction.Text) { if (event.action == KeyAction.Text) {
if ( !_stopWatch.running) { _stopWatch.start; } if ( !_stopWatch.running) { _stopWatch.start; }
version(DigitalMars) {
auto timePassed = _stopWatch.peek; //.to!("seconds", float)(); // dtop is std.datetime.to auto timePassed = _stopWatch.peek; //.to!("seconds", float)(); // dtop is std.datetime.to
if (timePassed > dur!"msecs"(500)) _searchString = ""d; if (timePassed > dur!"msecs"(500))
} else { _searchString = ""d;
auto timePassed = _stopWatch.peek.dto!("seconds", float)(); // dtop is std.datetime.to
if (timePassed > 0.5) _searchString = ""d;
}
_searchString ~= to!dchar(event.text.toUTF8); _searchString ~= to!dchar(event.text.toUTF8);
_stopWatch.reset; _stopWatch.reset;