bibledit-development
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[be] [bug #26850] Edit->Planning->Tasks->Add adds all possible tasks


From: Birch Champeon
Subject: [be] [bug #26850] Edit->Planning->Tasks->Add adds all possible tasks
Date: Sat, 20 Jun 2009 03:07:44 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11 GTB5 (.NET CLR 3.5.30729)

URL:
  <http://savannah.nongnu.org/bugs/?26850>

                 Summary: Edit->Planning->Tasks->Add adds all possible tasks
                 Project: Bibledit
            Submitted by: birch
            Submitted on: Sat 20 Jun 2009 03:07:41 AM GMT
                  Status: None
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

If you click Edit->Planning and click Tasks and then Add, selecting an item
and clicking OK will result in adding the entire list of possible task
options.  

This is because ListviewDialog::on_okbutton_clicked() calls
listview_get_strings which currently retrieves all strings.

To fix it:
change listview_get_strings in listview.cpp to:

vector < ustring > listview_get_strings(GtkWidget * listview, bool
selectedonly)
// Gets the strings loaded in the listview.
{
  // Storage for the result.
  vector < ustring > strings;
  GtkTreeSelection *treeselection;
  // Get the model
  GtkTreeModel *model;
  model = gtk_tree_view_get_model(GTK_TREE_VIEW(listview));
  treeselection =  gtk_tree_view_get_selection(GTK_TREE_VIEW(listview));
  // Some variables needed.
  GtkTreeIter iter;
  gboolean valid;
  // Get the first iter in the store.
  valid = gtk_tree_model_get_iter_first(model, &iter);
  while (valid) {
    // Walk through the list, reading each row
    gchar *str_data;
    // Make sure you terminate calls to gtk_tree_model_get() with a '-1'
value.
    gtk_tree_model_get(model, &iter, 0, &str_data, -1);
    // Store.
        if(selectedonly) //if we're only getting selected items
        {
                if( gtk_tree_selection_iter_is_selected (treeselection,&iter)) 
//check to
see if it's selected
                        strings.push_back(str_data);
        }                                                                       
                                 
        else
        {       
                strings.push_back(str_data);
        }
    // Free memory and go to next.
    g_free(str_data);
    valid = gtk_tree_model_iter_next(model, &iter);
  }
  // Return the results.
  return strings;
}


change the listview_get_strings declaration in listview.h to:

vector <ustring> listview_get_strings(GtkWidget * listview, bool selectedonly
= false);


change the calls from dialogeditlist::on_okbutton_clicked() to:

foci = listview_get_strings (treeview1,true);

and

foci = listview_get_strings (treeview2,true);


project open seems to work fine with this code




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?26850>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]