Changeset 8454


Ignore:
Timestamp:
2004-11-04T17:22:29+13:00 (19 years ago)
Author:
jrm21
Message:

read any collection-specific macros from the ColInfoResponse struct, and
call setmacro() on them. This adds them to the 'Global' package, overriding
any set by loading the macro files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/receptionist.cpp

    r7594 r8454  
    13811381  disp.setmacro ("httpprefix", displayclass::defaultpackage, configinfo.httpprefix);
    13821382
     1383  // get relevant info from the collection
    13831384  if (!collection.empty()) {
    13841385    ColInfoResponse_t cinfo;
     
    13891390      text_t httpcollection;
    13901391      if (!cinfo.httpdomain.empty()) httpcollection = "http://";
    1391       httpcollection += cinfo.httpdomain + cinfo.httpprefix + "/collect/" + collection;
    1392       disp.setmacro ("httpcollection", displayclass::defaultpackage, httpcollection);
    1393     }
     1392      httpcollection += cinfo.httpdomain + cinfo.httpprefix + "/collect/"
     1393    + collection;
     1394      disp.setmacro ("httpcollection", displayclass::defaultpackage,
     1395             httpcollection);
     1396      // as of gsdl 2.53, collect.cfg can specify macros
     1397      if (cinfo.collection_macros.size() > 0) {
     1398    macros_map::const_iterator this_macro=cinfo.collection_macros.begin();
     1399    macros_map::const_iterator done_macro=cinfo.collection_macros.end();
     1400    while (this_macro != done_macro) {
     1401      /* this should be a collectionmacro instead of a defaultmacro
     1402         I think, but setcollectionmacro is protected... */
     1403      disp.setdefaultmacro("Global",this_macro->first, // macro name
     1404                   this_macro->second.first,   // params
     1405                   //g_EmptyText,             // filename...
     1406                   this_macro->second.second); // value
     1407      ++this_macro;
     1408    }
     1409      } // col macros
     1410    } // collectproto != NULL
    13941411  }
    13951412
Note: See TracChangeset for help on using the changeset viewer.