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