viewgit/index.php:465 Only variables should be passed by reference [2048]

viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]

  1. using System;
  2. using Gtk;
  3. using Dizzy;
  4.  
  5. public partial class MainWindow : Gtk.Window
  6. {
  7.  
  8. Protocol protocol;
  9. FileTreeView files;
  10. TaskTreeView tasks;
  11. GlobalConfig config;
  12.  
  13. bool connected = false;
  14.  
  15. public MainWindow (ref GlobalConfig config) : base(Gtk.WindowType.Toplevel)
  16. {
  17.  
  18. Build ();
  19. this.config = config;
  20.  
  21. // Inizializziamo la vista dei file.
  22. files = new Dizzy.FileTreeView (filelist);
  23.  
  24. // .. e anche quella dei download
  25. tasks = new Dizzy.TaskTreeView (tasklist);
  26.  
  27. // Carichiamo qualche impostazione di default
  28. string downloadpath = config.GetValue("download_folder");
  29. if (downloadpath != "")
  30. downloadpathchooser.SetFilename(downloadpath);
  31.  
  32. this.Connect ();
  33. }
  34.  
  35. protected void Connect ()
  36. {
  37. this.connected = true;
  38. try {
  39. this.protocol = new Protocol (ref config);
  40. } catch (Exception ex) {
  41. this.connected = false;
  42. Gtk.MessageDialog d = new Gtk.MessageDialog(this,
  43. DialogFlags.Modal,
  44. MessageType.Error,
  45. ButtonsType.Ok,
  46. true,"");
  47. d.Markup = "Errore di autenticazione. Non è stato possibile connettersi" +
  48. "all'host <b>poisson.phc.unipi.it</b>.";
  49. d.Run ();
  50. d.Destroy ();
  51. }
  52. }
  53.  
  54.  
  55. protected void OnDeleteEvent (object sender, DeleteEventArgs a)
  56. {
  57. protocol.Disconnect ();
  58. Application.Quit ();
  59.  
  60. // Questo è molto grezzo ma è effettivamente l'unico metodo per uscire
  61. // per il momento.
  62. this.Destroy ();
  63. a.RetVal = true;
  64. }
  65.  
  66. protected virtual void OnSearchRequested (object sender, System.EventArgs e)
  67. {
  68. if(!connected) {this.Connect ();}
  69. if(connected)
  70. {
  71. this.files.SearchInProgress ();
  72. this.protocol.Search(searchBox.Text, ref this.files);
  73. }
  74. }
  75.  
  76. protected virtual void OnRowActivated (object o, Gtk.RowActivatedArgs args)
  77. {
  78. Console.WriteLine("row_activated called");
  79. File f = this.files.GetFileFromPath (args.Path);
  80. // this.tasks.AddTask (f.name, 24);
  81. string download_folder = this.downloadpathchooser.Filename;
  82.  
  83. if(!connected) {this.Connect ();}
  84. if(connected) {this.protocol.Download(f, ref tasks, download_folder);}
  85.  
  86. }
  87.  
  88. protected virtual void OnDownloadPathSelectionChanged (object sender, System.EventArgs e)
  89. {
  90. config.InsertValue("download_folder", downloadpathchooser.Filename);
  91. }
  92.  
  93.  
  94. }