From 693f8d2d664afe06513910a7b2fe5b4dbaa03077 Mon Sep 17 00:00:00 2001 From: lainsce Date: Wed, 20 Sep 2023 15:56:35 -0300 Subject: [PATCH] * --- src/Services/FileManager.vala | 32 ++++++++++++++++---------------- src/Utils/MiscUtils.vala | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Services/FileManager.vala b/src/Services/FileManager.vala index 7f9a3b2..2e9dd81 100644 --- a/src/Services/FileManager.vala +++ b/src/Services/FileManager.vala @@ -8,12 +8,12 @@ namespace Khronos.FileManager { tasks += "task,timedate,tags\n"; for (i = 0; i < n; i++) { var item = view_model.logs.get_item (i); - tasks += "\"" + ((Log)item).name.replace ("\"", "") + - "\",\"" + ((Log)item).timedate.replace ("\"", "").replace ("\n", "") + + tasks += "\"" + ((Log)item).name.replace("\"", "") + + "\",\"" + ((Log)item).timedate.replace("\"", "").replace("\n", "") + "\",\"" + ((Log)item).tags + "\"\n"; } - GLib.FileUtils.set_contents (file.get_path (), tasks); + GLib.FileUtils.set_contents (file.get_path(), tasks); } public async Gee.ArrayList load_as () throws Error { @@ -36,25 +36,25 @@ namespace Khronos.FileManager { line = line.strip (); if (line.has_prefix ("\"")) { GLib.DateTime dt = new GLib.DateTime.now_local (); - string[] logged = line.replace ("\"", "").strip ().split (","); + string[] logged = line.replace ("\"", "").strip().split(","); GLib.DateTime taskdt = new GLib.DateTime.local (dt.get_year (), - int.parse (logged[2].substring (1, 2)), - int.parse (logged[2].substring (4, 2)), - int.parse (logged[2].substring (7, 2)), - int.parse (logged[2].substring (12, 2)), - double.parse (logged[2].substring (17, 2))); + int.parse(logged[2].substring(1,2)), + int.parse(logged[2].substring(4,2)), + int.parse(logged[2].substring(7,2)), + int.parse(logged[2].substring(12,2)), + double.parse(logged[2].substring(17,2))); current_log = new Log (); current_log.name = logged[0]; - current_log.timedate = "%s\n%s – %s".printf (logged[1].substring(0, 12), - ("%s").printf (logged[1].substring (13, 3) + ", " + logged[2].substring (0, 20)), + current_log.timedate = "%s\n%s – %s".printf(logged[1].substring(0,12), + ("%s").printf (logged[1].substring(13,3) + ", " + logged[2].substring(0,20)), ("%s").printf (taskdt.add_full (dt.get_year (), - int.parse (logged[2].substring (1, 2)), - int.parse (logged[2].substring (4, 2)), - int.parse (logged[1].substring (1, 2)), - int.parse (logged[1].substring (5, 2)), - double.parse (logged[1].substring (10, 2))).format ("%H∶%M∶%S"))); + int.parse(logged[2].substring(1,2)), + int.parse(logged[2].substring(4,2)), + int.parse(logged[1].substring(1,2)), + int.parse(logged[1].substring(5,2)), + double.parse(logged[1].substring(10,2))).format ("%H∶%M∶%S"))); current_log.tags = logged[3]; logs.add (current_log); diff --git a/src/Utils/MiscUtils.vala b/src/Utils/MiscUtils.vala index 8f28755..3e6a210 100644 --- a/src/Utils/MiscUtils.vala +++ b/src/Utils/MiscUtils.vala @@ -23,6 +23,6 @@ namespace Khronos.MiscUtils { return (T) ancestor; } - return null; + return (T) ancestor; } }