Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 342075 | Differences between
and this patch

Collapse All | Expand All

(-)oprofile-0.9.6/configure.in (-4 / +13 lines)
Lines 131-137 Link Here
131
LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
131
LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
132
X_LIBS="$LIBS"
132
X_LIBS="$LIBS"
133
AC_SUBST(X_LIBS)
133
AC_SUBST(X_LIBS)
134
QT_DO_IT_ALL
134
135
136
AC_ARG_ENABLE(qt4,[  --enable-qt4  compile with gui component (qt4 using qt3support)]) 
137
if test "x$enable_qt4"  = "xyes"; then 
138
   PKG_CHECK_MODULES(QT, Qt3Support QtGui,,exit)
139
   AC_CHECK_PROG(MOC, moc, moc)
140
   AC_CHECK_PROG(UIC3, uic3, uic3)
141
fi 
142
143
135
LIBS="$ORIG_X_SAVE_LIBS"
144
LIBS="$ORIG_X_SAVE_LIBS"
136
145
137
dnl enable pch for c++
146
dnl enable pch for c++
Lines 155-161 Link Here
155
164
156
# do NOT put tests here, they will fail in the case X is not installed !
165
# do NOT put tests here, they will fail in the case X is not installed !
157
 
166
 
158
AM_CONDITIONAL(have_qt, test -n "$QT_LIB")
167
AM_CONDITIONAL(have_qt, test -n "$QT_LIBS")
159
168
160
AX_CFLAGS_OPTION(OP_CFLAGS,[-W])
169
AX_CFLAGS_OPTION(OP_CFLAGS,[-W])
161
AX_CXXFLAGS_OPTION(OP_CXXFLAGS,[-W])
170
AX_CXXFLAGS_OPTION(OP_CXXFLAGS,[-W])
Lines 268-275 Link Here
268
277
269
AX_COPY_IF_CHANGE(doc/xsl/catalog-1.xml, doc/xsl/catalog.xml)
278
AX_COPY_IF_CHANGE(doc/xsl/catalog-1.xml, doc/xsl/catalog.xml)
270
279
271
if test -z "$QT_LIB"; then
280
if test -z "$QT_LIBS"; then
272
	echo "Warning: a working Qt not found; no GUI will be built"
281
	echo "Warning: a working Qt not found or GUI disabled; no GUI will be built"
273
fi
282
fi
274
283
275
if test "`getent passwd oprofile 2>/dev/null`" == "" || \
284
if test "`getent passwd oprofile 2>/dev/null`" == "" || \
(-)oprofile-0.9.6/gui/Makefile.am (-3 / +3 lines)
Lines 14-20 Link Here
14
if have_qt
14
if have_qt
15
15
16
AM_CPPFLAGS = \
16
AM_CPPFLAGS = \
17
	@QT_INCLUDES@ \
17
	@QT_CFLAGS@ \
18
	-DQT3_SUPPORT \
18
	-I ${top_srcdir}/libop \
19
	-I ${top_srcdir}/libop \
19
	-I ${top_srcdir}/libutil++ \
20
	-I ${top_srcdir}/libutil++ \
20
	-I ${top_srcdir}/libutil
21
	-I ${top_srcdir}/libutil
Lines 30-37 Link Here
30
	../libop/libop.a \
31
	../libop/libop.a \
31
	../libutil/libutil.a \
32
	../libutil/libutil.a \
32
	ui/liboprof_start.a \
33
	ui/liboprof_start.a \
33
	@QT_LDFLAGS@ \
34
	@QT_LIBS@ \
34
	@QT_LIB@ \
35
	@X_LIBS@
35
	@X_LIBS@
