summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abtable.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abtable.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index f7bff58..29f4383 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -82,97 +82,97 @@ AbPickItem::AbPickItem( QTable *t ) :
82} 82}
83 83
84QWidget *AbPickItem::createEditor() const 84QWidget *AbPickItem::createEditor() const
85{ 85{
86 QComboBox* combo = new QComboBox( table()->viewport() ); 86 QComboBox* combo = new QComboBox( table()->viewport() );
87 ( (AbPickItem*)this )->cb = combo; 87 ( (AbPickItem*)this )->cb = combo;
88 AbTable* t = static_cast<AbTable*>(table()); 88 AbTable* t = static_cast<AbTable*>(table());
89 QStringList c = t->choiceNames(); 89 QStringList c = t->choiceNames();
90 int cur = 0; 90 int cur = 0;
91 for (QStringList::ConstIterator it = c.begin(); it!=c.end(); ++it) { 91 for (QStringList::ConstIterator it = c.begin(); it!=c.end(); ++it) {
92 if ( *it == text() ) 92 if ( *it == text() )
93 cur = combo->count(); 93 cur = combo->count();
94 combo->insertItem(*it); 94 combo->insertItem(*it);
95 } 95 }
96 combo->setCurrentItem(cur); 96 combo->setCurrentItem(cur);
97 return combo; 97 return combo;
98} 98}
99 99
100void AbPickItem::setContentFromEditor( QWidget *w ) 100void AbPickItem::setContentFromEditor( QWidget *w )
101{ 101{
102 if ( w->inherits("QComboBox") ) 102 if ( w->inherits("QComboBox") )
103 setText( ( (QComboBox*)w )->currentText() ); 103 setText( ( (QComboBox*)w )->currentText() );
104 else 104 else
105 QTableItem::setContentFromEditor( w ); 105 QTableItem::setContentFromEditor( w );
106} 106}
107 107
108#endif 108#endif
109 109
110/*! 110/*!
111 \class AbTable abtable.h 111 \class AbTable abtable.h
112 112
113 \brief QTable based class for showing a list of entries 113 \brief QTable based class for showing a list of entries
114*/ 114*/
115 115
116AbTable::AbTable( const QValueList<int> order, QWidget *parent, const char *name ) 116AbTable::AbTable( const QValueList<int> order, QWidget *parent, const char *name )
117 : QTable( parent, name ), 117 : QTable( parent, name ),
118 lastSortCol( -1 ), 118 lastSortCol( -1 ),
119 asc( TRUE ), 119 asc( TRUE ),
120 intFields( order ), 120 intFields( order ),
121 enablePainting( true ), 121 enablePainting( true ),
122 columnVisible( true ), 122 columnVisible( true ),
123 countNested( 0 ) 123 countNested( 0 )
124{ 124{
125 //qWarning("C'tor start"); 125 //qWarning("C'tor start");
126 126
127 setSelectionMode( NoSelection ); 127 setSelectionMode( NoSelection );
128 init(); 128 init();
129 setSorting( TRUE ); 129 setSorting( TRUE );
130 connect( this, SIGNAL(clicked(int,int,int,const QPoint &)), 130 connect( this, SIGNAL(clicked(int,int,int,const QPoint&)),
131 this, SLOT(itemClicked(int,int)) ); 131 this, SLOT(itemClicked(int,int)) );
132 132
133 // contactList.clear(); 133 // contactList.clear();
134 //qWarning("C'tor end"); 134 //qWarning("C'tor end");
135} 135}
136 136
137AbTable::~AbTable() 137AbTable::~AbTable()
138{ 138{
139} 139}
140 140
141void AbTable::init() 141void AbTable::init()
142{ 142{
143 // :SX showChar = '\0'; 143 // :SX showChar = '\0';
144 setNumRows( 0 ); 144 setNumRows( 0 );
145 setNumCols( 2 ); 145 setNumCols( 2 );
146 146
147 horizontalHeader()->setLabel( 0, tr( "Full Name" )); 147 horizontalHeader()->setLabel( 0, tr( "Full Name" ));
148 horizontalHeader()->setLabel( 1, tr( "Contact" )); 148 horizontalHeader()->setLabel( 1, tr( "Contact" ));
149 setLeftMargin( 0 ); 149 setLeftMargin( 0 );
150 verticalHeader()->hide(); 150 verticalHeader()->hide();
151 columnVisible = true; 151 columnVisible = true;
152} 152}
153 153
154void AbTable::setContacts( const OContactAccess::List& viewList ) 154void AbTable::setContacts( const OContactAccess::List& viewList )
155{ 155{
156 qWarning("AbTable::setContacts()"); 156 qWarning("AbTable::setContacts()");
157 157
158 clear(); 158 clear();
159 m_viewList = viewList; 159 m_viewList = viewList;
160 160
161 setSorting( false ); 161 setSorting( false );
162 setPaintingEnabled( FALSE ); 162 setPaintingEnabled( FALSE );
163 163
164 OContactAccess::List::Iterator it; 164 OContactAccess::List::Iterator it;
165 setNumRows( m_viewList.count() ); 165 setNumRows( m_viewList.count() );
166 //int row = 0; 166 //int row = 0;
167 // for ( it = m_viewList.begin(); it != m_viewList.end(); ++it ) 167 // for ( it = m_viewList.begin(); it != m_viewList.end(); ++it )
168 // insertIntoTable( *it, row++ ); 168 // insertIntoTable( *it, row++ );
169 169
170 // setSorting( true ); 170 // setSorting( true );
171 171
172 // resort(); 172 // resort();
173 173
174 updateVisible(); 174 updateVisible();
175 175
176 setPaintingEnabled( TRUE ); 176 setPaintingEnabled( TRUE );
177 177
178} 178}