Save window time display toggle

weechat-hashes
C. McEnroe 2021-01-27 15:35:26 -05:00
parent b4c26a2cab
commit 5dde56d692
1 changed files with 5 additions and 2 deletions

7
ui.c
View File

@ -1029,7 +1029,8 @@ static const time_t Signatures[] = {
0x6C72696774616304, // no mute 0x6C72696774616304, // no mute
0x6C72696774616305, // no URLs 0x6C72696774616305, // no URLs
0x6C72696774616306, // no thresh 0x6C72696774616306, // no thresh
0x6C72696774616307, 0x6C72696774616307, // no window time
0x6C72696774616308,
}; };
static size_t signatureVersion(time_t signature) { static size_t signatureVersion(time_t signature) {
@ -1051,7 +1052,7 @@ int uiSave(const char *name) {
if (!file) return -1; if (!file) return -1;
int error = 0 int error = 0
|| writeTime(file, Signatures[6]) || writeTime(file, Signatures[7])
|| writeTime(file, self.pos); || writeTime(file, self.pos);
if (error) return error; if (error) return error;
for (uint num = 0; num < windows.len; ++num) { for (uint num = 0; num < windows.len; ++num) {
@ -1059,6 +1060,7 @@ int uiSave(const char *name) {
error = 0 error = 0
|| writeString(file, idNames[window->id]) || writeString(file, idNames[window->id])
|| writeTime(file, window->mute) || writeTime(file, window->mute)
|| writeTime(file, window->time)
|| writeTime(file, window->thresh) || writeTime(file, window->thresh)
|| writeTime(file, window->heat) || writeTime(file, window->heat)
|| writeTime(file, window->unreadSoft) || writeTime(file, window->unreadSoft)
@ -1123,6 +1125,7 @@ void uiLoad(const char *name) {
while (0 < readString(file, &buf, &cap) && buf[0]) { while (0 < readString(file, &buf, &cap) && buf[0]) {
struct Window *window = windows.ptrs[windowFor(idFor(buf))]; struct Window *window = windows.ptrs[windowFor(idFor(buf))];
if (version > 3) window->mute = readTime(file); if (version > 3) window->mute = readTime(file);
if (version > 6) window->time = readTime(file);
if (version > 5) window->thresh = readTime(file); if (version > 5) window->thresh = readTime(file);
if (version > 0) { if (version > 0) {
window->heat = readTime(file); window->heat = readTime(file);