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. // Filename
  49. Gtk.CellRendererText filenameRenderer = new Gtk.CellRendererText ();
  50. filenameColumn.Resizable = true;
  51. filenameColumn.PackStart (filenameRenderer, true);
  52. filenameColumn.AddAttribute (filenameRenderer, "text", 0);
  53.  
  54. // Utente
  55. Gtk.CellRendererText userRenderer = new Gtk.CellRendererText ();
  56. userColumn.Resizable = true;
  57. userColumn.PackStart (userRenderer, true);
  58. userColumn.AddAttribute (userRenderer, "text", 1);
  59. }
  60.  
  61. public void AddFile(Dizzy.File file)
  62. {
  63. lock (this) {
  64. // Aggiungo i valori effettivi nel liststore.
  65. fileListStore.AppendValues(file.name,
  66. file.user,
  67. file.path);
  68. }
  69. }
  70.  
  71. public void Clear ()
  72. {
  73. lock (this) {
  74. fileListStore.Clear ();
  75. }
  76. }
  77.  
  78. public void SearchInProgress ()
  79. {
  80. this.Clear ();
  81. this.AddFile (new File("Ricerca in corso...", " "));
  82. }
  83.  
  84. public File GetFileFromPath (TreePath path)
  85. {
  86. TreeIter iter = new TreeIter ();
  87. fileListStore.GetIter(out iter, path);
  88. File f = new File((string) fileListStore.GetValue(iter, 2),
  89. (string) fileListStore.GetValue(iter, 1));
  90. return f;
  91. }
  92.  
  93. }
  94. }