1. data_info_hint_ doesn't seem to be used.
2. Don't need to check if the hints are empty if you're iterating over them.
3. dash::Preview::InfoHintPtr const& info_hint. even though it's a pointer, you're still constructing the wrapper.
4. Not sure what this is doing, but i might be missing something. looping over the info hints. if it is a speicifc id, then set the preview data and get an error message; otherwise continue looping, but dont update the data, even though you are continuing to do a GetErrorMessage for it?
You have some text conflicts in dash/DashView.cpp & UnityCore/ Preview. cpp
27 + * Copyright (C) 2011-2012 Canonical Ltd
41 + * Authored by: Neil Jagdish Patel <email address hidden>
42 + * Michal Hruby <email address hidden>
Please update all headers to include 2013 and your contact details
277 { displaying_ )
278 +
279 if (!preview_
extra line.
407 +const std::string MusicPaymentPre view::DATA_ INFOHINT_ ID = "album_ purchase_ preview" ; view::DATA_ PASSWORD_ KEY = "password"; view::CHANGE_ PAYMENT_ ACTION = "change_ payment_ method" ; view::FORGOT_ PASSWORD_ ACTION = "forgot_password"; view::CANCEL_ PURCHASE_ ACTION = "cancel_purchase"; view::PURCHASE_ ALBUM_ACTION = "purchase_album";
408 +const std::string MusicPaymentPre
409 +const std::string MusicPaymentPre
410 +const std::string MusicPaymentPre
411 +const std::string MusicPaymentPre
412 +const std::string MusicPaymentPre
Is there a reason why these are scoped to MusicPaymentPreview class? Can you put them in global namespace?
936 + std::map< std::string, nux::ObjectPtr< nux::AbstractBu tton>> sorted_buttons_;
What is sorted about a map ? ;)
701 + actions_ layout- >AddView( buttons_ [MusicPaymentPr eview:: CHANGE_ PAYMENT_ ACTION] .GetPointer( ), POSITION_ START, nux::MINOR_ SIZE_FULL, LAYOUT_ END); layout- >AddView( buttons_ [MusicPaymentPr eview:: FORGOT_ PASSWORD_ ACTION] .GetPointer( ), POSITION_ START, nux::MINOR_ SIZE_FULL, LAYOUT_ END);
702 + sorted_
703 + 1, nux::MINOR_
704 + 100.0f, nux::NUX_
705 + actions_
706 + sorted_
707 + 1, nux::MINOR_
708 + 100.0f, nux::NUX_
728 + buttons_ data_layout- >AddView( sorted_ buttons_ [MusicPaymentPr eview:: CANCEL_ PURCHASE_ ACTION] .GetPointer( ), POSITION_ CENTER, nux::MINOR_ SIZE_FULL, 100.0f, LAYOUT_ END); data_layout- >AddView( sorted_ buttons_ [MusicPaymentPr eview:: PURCHASE_ ALBUM_ACTION] .GetPointer( ), POSITION_ CENTER, nux::MINOR_ SIZE_FULL, 100.0f, LAYOUT_ END);
729 + 1, nux::MINOR_
730 + nux::NUX_
731 + buttons_
732 + 1, nux::MINOR_
733 + nux::NUX_
should check if sorted_buttons_ contains the actions before adding them.
784 + dash::Preview: :InfoHintPtrLis t hints = preview_ model_- >GetInfoHints( ); :InfoHintPtr data_info_hint_ = NULL; Preview: :InfoHintPtr info_hint : hints) view::DATA_ INFOHINT_ ID) (preview_ data);
785 + GVariant *preview_data = NULL;
786 + dash::Preview:
787 + if (!hints.empty())
788 + {
789 + for (dash::
790 + {
791 + if (info_hint->id == MusicPaymentPre
792 + {
793 + preview_data = info_hint->value;
794 + }
795 + if (preview_data != NULL)
796 + {
797 + error_message_ = GetErrorMessage
798 + }
799 + }
800 + }
1. data_info_hint_ doesn't seem to be used. :InfoHintPtr const& info_hint. even though it's a pointer, you're still constructing the wrapper.
2. Don't need to check if the hints are empty if you're iterating over them.
3. dash::Preview:
4. Not sure what this is doing, but i might be missing something. looping over the info hints. if it is a speicifc id, then set the preview data and get an error message; otherwise continue looping, but dont update the data, even though you are continuing to do a GetErrorMessage for it?
765 + // set the tab ordering der(password_ entry_- >text_entry( )); er(sorted_ buttons_ [MusicPaymentPr eview:: CANCEL_ PURCHASE_ ACTION] .GetPointer( )); er(sorted_ buttons_ [MusicPaymentPr eview:: PURCHASE_ ALBUM_ACTION] .GetPointer( )); er(sorted_ buttons_ [MusicPaymentPr eview:: CHANGE_ PAYMENT_ ACTION] .GetPointer( )); er(sorted_ buttons_ [MusicPaymentPr eview:: FORGOT_ PASSWORD_ ACTION] .GetPointer( ));
766 + SetFirstInTabOr
767 + SetLastInTabOrd
768 + SetLastInTabOrd
769 + SetLastInTabOrd
770 + SetLastInTabOrd
Why are you setting the tab order in inside PreLayoutManage ment? Shouldn't it be done only once when you create the views?
1431 + virtual void PreLayoutManage ment() = 0;
This is a virtual method in nux::Area I think. Why are you making it pure virtual in PaymentPreview?
1735 +
1736 +
extra lines
1778 +using namespace testing;
can you move this to after the includes please.