X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fheader.cpp;h=e2ccfedc4e4d53cdb68d8897edaa1ec7f1622b24;hp=4ad28cf1ca7529932c88e86d1f9041439cf88c9d;hb=aca9aa834c742ba70f49d1ac3eb2d1e02e759416;hpb=f4e57597347e47a4ea58fbdc7b0a22e07f1c0ede diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 4ad28cf1..e2ccfedc 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #include "header.hpp" @@ -24,8 +23,8 @@ #include "signal.hpp" #include "tracegroup.hpp" -#include #include +#include #include @@ -39,11 +38,9 @@ #include using boost::make_filter_iterator; + +using std::count_if; using std::dynamic_pointer_cast; -using std::max; -using std::make_pair; -using std::min; -using std::pair; using std::shared_ptr; using std::stable_sort; using std::vector; @@ -106,8 +103,7 @@ void Header::paintEvent(QPaintEvent*) // would be clipped away. const QRect rect(0, 0, width() - BaselineOffset, height()); - vector< shared_ptr > items( - view_.list_by_type()); + vector< shared_ptr > items(view_.list_by_type()); stable_sort(items.begin(), items.end(), [](const shared_ptr &a, const shared_ptr &b) { @@ -139,8 +135,7 @@ void Header::contextMenuEvent(QContextMenuEvent *event) const vector< shared_ptr > items( view_.list_by_type()); - if (std::count_if(items.begin(), items.end(), item_selected) > 1) - { + if (count_if(items.begin(), items.end(), item_selected) > 1) { menu->addSeparator(); QAction *const group = new QAction(tr("Group"), this); @@ -179,7 +174,7 @@ void Header::on_group() shared_ptr group(new TraceGroup()); shared_ptr mouse_down_item( - std::dynamic_pointer_cast(mouse_down_item_)); + dynamic_pointer_cast(mouse_down_item_)); shared_ptr focus_item( mouse_down_item ? mouse_down_item : selected_items.front());