Changeset d52d8ae14ac8ae79ae2d4c0a1f4c3fbe7a3f441c

Show
Ignore:
Timestamp:
10/25/09 16:43:09 (4 years ago)
Author:
Benjamin Herr <ben@…>
Parents:
e861d030b244626b06e7d2409ebfb124b466dc59
Children:
ceadc43a08e02f43362c5af9a7bbd76a0ed8f433
git-committer:
Benjamin Herr <ben@0x539.de> / 2009-10-25T16:43:09Z+0100
Message:

htmlexport: write session name and path to html

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • code/operations/operation-export-html.cpp

    re275a84 rd52d8ae  
    229229                } 
    230230 
    231                 // put document metadata, like path, hostname of infinoted 
    232                 // TODO: figure out what interesting info 
    233                 //       we can pull out of the session 
    234                 char session_info[] = 
    235                         "<placeholder for session info and path>"; 
    236  
    237                 // %1$s is information about the document's location, 
    238                 //         session name, 
    239                 // %2$s is current date as formatted by %c, 
    240                 // %3$s is a link to the gobby site 
     231                char const* hostname = document.get_hostname().c_str(); 
     232                char const* path     = document.get_path().c_str(); 
     233 
     234                // %1$s is session name/hostname 
     235                // %2$s is path within the session 
     236                // %3$s is current date as formatted by %c, 
     237                // %4$s is a link to the gobby site, it must be present because 
     238                //   we need to handle that manually to insert a hyperlink 
     239                //   instead of just printf'ing it. 
    241240                char const* translated = 
    242                         _("Document generated from %1$s at %2$s by %3$s"); 
    243                 char const* p = std::strstr(translated, "%3$s"); 
     241                        _("Document generated from %1$s:%2$s at %3$s by %4$s"); 
     242                char const* p = std::strstr(translated, "%4$s"); 
    244243                g_assert(p); 
    245244                node->add_child_text( 
    246245                        uprintf(Glib::ustring(translated, p).c_str(), 
    247                                 session_info, 
    248                                 time_str)); 
     246                                hostname, path, time_str)); 
    249247 
    250248                xmlpp::Element* link = node->add_child("a"); 
     
    254252                if(*p != '\0') 
    255253                        node->add_child_text( 
    256                           uprintf(p+4 , session_info, time_str)); 
     254                          uprintf(p+4 , hostname, path, time_str)); 
    257255        } 
    258256