Fix a bug when formatting time strings
It seems that 'strftime()' (on Windows) works differently from its non-Windows counterparts. Specifically, some formatting options (e.g. %F) are not recognised in the Windows implementation. Fortunately, glibmm comes to our rescue here! So let's use the glib implementation which will hopefully work the same on all platforms.
This commit is contained in:
parent
22d1f1268b
commit
ab76a49b22
@ -2733,14 +2733,8 @@ ARDOUR_UI::snapshot_session (bool switch_to_it)
|
|||||||
if (switch_to_it) {
|
if (switch_to_it) {
|
||||||
prompter.set_initial_text (_session->snap_name());
|
prompter.set_initial_text (_session->snap_name());
|
||||||
} else {
|
} else {
|
||||||
char timebuf[128];
|
Glib::DateTime tm (g_date_time_new_now_local ());
|
||||||
time_t n;
|
prompter.set_initial_text (tm.format ("%FT%H.%M.%S"));
|
||||||
struct tm local_time;
|
|
||||||
|
|
||||||
time (&n);
|
|
||||||
localtime_r (&n, &local_time);
|
|
||||||
strftime (timebuf, sizeof(timebuf), "%FT%H.%M.%S", &local_time);
|
|
||||||
prompter.set_initial_text (timebuf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user