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.  
  58. Gtk.CellRendererText filenameRenderer = new Gtk.CellRendererText ();
  59. filenameColumn.PackStart (filenameRenderer, true);
  60. filenameColumn.AddAttribute (filenameRenderer, "text", 0);
  61. filenameColumn.Resizable = true;
  62.  
  63. // Dimensione
  64. Gtk.CellRendererText sizeRenderer = new Gtk.CellRendererText ();
  65. sizeColumn.PackStart (sizeRenderer, true);
  66. sizeColumn.AddAttribute (sizeRenderer, "text", 3);
  67. filenameColumn.Resizable = true;
  68.  
  69. // Utente
  70. Gtk.CellRendererText userRenderer = new Gtk.CellRendererText ();
  71. userColumn.Resizable = true;
  72. userColumn.PackStart (userRenderer, true);
  73. userColumn.AddAttribute (userRenderer, "text", 1);
  74.  
  75. }
  76.  
  77. public void AddFile(Dizzy.File file)
  78. {
  79.  
  80. // Aggiungo i valori effettivi nel liststore.
  81. lock (fileListStore) {
  82. fileListStore.AppendValues( file.name,
  83. file.user,
  84. file.path,
  85. file.SizeToString ());
  86. }
  87.  
  88. }
  89.  
  90. public void Clear ()
  91. {
  92. fileListStore.Clear ();
  93. }
  94.  
  95.  
  96. public File GetFileFromPath (TreePath path)
  97. {
  98. TreeIter iter = new TreeIter ();
  99.  
  100. fileListStore.GetIter(out iter, path);
  101. File f = new File((string) fileListStore.GetValue(iter, 2),
  102. (string) fileListStore.GetValue(iter, 1));
  103. // (string) fileListStore.GetValue(iter, 0));
  104. Log.Info ("Richiesto " + f.path);
  105. return f;
  106. }
  107.  
  108. }
  109. }