~valide/valide/dev

« back to all changes in this revision

Viewing changes to plugins/symbol/symbol.vala

  • Committer: Nicolas Joseph
  • Date: 2011-02-08 09:56:38 UTC
  • mfrom: (577.1.1 valide)
  • Revision ID: nicolas.joseph@valaide.org-20110208095638-g4lvxygbvui2cvf7
monkey 2011-01-22 Update and set vala 0.11.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* symbol-browser.vala
2
2
 *
3
 
 * Copyright (C) 2008-2010 Nicolas Joseph
 
3
 * Copyright (C) 2008-2011 Nicolas Joseph
4
4
 *
5
5
 * This program is free software: you can redistribute it and/or modify
6
6
 * it under the terms of the GNU General Public License as published by
221
221
   * which could potentially contain tabs, however, I've decided that isn't
222
222
   * really needed. But, it's still using Symbol. We could just pass back
223
223
   * **fields array.
224
 
   */ 
 
224
   */
225
225
  private Symbol? parse_line (string line)
226
226
  {
227
227
    /* (parent.)name  file  ex_cmd;"  kind:[enumvalue|errorcode|errordomain|enum|struct|namespace]  line:x  language:x  access:x */
233
233
    /*          name  file  ex_cmd;"  kind:function  line:x  language:x  signature:x */
234
234
    /*          name  file  ex_cmd;"  kind:variable  line:x  language:x */
235
235
 
236
 
    string[] fields;
 
236
    int name_ext;
237
237
    Symbol symbol = null;
 
238
    string[] fields = null;
238
239
 
239
240
    fields = line.split ("\t", 0);
240
241
    if (fields[0] != null)
241
242
    {
242
243
      symbol = new Symbol ();
243
244
      symbol.full_name = fields[0];
244
 
      if (symbol.full_name.rchr (-1, '.') != null)
 
245
      name_ext = symbol.full_name.last_index_of_char ('.');
 
246
      if (name_ext != -1)
245
247
      {
246
 
        symbol.name = symbol.full_name.rchr (-1, '.').offset (1);
 
248
        symbol.name = symbol.full_name.substring (name_ext);
247
249
      }
248
250
      else
249
251
      {
275
277
 
276
278
  /**
277
279
   * Execute the ctags command and return stdout.
278
 
   */ 
 
280
   */
279
281
  private List<Symbol> exec_ctags (string filename) throws Error
280
282
  {
281
283
    string output;
579
581
    /* create some nice padding */
580
582
    this.box.set_spacing (2);
581
583
    this.box.set_border_width (2);
582
 
 
 
584
 
583
585
    /* create and pack tree view */
584
586
    this.scrolled_window = new Gtk.ScrolledWindow (null, null);
585
587
    this.scrolled_window.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);