36
36
37
oprof_start.moc.cpp: ${top_srcdir}/gui/oprof_start.h
37
oprof_start.moc.cpp: ${top_srcdir}/gui/oprof_start.h
(-)oprofile-0.9.6/gui/oprof_start.cpp (-31 / +31 lines)
Lines 20-38 Link Here
20
#include <fstream>
20
#include <fstream>
21
#include <algorithm>
21
#include <algorithm>
22
22
23
#include <qlineedit.h>
23
#include <Qt/qlineedit.h>
24
#include <qlistview.h>
24
#include <Qt/q3listview.h>
25
#include <qcombobox.h>
25
#include <Qt/q3combobox.h>
26
#include <qlistbox.h>
26
#include <Qt/q3listbox.h>
27
#include <qfiledialog.h>
27
#include <Qt/q3filedialog.h>
28
#include <qbuttongroup.h>
28
#include <Qt/q3buttongroup.h>
29
#include <qcheckbox.h>
29
#include <Qt/qcheckbox.h>
30
#include <qtabwidget.h>
30
#include <Qt/qtabwidget.h>
31
#include <qmessagebox.h>
31
#include <Qt/qmessagebox.h>
32
#include <qvalidator.h>
32
#include <Qt/qvalidator.h>
33
#include <qlabel.h>
33
#include <Qt/qlabel.h>
34
#include <qpushbutton.h>
34
#include <Qt/qpushbutton.h>
35
#include <qheader.h>
35
#include <Qt/q3header.h>
36
36
37
#include "config.h"
37
#include "config.h"
38
#include "oprof_start.h"
38
#include "oprof_start.h"
Lines 268-277 Link Here
268
namespace {
268
namespace {
269
269
270
/// find the first item with the given text in column 0 or return NULL
270
/// find the first item with the given text in column 0 or return NULL
271
QListViewItem * findItem(QListView * view, char const * name)
271
Q3ListViewItem * findItem(Q3ListView * view, char const * name)
272
{
272
{
273
	// Qt 2.3.1 does not have QListView::findItem()
273
	// Qt 2.3.1 does not have QListView::findItem()
274
	QListViewItem * item = view->firstChild();
274
	Q3ListViewItem * item = view->firstChild();
275
275
276
	while (item && strcmp(item->text(0).latin1(), name))
276
	while (item && strcmp(item->text(0).latin1(), name))
277
		item = item->nextSibling();
277
		item = item->nextSibling();
Lines 292-298 Link Here
292
	event_cfgs[descr.name].user_ring_count = 1;
292
	event_cfgs[descr.name].user_ring_count = 1;
293
	event_cfgs[descr.name].os_ring_count = 1;
293
	event_cfgs[descr.name].os_ring_count = 1;
294
294
295
	QListViewItem * item = findItem(events_list, descr.name);
295
	Q3ListViewItem * item = findItem(events_list, descr.name);
296
	if (item)
296
	if (item)
297
		item->setSelected(true);
297
		item->setSelected(true);
298
}
298
}
Lines 349-355 Link Here
349
			event_cfgs[ev_name].os_ring_count = 1;
349
			event_cfgs[ev_name].os_ring_count = 1;
350
		}
350
		}
351
351
352
		QListViewItem * item = findItem(events_list, ev_name.c_str());
352
		Q3ListViewItem * item = findItem(events_list, ev_name.c_str());
353
		if (item)
353
		if (item)
354
			item->setSelected(true);
354
			item->setSelected(true);
355
	}
355
	}
Lines 436-442 Link Here
436
436
437
	for (vector<op_event_descr>::reverse_iterator cit = v_events.rbegin();
437
	for (vector<op_event_descr>::reverse_iterator cit = v_events.rbegin();
438
	     cit != v_events.rend(); ++cit) {
438
	     cit != v_events.rend(); ++cit) {
439
		new QListViewItem(events_list, cit->name.c_str());
439
		new Q3ListViewItem(events_list, cit->name.c_str());
440
	}
440
	}
441
441
442
	setUpdatesEnabled(true);
442
	setUpdatesEnabled(true);
