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 Gtk;
  2. using System;
  3.  
  4. namespace Dizzy
  5. {
  6.  
  7.  
  8. public class FileTreeView
  9. {
  10.  
  11. // La treeview passataci dalla grafica
  12. Gtk.TreeView tree;
  13.  
  14. // Le colonne che ci servono
  15. Gtk.TreeViewColumn filenameColumn;
  16. Gtk.TreeViewColumn userColumn;
  17.  
  18. // La listStore per memorizzare i file
  19. // che troviamo.
  20. Gtk.ListStore fileListStore;
  21.  
  22. public FileTreeView (Gtk.TreeView tree)
  23. {
  24. // Costruisco la ListStore e popolo di colonne
  25. // la TreeView
  26. this.tree = tree;
  27. this.filenameColumn = new Gtk.TreeViewColumn ();
  28. filenameColumn.Title = "Nome del file";
  29.  
  30.  
  31. this.userColumn = new Gtk.TreeViewColumn ();
  32. userColumn.Title = "Utente";
  33.  
  34. this.tree.AppendColumn (filenameColumn);
  35. this.tree.AppendColumn (userColumn);
  36.  
  37. this.fileListStore = new Gtk.ListStore (typeof(string), // Nome del file
  38. typeof(string), // Utente
  39. typeof(string));// Path del file.
  40.  
  41. this.tree.Model = fileListStore;
  42. CellSetup ();
  43.  
  44. }
  45.  
  46. protected void CellSetup()
  47. {
  48. lock (this) {
  49. // Filename
  50. Gtk.CellRendererText filenameRenderer = new Gtk.CellRendererText ();
  51. filenameColumn.Resizable = true;
  52. filenameColumn.PackStart (filenameRenderer, true);
  53. filenameColumn.AddAttribute (filenameRenderer, "text", 0);
  54.  
  55. // Utente
  56. Gtk.CellRendererText userRenderer = new Gtk.CellRendererText ();
  57. userColumn.Resizable = true;
  58. userColumn.PackStart (userRenderer, true);
  59. userColumn.AddAttribute (userRenderer, "text", 1);
  60. }
  61. }
  62.  
  63. public void AddFile(Dizzy.File file)
  64. {
  65. lock (this) {
  66. // Aggiungo i valori effettivi nel liststore.
  67. fileListStore.AppendValues(file.name,
  68. file.user,
  69. file.path);
  70. }
  71. }
  72.  
  73. public void Clear ()
  74. {
  75. lock (this) {
  76. fileListStore.Clear ();
  77. }
  78. }
  79.  
  80. public void SearchInProgress ()
  81. {
  82. this.Clear ();
  83. this.AddFile (new File("Ricerca in corso...", " "));
  84. }
  85.  
  86. public File GetFileFromPath (TreePath path)
  87. {
  88. TreeIter iter = new TreeIter ();
  89. fileListStore.GetIter(out iter, path);
  90. File f = new File((string) fileListStore.GetValue(iter, 2),
  91. (string) fileListStore.GetValue(iter, 1));
  92. return f;
  93. }
  94.  
  95. }
  96. }