ldc build fix-2

This commit is contained in:
Denis Feklushkin 2017-10-22 15:51:41 +07:00
parent 0984376266
commit 02d8833cda
1 changed files with 9 additions and 4 deletions

View File

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