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.  
  29. // Carichiamo qualche impostazione di default
  30. string downloadpath = config.GetValue("download_folder");
  31. if (downloadpath != "")
  32. downloadpathchooser.SetFilename(downloadpath);
  33.  
  34.  
  35.  
  36. this.protocol = new Protocol (ref this.config);
  37. this.protocol.AuthenticationRequired += this.Connect;
  38.  
  39. Log.StatusBarUpdate += this.OnStatusBarUpdate;
  40.  
  41. }
  42.  
  43. public void OnStatusBarUpdate (string message)
  44. {
  45. dizzystatus.Push(0, message);
  46. }
  47.  
  48.  
  49. protected void Connect ()
  50. {
  51. if (this.a != null)
  52. return;
  53. this.a = new AuthDialog (ref this.config);
  54. a.Run ();
  55. a.Destroy ();
  56. a = null;
  57.  
  58. }
  59.  
  60.  
  61. protected void OnDeleteEvent (object sender, DeleteEventArgs a)
  62. {
  63. if (protocol != null)
  64. {
  65. Log.Info ("Calling Protocol.Disconnect ()");
  66. protocol.Disconnect ();
  67. }
  68.  
  69. Application.Quit ();
  70.  
  71. // Questo è molto grezzo ma è effettivamente l'unico metodo per uscire
  72. // per il momento.
  73. this.Destroy ();
  74. a.RetVal = true;
  75. }
  76.  
  77. protected virtual void OnSearchRequested (object sender, System.EventArgs e)
  78. {
  79. this.files.Clear ();
  80. EventManager.SearchStarted ();
  81. this.protocol.Search (searchBox.Text, searchUserBox.Text, typeBox.ActiveText);
  82. }
  83.  
  84. protected virtual void OnRowActivated (object o, Gtk.RowActivatedArgs args)
  85. {
  86.  
  87. File f = this.files.GetFileFromPath (args.Path);
  88.  
  89. string download_folder = this.downloadpathchooser.Filename;
  90.  
  91. this.protocol.Download(f, download_folder);
  92.  
  93. }
  94.  
  95. protected virtual void OnDownloadPathSelectionChanged (object sender, System.EventArgs e)
  96. {
  97. config.InsertValue("download_folder", downloadpathchooser.Filename);
  98. }
  99.  
  100. protected virtual void OnListUpdateRequired (object sender, System.EventArgs e)
  101. {
  102. this.protocol.UpdateFileList ();
  103. }
  104.  
  105. protected virtual void OnDisconnectionRequested (object sender, System.EventArgs e)
  106. {
  107. this.config.authenticated = false;
  108. }
  109.  
  110. protected virtual void OnUploadRequested (object sender, System.EventArgs e)
  111. {
  112. // Come prima cosa otteniamo il file che il povero utente desidera
  113. // caricare sul server.
  114.  
  115. this.protocol.Upload(uploadChooserButton.Filename);
  116.  
  117. }
  118.  
  119.  
  120. protected virtual void OnTasklistCursorChanged (object sender, System.EventArgs e)
  121. {
  122. if (tasklist.Selection != null)
  123. blockTransfer.Sensitive = true;
  124. else
  125. blockTransfer.Sensitive = false;
  126. }
  127.  
  128. protected virtual void OnBlockTransferClicked (object sender, System.EventArgs e)
  129. {
  130. // Dobbiamo determinare che trasferimento bloccare
  131. TreePath path;
  132. path = tasks.GetActivePath ();
  133. string GUID = EventManager.GetGUID (path);
  134. this.protocol.DisconnectPath (GUID);
  135. }
  136.  
  137.  
  138.  
  139.  
  140.  
  141. }