diff options
| author | Thomi Richards <thomi.richards@canonical.com> | 2012-03-16 14:48:22 +1300 |
|---|---|---|
| committer | Thomi Richards <thomi.richards@canonical.com> | 2012-03-16 14:48:22 +1300 |
| commit | b160a060251efc3aa8f69cf163f5a44cef09f94c (patch) | |
| tree | 4d2873cd5127e5b98df481131923e5acc61589f3 /plugins | |
| parent | 4af4fceaffdf755014aa2e55237794bc8a62ce8f (diff) | |
Removed lots of calls to std::string.c_str() where we didn't need to call it.
(bzr r2119.3.1)
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/unityshell/src/BamfLauncherIcon.cpp | 8 | ||||
| -rw-r--r-- | plugins/unityshell/src/DebugDBusInterface.cpp | 2 | ||||
| -rw-r--r-- | plugins/unityshell/src/Launcher.cpp | 18 | ||||
| -rw-r--r-- | plugins/unityshell/src/LauncherController.cpp | 8 | ||||
| -rw-r--r-- | plugins/unityshell/src/LauncherIcon.cpp | 2 | ||||
| -rw-r--r-- | plugins/unityshell/src/PanelIndicatorEntryView.cpp | 2 | ||||
| -rw-r--r-- | plugins/unityshell/src/PreviewApplications.cpp | 18 | ||||
| -rw-r--r-- | plugins/unityshell/src/PreviewGeneric.cpp | 12 | ||||
| -rw-r--r-- | plugins/unityshell/src/PreviewMusic.cpp | 10 | ||||
| -rw-r--r-- | plugins/unityshell/src/PreviewMusicTrack.cpp | 10 | ||||
| -rw-r--r-- | plugins/unityshell/src/PreviewMusicTrackWidget.cpp | 6 | ||||
| -rw-r--r-- | plugins/unityshell/src/ResultRendererTile.cpp | 6 | ||||
| -rw-r--r-- | plugins/unityshell/src/SearchBar.cpp | 2 | ||||
| -rw-r--r-- | plugins/unityshell/src/ShortcutView.cpp | 50 | ||||
| -rw-r--r-- | plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp | 2 | ||||
| -rw-r--r-- | plugins/unityshell/src/SwitcherView.cpp | 34 |
16 files changed, 95 insertions, 95 deletions
diff --git a/plugins/unityshell/src/BamfLauncherIcon.cpp b/plugins/unityshell/src/BamfLauncherIcon.cpp index 84acd2068..ccd6701bd 100644 --- a/plugins/unityshell/src/BamfLauncherIcon.cpp +++ b/plugins/unityshell/src/BamfLauncherIcon.cpp @@ -684,8 +684,8 @@ void BamfLauncherIcon::UpdateDesktopQuickList() int index = 0; while (nicks[index]) { - - // Build a dbusmenu item for each nick that is the desktop + + // Build a dbusmenu item for each nick that is the desktop // file that is built from it's name and includes a callback // to the desktop shortcuts object to execute the nick glib::String name(indicator_desktop_shortcuts_nick_get_name(_desktop_shortcuts, @@ -781,7 +781,7 @@ void BamfLauncherIcon::Stick(bool save) bamf_view_set_sticky(BAMF_VIEW(_bamf_app.RawPtr()), true); if (save && !desktop_file.empty()) - FavoriteStore::GetDefault().AddFavorite(desktop_file.c_str(), -1); + FavoriteStore::GetDefault().AddFavorite(desktop_file, -1); } void BamfLauncherIcon::UnStick() @@ -797,7 +797,7 @@ void BamfLauncherIcon::UnStick() Remove(); if (!desktop_file.empty()) - FavoriteStore::GetDefault().RemoveFavorite(desktop_file.c_str()); + FavoriteStore::GetDefault().RemoveFavorite(desktop_file); } void BamfLauncherIcon::ToggleSticky() diff --git a/plugins/unityshell/src/DebugDBusInterface.cpp b/plugins/unityshell/src/DebugDBusInterface.cpp index 4b7b09739..041f8fe03 100644 --- a/plugins/unityshell/src/DebugDBusInterface.cpp +++ b/plugins/unityshell/src/DebugDBusInterface.cpp @@ -239,7 +239,7 @@ void StartLogToFile(std::string const& file_path) { if (local::output_file.is_open()) local::output_file.close(); - local::output_file.open(file_path.c_str()); + local::output_file.open(file_path); nux::logging::Writer::Instance().SetOutputStream(local::output_file); } diff --git a/plugins/unityshell/src/Launcher.cpp b/plugins/unityshell/src/Launcher.cpp index 6582bd147..a62b5df2e 100644 --- a/plugins/unityshell/src/Launcher.cpp +++ b/plugins/unityshell/src/Launcher.cpp @@ -287,7 +287,7 @@ Launcher::Launcher(nux::BaseWindow* parent, bg_effect_helper_.enabled = false; TextureCache& cache = TextureCache::GetDefault(); - TextureCache::CreateTextureCallback cb = [&](std::string const& name, int width, int height) -> nux::BaseTexture* { + TextureCache::CreateTextureCallback cb = [&](std::string const& name, int width, int height) -> nux::BaseTexture* { return nux::CreateTexture2DFromFile((PKGDATADIR"/" + name + ".png").c_str(), -1, true); }; @@ -408,8 +408,8 @@ Launcher::AddProperties(GVariantBuilder* builder) .add("height", abs_geo.height) .add("monitor", monitor()) .add("quicklist-open", _hide_machine->GetQuirk(LauncherHideMachine::QUICKLIST_OPEN)) - .add("hide-quirks", _hide_machine->DebugHideQuirks().c_str()) - .add("hover-quirks", _hover_machine->DebugHoverQuirks().c_str()) + .add("hide-quirks", _hide_machine->DebugHideQuirks()) + .add("hover-quirks", _hover_machine->DebugHoverQuirks()) .add("icon-size", _icon_size) .add("shortcuts_shown", _shortcuts_shown); } @@ -1054,7 +1054,7 @@ void Launcher::FillRenderArg(AbstractLauncherIcon::Ptr icon, // FIXME: this is a hack, we should have a look why SetAnimationTarget is necessary in SetAnimationTarget // we should ideally just need it at start to set the target if (!_initial_drag_animation && icon == _drag_icon && _drag_window && _drag_window->Animating()) - _drag_window->SetAnimationTarget((int)(_drag_icon->GetCenter(monitor).x), + _drag_window->SetAnimationTarget((int)(_drag_icon->GetCenter(monitor).x), (int)(_drag_icon->GetCenter(monitor).y)); center.y += (half_size * size_modifier) + spacing; // move to end @@ -1554,11 +1554,11 @@ void Launcher::ConfigureBarrier() float overcome_responsiveness_mult = ((options()->edge_responsiveness() - 1) * 1.0f) + 1; decaymulator_->rate_of_decay = options()->edge_decay_rate() * decay_responsiveness_mult; _edge_overcome_pressure = options()->edge_overcome_pressure() * overcome_responsiveness_mult; - + _pointer_barrier->threshold = options()->edge_stop_velocity(); _pointer_barrier->max_velocity_multiplier = options()->edge_responsiveness(); _pointer_barrier->ConstructBarrier(); - + _hide_machine->reveal_pressure = options()->edge_reveal_pressure() * reveal_responsiveness_mult; _hide_machine->edge_decay_rate = options()->edge_decay_rate() * decay_responsiveness_mult; } @@ -2043,7 +2043,7 @@ void Launcher::StartIconDragRequest(int x, int y) { nux::Geometry geo = GetAbsoluteGeometry(); AbstractLauncherIcon::Ptr drag_icon = MouseIconIntersection((int)(GetGeometry().width / 2.0f), y); - + x += geo.x; y += geo.y; @@ -2119,7 +2119,7 @@ void Launcher::EndIconDrag() { _model->Save(); - _drag_window->SetAnimationTarget((int)(_drag_icon->GetCenter(monitor).x), + _drag_window->SetAnimationTarget((int)(_drag_icon->GetCenter(monitor).x), (int)(_drag_icon->GetCenter(monitor).y)); _drag_window->StartAnimation(); @@ -2333,7 +2333,7 @@ void Launcher::OnPointerBarrierEvent(ui::PointerBarrierWrapper* owner, ui::Barri Window root_return, child_return; Display *dpy = nux::GetGraphicsDisplay()->GetX11Display(); - if (XQueryPointer (dpy, DefaultRootWindow(dpy), &root_return, &child_return, &root_x_return, + if (XQueryPointer (dpy, DefaultRootWindow(dpy), &root_return, &child_return, &root_x_return, &root_y_return, &win_x_return, &win_y_return, &mask_return)) { if (mask_return & (Button1Mask | Button3Mask)) diff --git a/plugins/unityshell/src/LauncherController.cpp b/plugins/unityshell/src/LauncherController.cpp index 45a0c1f94..d6da27ea2 100644 --- a/plugins/unityshell/src/LauncherController.cpp +++ b/plugins/unityshell/src/LauncherController.cpp @@ -237,7 +237,7 @@ Controller::Impl::Impl(Display* display, Controller* parent) uscreen->changed.connect(sigc::mem_fun(this, &Controller::Impl::OnScreenChanged)); - WindowManager& plugin_adapter = *(WindowManager::Default()); + WindowManager& plugin_adapter = *(WindowManager::Default()); plugin_adapter.window_focus_changed.connect (sigc::mem_fun (this, &Controller::Impl::OnWindowFocusChanged)); launcher_key_press_time_ = { 0, 0 }; @@ -310,7 +310,7 @@ void Controller::Impl::OnWindowFocusChanged (guint32 xid) else if (launcher_keynav) { keynav_first_focus = true; - } + } } Launcher* Controller::Impl::CreateLauncher(int monitor) @@ -383,7 +383,7 @@ void Controller::Impl::Save() std::string const& desktop_file = icon->DesktopFile(); if (!desktop_file.empty()) - desktop_paths.push_back(desktop_file.c_str()); + desktop_paths.push_back(desktop_file); } unity::FavoriteStore::GetDefault().SetFavorites(desktop_paths); @@ -614,7 +614,7 @@ void Controller::Impl::InsertExpoAction() on_expoicon_activate_connection_ = icon->activate.connect(sigc::mem_fun(this, &Impl::OnExpoActivated)); - + RegisterIcon(expo_icon_); } diff --git a/plugins/unityshell/src/LauncherIcon.cpp b/plugins/unityshell/src/LauncherIcon.cpp index c3e0e1671..955174f2f 100644 --- a/plugins/unityshell/src/LauncherIcon.cpp +++ b/plugins/unityshell/src/LauncherIcon.cpp @@ -190,7 +190,7 @@ LauncherIcon::AddProperties(GVariantBuilder* builder) .add("z", _center[0].z) .add("related-windows", (int)Windows().size()) .add("icon-type", _icon_type) - .add("tooltip-text", tooltip_text().c_str()) + .add("tooltip-text", tooltip_text()) .add("sort-priority", _sort_priority) .add("quirk-active", GetQuirk(QUIRK_ACTIVE)) .add("quirk-visible", GetQuirk(QUIRK_VISIBLE)) diff --git a/plugins/unityshell/src/PanelIndicatorEntryView.cpp b/plugins/unityshell/src/PanelIndicatorEntryView.cpp index 3a56cec83..f2d53b421 100644 --- a/plugins/unityshell/src/PanelIndicatorEntryView.cpp +++ b/plugins/unityshell/src/PanelIndicatorEntryView.cpp @@ -475,7 +475,7 @@ std::string PanelIndicatorEntryView::GetName() const if (proxy_->IsUnused()) return ""; else - return proxy_->id().c_str(); + return proxy_->id(); } void PanelIndicatorEntryView::AddProperties(GVariantBuilder* builder) diff --git a/plugins/unityshell/src/PreviewApplications.cpp b/plugins/unityshell/src/PreviewApplications.cpp index df9891d8d..e621fecfe 100644 --- a/plugins/unityshell/src/PreviewApplications.cpp +++ b/plugins/unityshell/src/PreviewApplications.cpp @@ -56,27 +56,27 @@ namespace unity { { IconTexture *screenshot = new IconTexture (preview_->screenshot_icon_hint.c_str(), 420); IconTexture *icon = new IconTexture (preview_->icon_hint.c_str(), 80); - nux::StaticCairoText *name = new nux::StaticCairoText (preview_->name.c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *name = new nux::StaticCairoText (preview_->name, NUX_TRACKER_LOCATION); name->SetFont("Ubuntu 25"); - nux::StaticCairoText *version = new nux::StaticCairoText (preview_->version.c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *version = new nux::StaticCairoText (preview_->version, NUX_TRACKER_LOCATION); version->SetFont("Ubuntu 15"); - nux::StaticCairoText *size = new nux::StaticCairoText (preview_->size.c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *size = new nux::StaticCairoText (preview_->size, NUX_TRACKER_LOCATION); size->SetFont("Ubuntu 15"); - nux::StaticCairoText *licence = new nux::StaticCairoText (preview_->license.c_str(), NUX_TRACKER_LOCATION); - nux::StaticCairoText *last_updated = new nux::StaticCairoText (preview_->last_updated.c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *licence = new nux::StaticCairoText (preview_->license, NUX_TRACKER_LOCATION); + nux::StaticCairoText *last_updated = new nux::StaticCairoText (preview_->last_updated, NUX_TRACKER_LOCATION); description = new nux::StaticCairoText ("", NUX_TRACKER_LOCATION); //description->SetBaseWidth(350); description->SetMaximumWidth(350); description->SetLines(99999999); - description->SetText(preview_->description.c_str()); + description->SetText(preview_->description); std::ostringstream number_of_reviews; number_of_reviews << preview_->n_ratings << " Reviews"; - nux::StaticCairoText *review_total = new nux::StaticCairoText (number_of_reviews.str().c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *review_total = new nux::StaticCairoText (number_of_reviews.str(), NUX_TRACKER_LOCATION); nux::HLayout *large_container = new nux::HLayout(NUX_TRACKER_LOCATION); nux::VLayout *screenshot_container = new nux::VLayout(NUX_TRACKER_LOCATION); @@ -87,7 +87,7 @@ namespace unity { nux::HLayout *button_container = new nux::HLayout(NUX_TRACKER_LOCATION); // create the action buttons - PreviewBasicButton* primary_button = new PreviewBasicButton(preview_->primary_action_name.c_str(), NUX_TRACKER_LOCATION); + PreviewBasicButton* primary_button = new PreviewBasicButton(preview_->primary_action_name, NUX_TRACKER_LOCATION); //FIXME - add secondary action when we have the backend for it primary_button->state_change.connect ([&] (nux::View *view) { UriActivated.emit (preview_->primary_action_uri); }); button_container->AddLayout (new nux::SpaceLayout(6,6,6,6), 0); @@ -153,7 +153,7 @@ namespace unity { g_debug ("layout recomputing"); description->SetBaseWidth((GetGeometry().width / 2) - 16 - 12 ); description->SetMaximumWidth((GetGeometry().width / 2) - 16 - 12 ); - description->SetText(preview_->description.c_str()); + description->SetText(preview_->description); } void PreviewApplications::Draw (nux::GraphicsEngine &GfxContext, bool force_draw) { diff --git a/plugins/unityshell/src/PreviewGeneric.cpp b/plugins/unityshell/src/PreviewGeneric.cpp index 5b45961ee..13507a5df 100644 --- a/plugins/unityshell/src/PreviewGeneric.cpp +++ b/plugins/unityshell/src/PreviewGeneric.cpp @@ -55,7 +55,7 @@ namespace unity { void PreviewGeneric::BuildLayout() { IconTexture *icon = new IconTexture (preview_->icon_hint.c_str(), 300); - nux::StaticCairoText *name = new nux::StaticCairoText (preview_->name.c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *name = new nux::StaticCairoText (preview_->name, NUX_TRACKER_LOCATION); name->SetFont("Ubuntu 25"); //get date @@ -71,14 +71,14 @@ namespace unity { std::stringstream size_and_type_str; size_and_type_str << formatted_size << ", " << preview_->type; - nux::StaticCairoText *size_and_type = new nux::StaticCairoText(size_and_type_str.str().c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *size_and_type = new nux::StaticCairoText(size_and_type_str.str(), NUX_TRACKER_LOCATION); g_free (formatted_size); nux::StaticCairoText *description = new nux::StaticCairoText ("", NUX_TRACKER_LOCATION); description->SetBaseWidth(400); description->SetMaximumWidth(400); description->SetLines(99999999); - description->SetText(preview_->description.c_str()); + description->SetText(preview_->description); nux::HLayout *large_container = new nux::HLayout(NUX_TRACKER_LOCATION); nux::VLayout *screenshot_container = new nux::VLayout(NUX_TRACKER_LOCATION); @@ -88,7 +88,7 @@ namespace unity { // create the action buttons if (preview_->tertiary_action_name.empty() == false) { - PreviewBasicButton* tertiary_button = new PreviewBasicButton(preview_->tertiary_action_name.c_str(), NUX_TRACKER_LOCATION); + PreviewBasicButton* tertiary_button = new PreviewBasicButton(preview_->tertiary_action_name, NUX_TRACKER_LOCATION); tertiary_button->state_change.connect ([&] (nux::View *view) { UriActivated.emit (preview_->tertiary_action_uri); }); button_container->AddLayout (new nux::SpaceLayout(6,6,6,6), 0); button_container->AddView (tertiary_button, 1); @@ -96,7 +96,7 @@ namespace unity { if (preview_->secondary_action_name.empty() == false) { - PreviewBasicButton* secondary_button = new PreviewBasicButton(preview_->secondary_action_name.c_str(), NUX_TRACKER_LOCATION); + PreviewBasicButton* secondary_button = new PreviewBasicButton(preview_->secondary_action_name, NUX_TRACKER_LOCATION); secondary_button->state_change.connect ([&] (nux::View *view) { UriActivated.emit (preview_->secondary_action_uri); }); button_container->AddLayout (new nux::SpaceLayout(6,6,6,6), 0); button_container->AddView (secondary_button, 1); @@ -104,7 +104,7 @@ namespace unity { if (preview_->primary_action_name.empty() == false) { - PreviewBasicButton* primary_button = new PreviewBasicButton(preview_->primary_action_name.c_str(), NUX_TRACKER_LOCATION); + PreviewBasicButton* primary_button = new PreviewBasicButton(preview_->primary_action_name, NUX_TRACKER_LOCATION); primary_button->state_change.connect ([&] (nux::View *view) { UriActivated.emit (preview_->primary_action_uri); }); button_container->AddLayout (new nux::SpaceLayout(6,6,6,6), 0); button_container->AddView (primary_button, 1); diff --git a/plugins/unityshell/src/PreviewMusic.cpp b/plugins/unityshell/src/PreviewMusic.cpp index 5d831a4fd..c3c1e3c47 100644 --- a/plugins/unityshell/src/PreviewMusic.cpp +++ b/plugins/unityshell/src/PreviewMusic.cpp @@ -58,11 +58,11 @@ namespace unity { void PreviewMusicAlbum::BuildLayout() { IconTexture *cover = new IconTexture (preview_->album_cover.c_str(), 400); - nux::StaticCairoText *title = new nux::StaticCairoText(preview_->name.c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *title = new nux::StaticCairoText(preview_->name, NUX_TRACKER_LOCATION); title->SetFont("Ubuntu 25"); std::string artist_year = preview_->artist + ", " + preview_->year; - nux::StaticCairoText *artist = new nux::StaticCairoText(artist_year.c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *artist = new nux::StaticCairoText(artist_year, NUX_TRACKER_LOCATION); artist->SetFont("Ubuntu 15"); std::ostringstream album_length_string; @@ -71,7 +71,7 @@ namespace unity { << preview_->length / 60 << ":" << preview_->length % 60 << " " << _("min"); - nux::StaticCairoText *album_length = new nux::StaticCairoText(album_length_string.str().c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *album_length = new nux::StaticCairoText(album_length_string.str(), NUX_TRACKER_LOCATION); std::ostringstream genres_string; dash::AlbumPreview::Genres::iterator genre_it; @@ -86,7 +86,7 @@ namespace unity { genres_string << (*genre_it); } - nux::StaticCairoText *genres = new nux::StaticCairoText(genres_string.str().c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *genres = new nux::StaticCairoText(genres_string.str(), NUX_TRACKER_LOCATION); nux::VLayout* tracks = new nux::VLayout(NUX_TRACKER_LOCATION); @@ -112,7 +112,7 @@ namespace unity { tracks->AddView(track_widget, 0, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL); } - PreviewBasicButton* primary_button = new PreviewBasicButton(preview_->primary_action_name.c_str(), NUX_TRACKER_LOCATION); + PreviewBasicButton* primary_button = new PreviewBasicButton(preview_->primary_action_name, NUX_TRACKER_LOCATION); //FIXME - add secondary action when we have the backend for it primary_button->state_change.connect ([&] (nux::View *view) { UriActivated.emit (preview_->primary_action_uri); }); diff --git a/plugins/unityshell/src/PreviewMusicTrack.cpp b/plugins/unityshell/src/PreviewMusicTrack.cpp index 9ca85ef9d..ccb7a7475 100644 --- a/plugins/unityshell/src/PreviewMusicTrack.cpp +++ b/plugins/unityshell/src/PreviewMusicTrack.cpp @@ -57,11 +57,11 @@ namespace unity { void PreviewMusicTrack::BuildLayout() { IconTexture *cover = new IconTexture (preview_->album_cover.c_str(), 400); - nux::StaticCairoText *title = new nux::StaticCairoText(preview_->title.c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *title = new nux::StaticCairoText(preview_->title, NUX_TRACKER_LOCATION); title->SetFont("Ubuntu 25"); std::string artist_year = preview_->artist; // no year in model + ", " + preview_->year; - nux::StaticCairoText *artist = new nux::StaticCairoText(artist_year.c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *artist = new nux::StaticCairoText(artist_year, NUX_TRACKER_LOCATION); artist->SetFont("Ubuntu 15"); std::ostringstream album_length_string; @@ -69,7 +69,7 @@ namespace unity { album_length_string << preview_->length / 60 << ":" << preview_->length % 60 << " " << _("min"); - nux::StaticCairoText *album_length = new nux::StaticCairoText(album_length_string.str().c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *album_length = new nux::StaticCairoText(album_length_string.str(), NUX_TRACKER_LOCATION); std::ostringstream genres_string; dash::AlbumPreview::Genres::iterator genre_it; @@ -84,7 +84,7 @@ namespace unity { genres_string << (*genre_it); } - nux::StaticCairoText *genres = new nux::StaticCairoText(genres_string.str().c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *genres = new nux::StaticCairoText(genres_string.str(), NUX_TRACKER_LOCATION); nux::VLayout* tracks = new nux::VLayout(NUX_TRACKER_LOCATION); @@ -104,7 +104,7 @@ namespace unity { tracks->AddView(track_widget, 0, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL); - PreviewBasicButton* primary_button = new PreviewBasicButton(preview_->primary_action_name.c_str(), NUX_TRACKER_LOCATION); + PreviewBasicButton* primary_button = new PreviewBasicButton(preview_->primary_action_name, NUX_TRACKER_LOCATION); //FIXME - add secondary action when we have the backend for it primary_button->state_change.connect ([&] (nux::View *view) { UriActivated.emit (preview_->primary_action_uri); }); diff --git a/plugins/unityshell/src/PreviewMusicTrackWidget.cpp b/plugins/unityshell/src/PreviewMusicTrackWidget.cpp index c62062e9d..4d713d422 100644 --- a/plugins/unityshell/src/PreviewMusicTrackWidget.cpp +++ b/plugins/unityshell/src/PreviewMusicTrackWidget.cpp @@ -81,7 +81,7 @@ namespace unity { { nux::HLayout *track_layout = new nux::HLayout(NUX_TRACKER_LOCATION); //FIXME - use a button subclass for absolute renderering - play_button_ = new nux::Button(number_.c_str()); + play_button_ = new nux::Button(number_); play_button_->state_change.connect ([&] (nux::View *view) { if (track_is_active) @@ -97,8 +97,8 @@ namespace unity { }); //FIXME - hook up pressing button to activation URI - nux::StaticCairoText *track_title = new nux::StaticCairoText(name_.c_str(), NUX_TRACKER_LOCATION); - nux::StaticCairoText *track_length = new nux::StaticCairoText(time_.c_str(), NUX_TRACKER_LOCATION); + nux::StaticCairoText *track_title = new nux::StaticCairoText(name_, NUX_TRACKER_LOCATION); + nux::StaticCairoText *track_length = new nux::StaticCairoText(time_, NUX_TRACKER_LOCATION); track_layout->AddView(play_button_, 0, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL); track_layout->AddLayout (new nux::SpaceLayout(6,6,6,6), 1); diff --git a/plugins/unityshell/src/ResultRendererTile.cpp b/plugins/unityshell/src/ResultRendererTile.cpp index aa3ac8aab..cfd7c4cdb 100644 --- a/plugins/unityshell/src/ResultRendererTile.cpp +++ b/plugins/unityshell/src/ResultRendererTile.cpp @@ -268,15 +268,15 @@ void ResultRendererTile::LoadIcon(Result& row) if (g_strrstr(icon_name.c_str(), "://")) { - container->slot_handle = IconLoader::GetDefault().LoadFromURI(icon_name.c_str(), style.GetTileIconSize(), slot); + container->slot_handle = IconLoader::GetDefault().LoadFromURI(icon_name, style.GetTileIconSize(), slot); } else if (G_IS_ICON(icon)) { - container->slot_handle = IconLoader::GetDefault().LoadFromGIconString(icon_name.c_str(), style.GetTileIconSize(), slot); + container->slot_handle = IconLoader::GetDefault().LoadFromGIconString(icon_name, style.GetTileIconSize(), slot); } else { - container->slot_handle = IconLoader::GetDefault().LoadFromIconName(icon_name.c_str(), style.GetTileIconSize(), slot); + container->slot_handle = IconLoader::GetDefault().LoadFromIconName(icon_name, style.GetTileIconSize(), slot); } if (icon != NULL) diff --git a/plugins/unityshell/src/SearchBar.cpp b/plugins/unityshell/src/SearchBar.cpp index f092ee927..817ef278f 100644 --- a/plugins/unityshell/src/SearchBar.cpp +++ b/plugins/unityshell/src/SearchBar.cpp @@ -218,7 +218,7 @@ void SearchBar::Init() if (show_filter_hint_) { std::string filter_str(_("Filter results")); - show_filters_ = new nux::StaticCairoText(filter_str.c_str()); + show_filters_ = new nux::StaticCairoText(filter_str); show_filters_->SetVisible(false); show_filters_->SetFont(SHOW_FILTERS_LABEL_DEFAULT_FONT.c_str()); show_filters_->SetTextColor(nux::color::White); diff --git a/plugins/unityshell/src/ShortcutView.cpp b/plugins/unityshell/src/ShortcutView.cpp index 623eb04e3..b952f6055 100644 --- a/plugins/unityshell/src/ShortcutView.cpp +++ b/plugins/unityshell/src/ShortcutView.cpp @@ -16,7 +16,7 @@ * Authored by: Andrea Azzarone <azzaronea@gmail.com> * Jay Taoko <jay.taoko@canonical.com> */ - + #include "ShortcutView.h" #include <glib/gi18n-lib.h> @@ -53,22 +53,22 @@ View::View() std::string header = "<b>"; header += _("Keyboard Shortcuts"); header += "</b>"; - - nux::StaticText* header_view = new nux::StaticText(header.c_str(), NUX_TRACKER_LOCATION); + + nux::StaticText* header_view = new nux::StaticText(header, NUX_TRACKER_LOCATION); header_view->SetTextPointSize(20/1.33); header_view->SetFontName("Ubuntu"); layout_->AddView(header_view, 1 , nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); - - layout_->AddView(new HSeparator(), 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); - - columns_layout_ = new nux::HLayout(); + + layout_->AddView(new HSeparator(), 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); + + columns_layout_ = new nux::HLayout(); columns_layout_->SetSpaceBetweenChildren(30); layout_->AddLayout(columns_layout_, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); - + // Column 1... columns_.push_back(new nux::VLayout()); columns_layout_->AddLayout(columns_[0], 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); - + // Column 2... columns_.push_back(new nux::VLayout()); columns_layout_->AddLayout(columns_[1], 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); @@ -94,12 +94,12 @@ Model::Ptr View::GetModel() nux::LinearLayout* View::CreateSectionLayout(const char* section_name) { nux::VLayout* layout = new nux::VLayout(NUX_TRACKER_LOCATION); - + std::string name("<b>"); name += glib::String(g_markup_escape_text(section_name, -1)).Str(); name += "</b>"; - nux::StaticText* section_name_view = new nux::StaticText(name.c_str(), NUX_TRACKER_LOCATION); + nux::StaticText* section_name_view = new nux::StaticText(name, NUX_TRACKER_LOCATION); section_name_view->SetTextPointSize(SECTION_NAME_FONT_SIZE); section_name_view->SetFontName("Ubuntu"); layout->AddView(new nux::SpaceLayout(10, 10, 10, 10), 0, nux::MINOR_POSITION_START, nux::MINOR_SIZE_MATCHCONTENT); @@ -116,7 +116,7 @@ nux::LinearLayout* View::CreateShortKeyEntryLayout(AbstractHint* hint) nux::HLayout* description_layout = new nux::HLayout(NUX_TRACKER_LOCATION); glib::String shortkey(g_markup_escape_text(hint->shortkey().c_str(), -1)); - + std::string skey = "<b>"; skey += shortkey.Str(); skey += "</b>"; @@ -127,7 +127,7 @@ nux::LinearLayout* View::CreateShortKeyEntryLayout(AbstractHint* hint) shortkey_view->SetTextPointSize(SHORTKEY_ENTRY_FONT_SIZE); shortkey_view->SetMinimumWidth(SHORTKEY_COLUMN_WIDTH); shortkey_view->SetMaximumWidth(SHORTKEY_COLUMN_WIDTH); - + glib::String es_desc(g_markup_escape_text(hint->description().c_str(), -1)); nux::StaticText* description_view = new nux::StaticText(es_desc.Value(), NUX_TRACKER_LOCATION); @@ -151,15 +151,15 @@ nux::LinearLayout* View::CreateShortKeyEntryLayout(AbstractHint* hint) layout->AddLayout(description_layout, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_MATCHCONTENT); layout->SetSpaceBetweenChildren(INTER_SPACE_SHORTKEY_DESCRIPTION); description_layout->SetContentDistribution(nux::MAJOR_POSITION_START); - + auto on_shortkey_changed = [](std::string const& new_shortkey, nux::StaticText* view) { std::string skey = "<b>"; skey += new_shortkey; skey += "</b>"; - + view->SetText(skey); }; - + hint->shortkey.changed.connect(sigc::bind(sigc::slot<void, std::string const&, nux::StaticText*>(on_shortkey_changed), shortkey_view)); return layout; @@ -177,7 +177,7 @@ nux::Geometry View::GetBackgroundGeometry() { nux::Geometry base = GetGeometry(); nux::Geometry background_geo; - + background_geo.width = base.width; background_geo.height = base.height; background_geo.x = (base.width - background_geo.width)/2; @@ -187,7 +187,7 @@ nux::Geometry View::GetBackgroundGeometry() } void View::DrawOverlay(nux::GraphicsEngine& GfxContext, bool force_draw, nux::Geometry clip) -{ +{ layout_->ProcessDraw(GfxContext, force_draw); } @@ -195,27 +195,27 @@ void View::RenderColumns() { int i = 0; int column = 0; - + for (auto category : model_->categories()) { // Three sections in the fist column... if (i > 2) column = 1; - + nux::LinearLayout* section_layout = CreateSectionLayout(category.c_str()); nux::LinearLayout* intermediate_layout = CreateIntermediateLayout(); intermediate_layout->SetContentDistribution(nux::MAJOR_POSITION_START); - + for (auto hint : model_->hints()[category]) { //std::string str_value = hint->prefix() + hint->value() + hint->postfix(); //boost::replace_all(str_value, "&", "&"); //boost::replace_all(str_value, "<", "<"); //boost::replace_all(str_value, ">", ">"); - + intermediate_layout->AddLayout(CreateShortKeyEntryLayout(hint), 0, nux::MINOR_POSITION_START, nux::MINOR_SIZE_FULL); } - + section_layout->AddLayout(intermediate_layout, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); if (i == 0 or i==1 or i==3 or i==4) @@ -228,10 +228,10 @@ void View::RenderColumns() } columns_[column]->AddView(section_layout, 1, nux::MINOR_POSITION_START, nux::MINOR_SIZE_FULL); - + i++; } } - + } // namespace shortcut } // namespace unity diff --git a/plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp b/plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp index adb7d1194..35e23ff5b 100644 --- a/plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp +++ b/plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp @@ -44,7 +44,7 @@ SoftwareCenterLauncherIcon::SoftwareCenterLauncherIcon(BamfApplication* app, }); SetIconType(TYPE_APPLICATION); - icon_name = icon_path.c_str(); + icon_name = icon_path; tooltip_text = _("Waiting to install"); } diff --git a/plugins/unityshell/src/SwitcherView.cpp b/plugins/unityshell/src/SwitcherView.cpp index 1ffa95251..71e6b7697 100644 --- a/plugins/unityshell/src/SwitcherView.cpp +++ b/plugins/unityshell/src/SwitcherView.cpp @@ -125,7 +125,7 @@ void SwitcherView::SetModel(SwitcherModel::Ptr model) model->detail_selection_index.changed.connect (sigc::mem_fun (this, &SwitcherView::OnDetailSelectionIndexChanged)); if (model->Selection()) - text_view_->SetText(model->Selection()->tooltip_text().c_str()); + text_view_->SetText(model->Selection()->tooltip_text()); } void SwitcherView::OnIconSizeChanged (int size) @@ -151,7 +151,7 @@ void SwitcherView::OnDetailSelectionIndexChanged (unsigned int index) if (model_->detail_selection) { Window detail_window = model_->DetailSelectionWindow(); - text_view_->SetText(model_->Selection()->NameForWindow (detail_window)); + text_view_->SetText(model_->Selection()->NameForWindow(detail_window)); } QueueDraw (); } @@ -162,11 +162,11 @@ void SwitcherView::OnDetailSelectionChanged (bool detail) if (detail) { Window detail_window = model_->DetailSelectionWindow(); - text_view_->SetText(model_->Selection()->NameForWindow (detail_window)); + text_view_->SetText(model_->Selection()->NameForWindow(detail_window)); } else { - text_view_->SetText(model_->Selection()->tooltip_text().c_str()); + text_view_->SetText(model_->Selection()->tooltip_text()); } SaveLast (); QueueDraw (); @@ -175,7 +175,7 @@ void SwitcherView::OnDetailSelectionChanged (bool detail) void SwitcherView::OnSelectionChanged(AbstractLauncherIcon::Ptr selection) { if (selection) - text_view_->SetText(selection->tooltip_text().c_str()); + text_view_->SetText(selection->tooltip_text()); SaveLast (); QueueDraw(); } @@ -217,7 +217,7 @@ RenderArg SwitcherView::InterpolateRenderArgs(RenderArg const& start, RenderArg { // easing progress = -pow(progress - 1.0f, 2) + 1; - + RenderArg result = end; result.x_rotation = start.x_rotation + (end.x_rotation - start.x_rotation) * progress; @@ -262,7 +262,7 @@ nux::Geometry SwitcherView::UpdateRenderTargets (nux::Point const& center, times layout_window->alpha = 1.0f * progress; else layout_window->alpha = 0.9f * progress; - + render_targets_.push_back (layout_window); } @@ -294,22 +294,22 @@ nux::Size SwitcherView::SpreadSize() { nux::Geometry base = GetGeometry(); nux::Size result (base.width - border_size * 2, base.height - border_size * 2); - + int width_padding = std::max(model_->Size() - 1, 0) * minimum_spacing + tile_size; int height_padding = text_size; result.width -= width_padding; result.height -= height_padding; - + return result; } -void SwitcherView::GetFlatIconPositions (int n_flat_icons, - int size, - int selection, - int &first_flat, - int &last_flat, - int &half_fold_left, +void SwitcherView::GetFlatIconPositions (int n_flat_icons, + int size, + int selection, + int &first_flat, + int &last_flat, + int &half_fold_left, int &half_fold_right) { half_fold_left = -1; @@ -388,7 +388,7 @@ std::list<RenderArg> SwitcherView::RenderArgsFlat(nux::Geometry& background_geo, bool detail_selection = model_->detail_selection; background_geo.y = base.y + base.height / 2 - (vertical_size / 2); - background_geo.height = vertical_size + text_size; + background_geo.height = vertical_size + text_size; if (model_) @@ -440,7 +440,7 @@ std::list<RenderArg> SwitcherView::RenderArgsFlat(nux::Geometry& background_geo, int half_fold_left; int half_fold_right; - GetFlatIconPositions (n_flat_icons, size, selection, first_flat, last_flat, half_fold_left, half_fold_right); + GetFlatIconPositions (n_flat_icons, size, selection, first_flat, last_flat, half_fold_left, half_fold_right); SwitcherModel::iterator it; int i = 0; |
