Lessen warnings on build
This commit is contained in:
		
							parent
							
								
									f7b14727c2
								
							
						
					
					
						commit
						59033b3a1a
					
				|  | @ -24,7 +24,6 @@ modules: | ||||||
|   - name: easyssh |   - name: easyssh | ||||||
|     buildsystem: meson |     buildsystem: meson | ||||||
|     config-opts: |     config-opts: | ||||||
|     - '-Dlibunity=false' |  | ||||||
|     - '-Dubuntu-bionic-patched-vte=false' |     - '-Dubuntu-bionic-patched-vte=false' | ||||||
|     - '-Dpatched-vte=true' |     - '-Dpatched-vte=true' | ||||||
|     sources: |     sources: | ||||||
|  |  | ||||||
|  | @ -135,7 +135,7 @@ namespace EasySSH { | ||||||
| 
 | 
 | ||||||
|             var paned = new Gtk.Paned (Gtk.Orientation.HORIZONTAL); |             var paned = new Gtk.Paned (Gtk.Orientation.HORIZONTAL); | ||||||
|             box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); |             box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); | ||||||
|             box.margin_left = 5; |             box.margin_start = 5; | ||||||
|             welcome = new Welcome(); |             welcome = new Welcome(); | ||||||
|             welcome_accounts = new WelcomeAccounts(); |             welcome_accounts = new WelcomeAccounts(); | ||||||
|             box.add(welcome); |             box.add(welcome); | ||||||
|  | @ -931,9 +931,6 @@ namespace EasySSH { | ||||||
| 
 | 
 | ||||||
|         public Host edit_host(string old_name, Host e_host) { |         public Host edit_host(string old_name, Host e_host) { | ||||||
|             var host = hostmanager.get_host_by_name(old_name); |             var host = hostmanager.get_host_by_name(old_name); | ||||||
|             if(host == null){ |  | ||||||
|                 return null; |  | ||||||
|             } |  | ||||||
|             var group = hostmanager.get_group_by_name(host.group); |             var group = hostmanager.get_group_by_name(host.group); | ||||||
|             e_host.notebook = host.notebook; |             e_host.notebook = host.notebook; | ||||||
|             if(host.group == e_host.group) { |             if(host.group == e_host.group) { | ||||||
|  | @ -1066,24 +1063,11 @@ namespace EasySSH { | ||||||
|             } |             } | ||||||
|             #endif |             #endif | ||||||
|             var file = File.new_for_path (Application.settings.get_string ("hosts-folder").replace ("%20", " ") + filename); |             var file = File.new_for_path (Application.settings.get_string ("hosts-folder").replace ("%20", " ") + filename); | ||||||
|             { |             write_data_to_file (file, data); | ||||||
|                 if (file.query_exists ()) { |  | ||||||
|                     file.delete (); |  | ||||||
|                 } |  | ||||||
|                 var dos = new DataOutputStream (file.create (FileCreateFlags.REPLACE_DESTINATION)); |  | ||||||
| 
 |  | ||||||
|                 dos.put_string (data); |  | ||||||
|             } |  | ||||||
| 
 | 
 | ||||||
|             if(Application.settings.get_boolean ("sync-ssh-config")){ |             if(Application.settings.get_boolean ("sync-ssh-config")){ | ||||||
|                 var file_ssh = File.new_for_path (Environment.get_home_dir () + "/.ssh/config"); |                 var file_ssh = File.new_for_path (Environment.get_home_dir () + "/.ssh/config"); | ||||||
|                 { |                 write_data_to_file (file_ssh, data_ssh_config); | ||||||
|                     if (file_ssh.query_exists ()) { |  | ||||||
|                         file_ssh.delete (); |  | ||||||
|                     } |  | ||||||
|                     var dos_ssh = new DataOutputStream (file_ssh.create (FileCreateFlags.REPLACE_DESTINATION)); |  | ||||||
|                     dos_ssh.put_string (data_ssh_config); |  | ||||||
|                 } |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | @ -1119,15 +1103,7 @@ namespace EasySSH { | ||||||
|             } |             } | ||||||
|             #endif |             #endif | ||||||
|             var file = File.new_for_path (Application.settings.get_string ("hosts-folder").replace ("%20", " ") + filename); |             var file = File.new_for_path (Application.settings.get_string ("hosts-folder").replace ("%20", " ") + filename); | ||||||
|             { |             write_data_to_file (file, data); | ||||||
|                 if (file.query_exists ()) { |  | ||||||
|                     file.delete (); |  | ||||||
|                 } |  | ||||||
|                 var dos = new DataOutputStream (file.create (FileCreateFlags.REPLACE_DESTINATION)); |  | ||||||
| 
 |  | ||||||
|                 dos.put_string (data); |  | ||||||
|             } |  | ||||||
| 
 |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         public void save_bookmarks() { |         public void save_bookmarks() { | ||||||
|  | @ -1160,15 +1136,7 @@ namespace EasySSH { | ||||||
|             } |             } | ||||||
|             #endif |             #endif | ||||||
|             var file = File.new_for_path (Application.settings.get_string ("hosts-folder").replace ("%20", " ") + filename); |             var file = File.new_for_path (Application.settings.get_string ("hosts-folder").replace ("%20", " ") + filename); | ||||||
|             { |             write_data_to_file (file, data); | ||||||
|                 if (file.query_exists ()) { |  | ||||||
|                     file.delete (); |  | ||||||
|                 } |  | ||||||
|                 var dos = new DataOutputStream (file.create (FileCreateFlags.REPLACE_DESTINATION)); |  | ||||||
| 
 |  | ||||||
|                 dos.put_string (data); |  | ||||||
|             } |  | ||||||
| 
 |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         public void backup_ssh_config() { |         public void backup_ssh_config() { | ||||||
|  | @ -1475,5 +1443,22 @@ namespace EasySSH { | ||||||
|             } |             } | ||||||
|             message_dialog.destroy (); |             message_dialog.destroy (); | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|  |         private void write_data_to_file (File file, string data) { | ||||||
|  |             if (file.query_exists ()) { | ||||||
|  |                 try { | ||||||
|  |                     file.delete (); | ||||||
|  |                 } catch (Error e) { | ||||||
|  |                     warning (e.message); | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             try { | ||||||
|  |                 var dos = new DataOutputStream (file.create (FileCreateFlags.REPLACE_DESTINATION)); | ||||||
|  |                 dos.put_string (data); | ||||||
|  |             } catch (Error e) { | ||||||
|  |                 warning (e.message); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -217,7 +217,6 @@ namespace EasySSH { | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         private void term_send(string cmd) { |         private void term_send(string cmd) { | ||||||
|             var n_cmd = cmd + "\n"; |  | ||||||
|             #if UBUNTU_BIONIC_PATCHED_VTE |             #if UBUNTU_BIONIC_PATCHED_VTE | ||||||
|                 term.feed_child(cmd, cmd.length); |                 term.feed_child(cmd, cmd.length); | ||||||
|             #else  |             #else  | ||||||
|  |  | ||||||
|  | @ -134,7 +134,7 @@ namespace EasySSH { | ||||||
| 
 | 
 | ||||||
|                     if (uri != null && ! get_has_selection ()) { |                     if (uri != null && ! get_has_selection ()) { | ||||||
|                         try { |                         try { | ||||||
|                             Gtk.show_uri (null, uri, Gtk.get_current_event_time ()); |                             Gtk.show_uri_on_window (window, uri, Gtk.get_current_event_time ()); | ||||||
|                         } catch (GLib.Error error) { |                         } catch (GLib.Error error) { | ||||||
|                             warning ("Could Not Open link"); |                             warning ("Could Not Open link"); | ||||||
|                         } |                         } | ||||||
|  | @ -171,8 +171,12 @@ namespace EasySSH { | ||||||
| 
 | 
 | ||||||
|         public void active_shell() { |         public void active_shell() { | ||||||
|             if(ssh){ |             if(ssh){ | ||||||
|                 this.spawn_sync(Vte.PtyFlags.DEFAULT, null, {"/bin/sh"}, |                 try { | ||||||
|                                         null, SpawnFlags.SEARCH_PATH, null, out this.child_pid, null); |                     this.spawn_sync(Vte.PtyFlags.DEFAULT, null, {"/bin/sh"}, | ||||||
|  |                                                 null, SpawnFlags.SEARCH_PATH, null, out this.child_pid, null); | ||||||
|  |                 } catch (Error e) { | ||||||
|  |                     warning (e.message); | ||||||
|  |                 } | ||||||
|             }else{ |             }else{ | ||||||
|                 string dir = GLib.Environment.get_current_dir (); |                 string dir = GLib.Environment.get_current_dir (); | ||||||
|                 var shell = Vte.get_user_shell (); |                 var shell = Vte.get_user_shell (); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue