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. Gtk.TreeViewColumn sizeColumn;
  18.  
  19. // La listStore per memorizzare i file
  20. // che troviamo.
  21. Gtk.ListStore fileListStore;
  22.  
  23. public FileTreeView (Gtk.TreeView tree)
  24. {
  25.  
  26. // Costruisco la ListStore e popolo di colonne
  27. // la TreeView
  28. this.tree = tree;
  29. this.tree.ResizeMode = ResizeMode.Immediate;
  30. this.filenameColumn = new Gtk.TreeViewColumn ();
  31. filenameColumn.Title = "Nome del file";
  32.  
  33.  
  34. this.userColumn = new Gtk.TreeViewColumn ();
  35. userColumn.Title = "Utente";
  36.  
  37. this.sizeColumn = new Gtk.TreeViewColumn ();
  38. sizeColumn.Title = "Dimensione";
  39. sizeColumn.Resizable = true;
  40.  
  41. this.tree.AppendColumn (filenameColumn);
  42. this.tree.AppendColumn (sizeColumn);
  43. this.tree.AppendColumn (userColumn);
  44.  
  45. this.fileListStore = new Gtk.ListStore (typeof(string), // Nome del file
  46. typeof(string), // Utente
  47. typeof(string), // Path del file
  48. typeof(string));// Dimensione
  49.  
  50. this.tree.Model = fileListStore;
  51.  
  52. CellSetup ();
  53. }
  54.  
  55. protected void CellSetup()
  56. {
  57. // lock (this) {
  58. // Filename
  59. Gtk.CellRendererText filenameRenderer = new Gtk.CellRendererText ();
  60. filenameColumn.PackStart (filenameRenderer, true);
  61. filenameColumn.AddAttribute (filenameRenderer, "text", 0);
  62. filenameColumn.Resizable = true;
  63.  
  64. // Dimensione
  65. Gtk.CellRendererText sizeRenderer = new Gtk.CellRendererText ();
  66. sizeColumn.PackStart (sizeRenderer, true);
  67. sizeColumn.AddAttribute (sizeRenderer, "text", 3);
  68. filenameColumn.Resizable = true;
  69.  
  70. // Utente
  71. Gtk.CellRendererText userRenderer = new Gtk.CellRendererText ();
  72. userColumn.Resizable = true;
  73. userColumn.PackStart (userRenderer, true);
  74. userColumn.AddAttribute (userRenderer, "text", 1);
  75. // }
  76. }
  77.  
  78. public void AddFile(Dizzy.File file)
  79. {
  80.  
  81. // Aggiungo i valori effettivi nel liststore.
  82. fileListStore.AppendValues( file.name,
  83. file.user,
  84. file.path,
  85. file.SizeToString ());
  86.  
  87. }
  88.  
  89. public void Clear ()
  90. {
  91. fileListStore.Clear ();
  92. }
  93.  
  94.  
  95. public File GetFileFromPath (TreePath path)
  96. {
  97. TreeIter iter = new TreeIter ();
  98.  
  99. fileListStore.GetIter(out iter, path);
  100. File f = new File((string) fileListStore.GetValue(iter, 2),
  101. (string) fileListStore.GetValue(iter, 1));
  102. // (string) fileListStore.GetValue(iter, 0));
  103. Log.Info ("Richiesto " + f.path);
  104. return f;
  105. }
  106.  
  107. }
  108. }