Lines 467-473 Link Here
467
}
467
}
468
468
469
469
470
bool oprof_start::is_selectable_event(QListViewItem * item)
470
bool oprof_start::is_selectable_event(Q3ListViewItem * item)
471
{
471
{
472
	if (item->isSelected())
472
	if (item->isSelected())
473
		return true;
473
		return true;
Lines 486-492 Link Here
486
486
487
void oprof_start::draw_event_list()
487
void oprof_start::draw_event_list()
488
{
488
{
489
	QListViewItem * cur;
489
	Q3ListViewItem * cur;
490
	for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) {
490
	for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) {
491
		if (is_selectable_event(cur))
491
		if (is_selectable_event(cur))
492
			cur->setPixmap(0, *green_pixmap);
492
			cur->setPixmap(0, *green_pixmap);
Lines 500-506 Link Here
500
{
500
{
501
	vector<op_event const *> events;
501
	vector<op_event const *> events;
502
502
503
	set<QListViewItem *>::const_iterator it;
503
	set<Q3ListViewItem *>::const_iterator it;
504
	for (it = selected_events.begin(); it != selected_events.end(); ++it)
504
	for (it = selected_events.begin(); it != selected_events.end(); ++it)
505
		events.push_back(find_event_by_name((*it)->text(0).latin1(),0,0));
505
		events.push_back(find_event_by_name((*it)->text(0).latin1(),0,0));
506
506
Lines 520-543 Link Here
520
	// (de)selected item so we record a set of selected items and diff
520
	// (de)selected item so we record a set of selected items and diff
521
	// it in the appropriate way with the previous list of selected items.
521
	// it in the appropriate way with the previous list of selected items.
522
522
523
	set<QListViewItem *> current_selection;
523
	set<Q3ListViewItem *> current_selection;
524
	QListViewItem * cur;
524
	Q3ListViewItem * cur;
525
	for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) {
525
	for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) {
526
		if (cur->isSelected())
526
		if (cur->isSelected())
527
			current_selection.insert(cur);
527
			current_selection.insert(cur);
528
	}
528
	}
529
529
530
	// First remove the deselected item.
530
	// First remove the deselected item.
531
	vector<QListViewItem *> new_deselected;
531
	vector<Q3ListViewItem *> new_deselected;
532
	set_difference(selected_events.begin(), selected_events.end(),
532
	set_difference(selected_events.begin(), selected_events.end(),
533
		       current_selection.begin(), current_selection.end(),
533
		       current_selection.begin(), current_selection.end(),
534
		       back_inserter(new_deselected));
534
		       back_inserter(new_deselected));
535
	vector<QListViewItem *>::const_iterator it;
535
	vector<Q3ListViewItem *>::const_iterator it;
536
	for (it = new_deselected.begin(); it != new_deselected.end(); ++it)
536
	for (it = new_deselected.begin(); it != new_deselected.end(); ++it)
537
		selected_events.erase(*it);
537
		selected_events.erase(*it);
538
538
539
	// Now try to add the newly selected item if enough HW resource exists
539
	// Now try to add the newly selected item if enough HW resource exists
540
	vector<QListViewItem *> new_selected;
540
	vector<Q3ListViewItem *> new_selected;
541
	set_difference(current_selection.begin(), current_selection.end(),
541
	set_difference(current_selection.begin(), current_selection.end(),
542
		       selected_events.begin(), selected_events.end(),
542
		       selected_events.begin(), selected_events.end(),
543
		       back_inserter(new_selected));
543
		       back_inserter(new_selected));
Lines 558-564 Link Here
558
}
558
}
559
559
560
560
561
void oprof_start::event_over(QListViewItem * item)
561
void oprof_start::event_over(Q3ListViewItem * item)
562
{
562
{
563
	op_event_descr const & descr = locate_event(item->text(0).latin1());
563
	op_event_descr const & descr = locate_event(item->text(0).latin1());
564
564
Lines 566-575 Link Here
566
	if (!is_selectable_event(item)) {
566
	if (!is_selectable_event(item)) {
567
		help_str += " conflicts with:";
567
		help_str += " conflicts with:";
568
568
569
		set<QListViewItem *>::const_iterator it;
569
		set<Q3ListViewItem *>::const_iterator it;
570
		for (it = selected_events.begin(); 
570
		for (it = selected_events.begin(); 
571
		     it != selected_events.end(); ) {
571
		     it != selected_events.end(); ) {
572
			QListViewItem * temp = *it;
572
			Q3ListViewItem * temp = *it;
573
			selected_events.erase(it++);
573
			selected_events.erase(it++);
574
			if (is_selectable_event(item)) {
574
			if (is_selectable_event(item)) {
575
				help_str += " ";
575
				help_str += " ";
Lines 844-850 Link Here
844
844
845
	bool one_enable = false;
845
	bool one_enable = false;
846
846
847
	QListViewItem * cur;
847
	Q3ListViewItem * cur;
848
	for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) {
848
	for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) {
849
		if (!cur->isSelected())
849
		if (!cur->isSelected())
850
			continue;
850
			continue;
Lines 946-952 Link Here
946
	vector<string> tmpargs;
946
	vector<string> tmpargs;
947
	tmpargs.push_back("--setup");
947
	tmpargs.push_back("--setup");
948
948
949
	QListViewItem * cur;
949
	Q3ListViewItem * cur;
950
	for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) {
950
	for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) {
951
		if (!cur->isSelected())
951
		if (!cur->isSelected())
952
			continue;
952
			continue;
(-)oprofile-0.9.6/gui/oprof_start.h (-4 / +4 lines)
Lines 62-68 Link Here
62
	/// events selection change
62
	/// events selection change
63
	void event_selected();
63
	void event_selected();
64
	/// the mouse is over an event
64
	/// the mouse is over an event
65
	void event_over(QListViewItem *);
65
	void event_over(Q3ListViewItem *);
66
	/// state of separate_kernel_cb changed
66
	/// state of separate_kernel_cb changed
67
	void on_separate_kernel_cb_changed(int);
67
	void on_separate_kernel_cb_changed(int);
68
	/// reset sample files
68
	/// reset sample files
Lines 121-127 Link Here
121
	void draw_event_list();
121
	void draw_event_list();
122
122
123
	/// return true if item is selectable or already selected
123
	/// return true if item is selectable or already selected
124
	bool is_selectable_event(QListViewItem * item);
124
	bool is_selectable_event(Q3ListViewItem * item);
125
125
126
	/// try to alloc counters for the selected_events
126
	/// try to alloc counters for the selected_events
127
	bool alloc_selected_events() const;
127
	bool alloc_selected_events() const;
Lines 139-146 Link Here
139
	/// The currently selected events. We must track this because
139
	/// The currently selected events. We must track this because
140
	/// with multiple selection listbox QT doesn't allow to know
140
	/// with multiple selection listbox QT doesn't allow to know
141
	/// what is the last selected item. events_selected() update it
141
	/// what is the last selected item. events_selected() update it
142
	std::set<QListViewItem *> selected_events;
142
	std::set<Q3ListViewItem *> selected_events;
143
	QListViewItem * current_event;
143
	Q3ListViewItem * current_event;
144
144
145
	/// current config
145
	/// current config
146
	config_setting config;
146
	config_setting config;
(-)oprofile-0.9.6/gui/ui/Makefile.am (-4 / +4 lines)
Lines 2-19 Link Here
2
2
3
if have_qt
3
if have_qt
4
4
5
AM_CPPFLAGS = @QT_INCLUDES@
5
AM_CPPFLAGS = @QT_CFLAGS@
6
6
7
AM_CXXFLAGS = @OP_CXXFLAGS@
7
AM_CXXFLAGS = @OP_CXXFLAGS@ -DQT3_SUPPORT
8
8
9
noinst_LIBRARIES = liboprof_start.a
9
noinst_LIBRARIES = liboprof_start.a
10
nodist_liboprof_start_a_SOURCES = oprof_start.base.cpp oprof_start.base.moc.cpp
10
nodist_liboprof_start_a_SOURCES = oprof_start.base.cpp oprof_start.base.moc.cpp
11
11
12
oprof_start.base.h: oprof_start.base.ui
12
oprof_start.base.h: oprof_start.base.ui
13
	$(UIC) -o $@ $<
13
	$(UIC3) -o $@ $<
14
14
15
oprof_start.base.cpp: oprof_start.base.h oprof_start.base.ui
15
oprof_start.base.cpp: oprof_start.base.h oprof_start.base.ui
16
	$(UIC) -o $@ -impl $^
16
	$(UIC3) -o $@ -impl $^
17
17
18
oprof_start.base.moc.cpp: oprof_start.base.h
18
oprof_start.base.moc.cpp: oprof_start.base.h
19
	$(MOC) -o $@ $<
19
	$(MOC) -o $@ $<

Return to bug 342075