Skip to content

Commit b11864c

Browse files
committed
clean up a bit
1 parent 12a5887 commit b11864c

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

src/Application.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public class Application : Gtk.Application {
9494

9595
// Conveniently, if there is no unsaved document, we just get NULL
9696
// Which AppWindow will process as a new unsaved doc
97-
foreach (unsaved_document in pile_unsaved_documents.read_name() ) {
97+
foreach (unsaved_document in pile_unsaved_documents.read_name () ) {
9898

9999
debug (
100100
"Document is unsaved, creating an save location at: %s",

src/Utils.vala

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Slate.Utils {
88

99
public string get_new_document_name () {
1010
var name = _"New Document";
11-
11+
1212
if (created_documents > 1) {
1313
name = name + " " + created_documents.to_string ();
1414
}
@@ -26,14 +26,12 @@ namespace Slate.Utils {
2626
public void check_if_datadir () {
2727
debug ("do we have a data directory?");
2828
var data_directory = File.new_for_path (Environment.get_user_data_dir ());
29-
try {
30-
if (!data_directory.query_exists ()) {
31-
data_directory.make_directory ();
32-
print("Prepared target data directory");
33-
}
34-
} catch (Error e) {
35-
warning ("Failed to prepare target data directory %s\n", e.message);
36-
}
37-
}
38-
29+
try {
30+
if (!data_directory.query_exists ()) {
31+
data_directory.make_directory ();
32+
}
33+
} catch (Error e) {
34+
warning ("Failed to prepare target data directory %s\n", e.message);
35+
}
36+
}
3937
}

src/Window.vala

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,9 @@ public class AppWindow : Gtk.Window {
9090

9191
debug ("Success!");
9292

93-
94-
if (document == null) {
95-
new_empty_doc ();
96-
}
97-
9893
open_file (document);
9994
}
10095

101-
10296
/* ---------------- FILE OPERATIONS ---------------- */
10397
public void open_file (File? file = this.file) {
10498
debug ("Attempting to open file %s", file.get_basename ());
@@ -134,7 +128,7 @@ public class AppWindow : Gtk.Window {
134128
// We have to always check if nothing happened to datadir
135129
// This way if the user deleted in the meantime everything, we still can save unsaved docs
136130
if (is_new) {
137-
Slate.Utils.check_if_datadir;
131+
Slate.Utils.check_if_datadir ();
138132
}
139133

140134
try {

0 commit comments

Comments
 (0)