Windows: use wcsftime instead of strftime
This commit is contained in:
@@ -491,23 +491,21 @@ void Preview::setCurTabProps(const Rcl::Doc &doc, int docnum)
|
||||
int curidx = pvTab->currentIndex();
|
||||
pvTab->setTabText(curidx, title);
|
||||
|
||||
char datebuf[100];
|
||||
datebuf[0] = 0;
|
||||
string datebuf;
|
||||
if (!doc.fmtime.empty() || !doc.dmtime.empty()) {
|
||||
time_t mtime = doc.dmtime.empty() ?
|
||||
atoll(doc.fmtime.c_str()) : atoll(doc.dmtime.c_str());
|
||||
struct tm *tm = localtime(&mtime);
|
||||
strftime(datebuf, 99, "%Y-%m-%d %H:%M:%S", tm);
|
||||
datebuf = utf8datestring("%Y-%m-%d %H:%M:%S", tm);
|
||||
}
|
||||
LOGDEB("Doc.url: [" << doc.url << "]\n");
|
||||
string url;
|
||||
printableUrl(theconfig->getDefCharset(), doc.url, url);
|
||||
string tiptxt = url + string("\n");
|
||||
tiptxt += doc.mimetype + " " + string(datebuf) + "\n";
|
||||
tiptxt += doc.mimetype + " " + datebuf + "\n";
|
||||
if (!ctitle.empty())
|
||||
tiptxt += ctitle + "\n";
|
||||
pvTab->setTabToolTip(curidx,
|
||||
QString::fromUtf8(tiptxt.c_str(), tiptxt.length()));
|
||||
pvTab->setTabToolTip(curidx, u8s2qs(tiptxt));
|
||||
|
||||
PreviewTextEdit *e = currentEditor();
|
||||
if (e) {
|
||||
|
||||
@@ -194,26 +194,22 @@ static string dategetter(const string&, const Rcl::Doc& doc)
|
||||
{
|
||||
string sdate;
|
||||
if (!doc.dmtime.empty() || !doc.fmtime.empty()) {
|
||||
char datebuf[100];
|
||||
datebuf[0] = 0;
|
||||
time_t mtime = doc.dmtime.empty() ?
|
||||
atoll(doc.fmtime.c_str()) : atoll(doc.dmtime.c_str());
|
||||
struct tm *tm = localtime(&mtime);
|
||||
strftime(datebuf, 99, "%Y-%m-%d", tm);
|
||||
transcode(datebuf, sdate, RclConfig::getLocaleCharset(), "UTF-8");
|
||||
sdate = utf8datestring("%Y-%m-%d", tm);
|
||||
}
|
||||
return sdate;
|
||||
}
|
||||
|
||||
static string datetimegetter(const string&, const Rcl::Doc& doc)
|
||||
{
|
||||
char datebuf[100];
|
||||
datebuf[0] = 0;
|
||||
string datebuf;
|
||||
if (!doc.dmtime.empty() || !doc.fmtime.empty()) {
|
||||
time_t mtime = doc.dmtime.empty() ?
|
||||
atoll(doc.fmtime.c_str()) : atoll(doc.dmtime.c_str());
|
||||
struct tm *tm = localtime(&mtime);
|
||||
strftime(datebuf, 99, prefs.creslistdateformat.c_str(), tm);
|
||||
datebuf = utf8datestring(prefs.creslistdateformat.c_str(), tm);
|
||||
}
|
||||
return datebuf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user