File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,12 @@ public class Application : Gtk.Application {
8989 print (unsaved_doc);
9090 string path = Path . build_filename (data_dir_path, unsaved_doc);
9191 File file = File . new_for_path (path);
92- open_file (file);
92+
93+ bool ret = open_file (file);
94+ if (! ret) {
95+ continue ;
96+ }
97+
9398 created_documents++ ;
9499 }
95100
@@ -160,15 +165,16 @@ public class Application : Gtk.Application {
160165
161166 }
162167
163- public void open_file (File file ) {
164- if (file. query_file_type (FileQueryInfoFlags . NONE ) == FileType . REGULAR ) {
165- var new_window = new AppWindow (file);
166- add_window (new_window);
167- new_window. present ();
168- } else {
168+ public bool open_file (File file ) {
169+ if (file. query_file_type (FileQueryInfoFlags . NONE ) != FileType . REGULAR ) {
169170 warning (" Couldn't open, not a regular file." );
171+ return false ;
170172 }
171173
174+ var new_window = new AppWindow (file);
175+ add_window (new_window);
176+ new_window. present ();
177+ return true ;
172178 }
173179
174180 public void on_open_document () {
You can’t perform that action at this time.
0 commit comments