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. AuthDialog a;
  13.  
  14. public MainWindow (ref GlobalConfig config) : base(Gtk.WindowType.Toplevel)
  15. {
  16.  
  17. Build ();
  18. this.config = config;
  19.  
  20. // Inizializziamo la vista dei file.
  21. files = new Dizzy.FileTreeView (filelist);
  22. EventManager.RegisterFileTreeView (ref files);
  23.  
  24. // .. e anche quella dei download
  25. tasks = new Dizzy.TaskTreeView (tasklist);
  26. EventManager.RegisterTaskTreeView (ref tasks);
  27.  
  28. // Carichiamo qualche impostazione di default
  29. string downloadpath = config.GetValue("download_folder");
  30. if (downloadpath != "")
  31. downloadpathchooser.SetFilename(downloadpath);
  32.  
  33. this.protocol = new Protocol (ref this.config);
  34.  
  35. this.protocol.AuthenticationRequired += this.Connect;
  36. Log.StatusBarUpdate += this.OnStatusBarUpdate;
  37.  
  38. }
  39.  
  40. public void OnStatusBarUpdate (string message)
  41. {
  42. dizzystatus.Push(0, message);
  43. }
  44.  
  45.  
  46. protected void Connect ()
  47. {
  48. if (this.a != null)
  49. return;
  50. this.a = new AuthDialog (ref this.config);
  51. a.Run ();
  52. a.Destroy ();
  53. a = null;
  54.  
  55. }
  56.  
  57.  
  58. protected void OnDeleteEvent (object sender, DeleteEventArgs a)
  59. {
  60. if (protocol != null)
  61. protocol.Disconnect ();
  62.  
  63. Application.Quit ();
  64.  
  65. // Questo è molto grezzo ma è effettivamente l'unico metodo per uscire
  66. // per il momento.
  67. this.Destroy ();
  68. a.RetVal = true;
  69. }
  70.  
  71. protected virtual void OnSearchRequested (object sender, System.EventArgs e)
  72. {
  73. this.files.Clear ();
  74. EventManager.SearchStarted ();
  75. this.protocol.Search (searchBox.Text);
  76. }
  77.  
  78. protected virtual void OnRowActivated (object o, Gtk.RowActivatedArgs args)
  79. {
  80.  
  81. File f = this.files.GetFileFromPath (args.Path);
  82.  
  83. string download_folder = this.downloadpathchooser.Filename;
  84.  
  85. this.protocol.Download(f, ref tasks, download_folder);
  86.  
  87. }
  88.  
  89. protected virtual void OnDownloadPathSelectionChanged (object sender, System.EventArgs e)
  90. {
  91. config.InsertValue("download_folder", downloadpathchooser.Filename);
  92. }
  93.  
  94. }