~mrazik/unity/remove-duplicate-testcase

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/PreviewApplications.cpp

  • Committer: Tarmac
  • Author(s): Thomi Richards
  • Date: 2012-03-18 23:29:42 UTC
  • mfrom: (2119.3.1 fix-cstr-calls)
  • Revision ID: tarmac-20120318232942-vhzd0nuzahrwrtuo
Remove calls to c_str() where they're not needed.. Fixes: . Approved by Tim Penhey.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    {
57
57
      IconTexture *screenshot = new IconTexture (preview_->screenshot_icon_hint.c_str(), 420);
58
58
      IconTexture *icon = new IconTexture (preview_->icon_hint.c_str(), 80);
59
 
      nux::StaticCairoText *name = new nux::StaticCairoText (preview_->name.c_str(), NUX_TRACKER_LOCATION);
 
59
      nux::StaticCairoText *name = new nux::StaticCairoText (preview_->name, NUX_TRACKER_LOCATION);
60
60
      name->SetFont("Ubuntu 25");
61
61
 
62
 
      nux::StaticCairoText *version = new nux::StaticCairoText (preview_->version.c_str(), NUX_TRACKER_LOCATION);
 
62
      nux::StaticCairoText *version = new nux::StaticCairoText (preview_->version, NUX_TRACKER_LOCATION);
63
63
      version->SetFont("Ubuntu 15");
64
64
 
65
 
      nux::StaticCairoText *size = new nux::StaticCairoText (preview_->size.c_str(), NUX_TRACKER_LOCATION);
 
65
      nux::StaticCairoText *size = new nux::StaticCairoText (preview_->size, NUX_TRACKER_LOCATION);
66
66
      size->SetFont("Ubuntu 15");
67
67
 
68
 
      nux::StaticCairoText *licence = new nux::StaticCairoText (preview_->license.c_str(), NUX_TRACKER_LOCATION);
69
 
      nux::StaticCairoText *last_updated = new nux::StaticCairoText (preview_->last_updated.c_str(), NUX_TRACKER_LOCATION);
 
68
      nux::StaticCairoText *licence = new nux::StaticCairoText (preview_->license, NUX_TRACKER_LOCATION);
 
69
      nux::StaticCairoText *last_updated = new nux::StaticCairoText (preview_->last_updated, NUX_TRACKER_LOCATION);
70
70
      description = new nux::StaticCairoText ("", NUX_TRACKER_LOCATION);
71
71
 
72
72
      //description->SetBaseWidth(350);
73
73
      description->SetMaximumWidth(350);
74
74
      description->SetLines(99999999);
75
 
      description->SetText(preview_->description.c_str());
 
75
      description->SetText(preview_->description);
76
76
 
77
77
      std::ostringstream number_of_reviews;
78
78
      number_of_reviews << preview_->n_ratings << " Reviews";
79
 
      nux::StaticCairoText *review_total = new nux::StaticCairoText (number_of_reviews.str().c_str(), NUX_TRACKER_LOCATION);
 
79
      nux::StaticCairoText *review_total = new nux::StaticCairoText (number_of_reviews.str(), NUX_TRACKER_LOCATION);
80
80
 
81
81
      nux::HLayout *large_container = new nux::HLayout(NUX_TRACKER_LOCATION);
82
82
      nux::VLayout *screenshot_container = new nux::VLayout(NUX_TRACKER_LOCATION);
87
87
      nux::HLayout *button_container = new nux::HLayout(NUX_TRACKER_LOCATION);
88
88
 
89
89
      // create the action buttons
90
 
      PreviewBasicButton* primary_button = new PreviewBasicButton(preview_->primary_action_name.c_str(), NUX_TRACKER_LOCATION);
 
90
      PreviewBasicButton* primary_button = new PreviewBasicButton(preview_->primary_action_name, NUX_TRACKER_LOCATION);
91
91
      //FIXME - add secondary action when we have the backend for it
92
92
      primary_button->state_change.connect ([&] (nux::View *view) { UriActivated.emit (preview_->primary_action_uri); });
93
93
      button_container->AddLayout (new nux::SpaceLayout(6,6,6,6), 0);
153
153
    g_debug ("layout recomputing");
154
154
    description->SetBaseWidth((GetGeometry().width / 2) - 16 - 12 );
155
155
    description->SetMaximumWidth((GetGeometry().width / 2) - 16 - 12 );
156
 
    description->SetText(preview_->description.c_str());
 
156
    description->SetText(preview_->description);
157
157
  }
158
158
 
159
159
  void PreviewApplications::Draw (nux::GraphicsEngine &GfxContext, bool force_draw) {