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; } }