John Spray <[EMAIL PROTECTED]> writes:

| /**
|  * \file GToc.C

| void GToc::updateType()
| {
|       changing_views_ = true;
|       string const targettype =
|               toc::getType(controller().params().getCmdName());
>
|       typestore_->clear();
|       vector<string> types = controller().getTypes();

does getTypes() return a copy or a reference?

|       vector<string>::iterator it = types.begin();
|       vector<string>::iterator end = types.end();
|       int rowindex = 0;
|       for(;it != end; ++it) {
|               Gtk::TreeModel::iterator row = typestore_->append();
|               (*row)[listCol_] = *it;
|               if (*it == targettype)
|                       typecombo_->set_active(rowindex);
|               ++rowindex;
|       }
>
|       typelistempty_ = rowindex ? false : true;

Why do you need the rowindex?
You can find out before the loop if there are entries or not.
either by just checkint the size of the vector, or by comparing it and
end.

|       // Because tiny empty ComboBoxes just look silly
|       typecombo_->set_size_request(typelistempty_ ? 130 : -1, -1);

make the 130 have a name

     int const emptyszie = 130;

f.ex. magic values should get a name we it is easy to recognize what
they are.

| void GToc::updateContents()
| {
|       if (typelistempty_) {
|               tocstore_->clear();
|               (*tocstore_->append())[listCol_] = "*** No Lists ***";

Should that string be translated?

|       if (contents.empty()) {
|               tocstore_->clear();
|               (*tocstore_->append())[listCol_] = "*** No Lists ***";

translatable?

-- 
        Lgb

Reply via email to