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.  
  23. // .. e anche quella dei download
  24. tasks = new Dizzy.TaskTreeView (tasklist);
  25.  
  26. // Carichiamo qualche impostazione di default
  27. string downloadpath = config.GetValue("download_folder");
  28. if (downloadpath != "")
  29. downloadpathchooser.SetFilename(downloadpath);
  30.  
  31. this.protocol = new Protocol (ref this.config);
  32.  
  33. this.protocol.AuthenticationRequired += this.Connect;
  34. Log.StatusBarUpdate += this.OnStatusBarUpdate;
  35.  
  36. }
  37.  
  38. public void OnStatusBarUpdate (string message)
  39. {
  40. dizzystatus.Push(0, message);
  41. }
  42.  
  43.  
  44. protected void Connect ()
  45. {
  46. if (this.a != null)
  47. return;
  48. this.a = new AuthDialog (ref this.config);
  49. a.Run ();
  50. a.Destroy ();
  51. a = null;
  52.  
  53. }
  54.  
  55. public static bool OnAuthenticationFailed () {
  56.  
  57. Log.Error ("Autenticazione fallita");
  58.  
  59. MessageDialog d = new Gtk.MessageDialog(null,
  60. Gtk.DialogFlags.DestroyWithParent,
  61. Gtk.MessageType.Error,
  62. Gtk.ButtonsType.Ok, "");
  63. d.Markup = "Autenticazione fallita.";
  64. d.Run ();
  65. d.Destroy ();
  66. return false;
  67. }
  68.  
  69.  
  70. protected void OnDeleteEvent (object sender, DeleteEventArgs a)
  71. {
  72. if (protocol != null)
  73. protocol.Disconnect ();
  74.  
  75. Application.Quit ();
  76.  
  77. // Questo è molto grezzo ma è effettivamente l'unico metodo per uscire
  78. // per il momento.
  79. this.Destroy ();
  80. a.RetVal = true;
  81. }
  82.  
  83. protected virtual void OnSearchRequested (object sender, System.EventArgs e)
  84. {
  85. this.files.Clear ();
  86. this.files.SearchInProgress ();
  87. this.protocol.Search (searchBox.Text, ref this.files);
  88. }
  89.  
  90. protected virtual void OnRowActivated (object o, Gtk.RowActivatedArgs args)
  91. {
  92.  
  93. File f = this.files.GetFileFromPath (args.Path);
  94.  
  95. // Piccolo hack per evitare che ci freghino :)
  96. if(f.name == "Ricerca in corso..." && f.user == " ")
  97. return;
  98. // this.tasks.AddTask (f.name, 24);
  99. string download_folder = this.downloadpathchooser.Filename;
  100.  
  101. this.protocol.Download(f, ref tasks, download_folder);
  102.  
  103. }
  104.  
  105. protected virtual void OnDownloadPathSelectionChanged (object sender, System.EventArgs e)
  106. {
  107. config.InsertValue("download_folder", downloadpathchooser.Filename);
  108. }
  109.  
  110. }