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.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index 0be7d1a..49e66ad 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -114,97 +114,96 @@ void AbPickItem::setContentFromEditor( QWidget *w )
114 114
115AbTable::AbTable( const QValueList<int> order, QWidget *parent, const char *name ) 115AbTable::AbTable( const QValueList<int> order, QWidget *parent, const char *name )
116 : QTable( parent, name ), 116 : QTable( parent, name ),
117 lastSortCol( -1 ), 117 lastSortCol( -1 ),
118 asc( TRUE ), 118 asc( TRUE ),
119 intFields( order ), 119 intFields( order ),
120 enablePainting( true ), 120 enablePainting( true ),
121 columnVisible( true ), 121 columnVisible( true ),
122 countNested( 0 ) 122 countNested( 0 )
123{ 123{
124 //odebug << "C'tor start" << oendl; 124 //odebug << "C'tor start" << oendl;
125 setSelectionMode( NoSelection ); 125 setSelectionMode( NoSelection );
126 init(); 126 init();
127 setSorting( TRUE ); 127 setSorting( TRUE );
128 connect( this, SIGNAL(clicked(int,int,int,const QPoint&)), 128 connect( this, SIGNAL(clicked(int,int,int,const QPoint&)),
129 this, SLOT(itemClicked(int,int)) ); 129 this, SLOT(itemClicked(int,int)) );
130 130
131 // contactList.clear(); 131 // contactList.clear();
132 //odebug << "C'tor end" << oendl; 132 //odebug << "C'tor end" << oendl;
133} 133}
134 134
135AbTable::~AbTable() 135AbTable::~AbTable()
136{ 136{
137} 137}
138 138
139void AbTable::init() 139void AbTable::init()
140{ 140{
141 // :SX showChar = '\0'; 141 // :SX showChar = '\0';
142 setNumRows( 0 ); 142 setNumRows( 0 );
143 setNumCols( 2 ); 143 setNumCols( 2 );
144 144
145 horizontalHeader()->setLabel( 0, tr( "Full Name" )); 145 horizontalHeader()->setLabel( 0, tr( "Full Name" ));
146 horizontalHeader()->setLabel( 1, tr( "Contact" )); 146 horizontalHeader()->setLabel( 1, tr( "Contact" ));
147 setLeftMargin( 0 ); 147 setLeftMargin( 0 );
148 verticalHeader()->hide(); 148 verticalHeader()->hide();
149 columnVisible = true; 149 columnVisible = true;
150} 150}
151 151
152void AbTable::setContacts( const Opie::OPimContactAccess::List& viewList ) 152void AbTable::setContacts( const Opie::OPimContactAccess::List& viewList )
153{ 153{
154 odebug << "AbTable::setContacts()" << oendl; 154 odebug << "AbTable::setContacts()" << oendl;
155 155
156 clear(); 156 clear();
157 m_viewList = viewList; 157 m_viewList = viewList;
158 158
159 setSorting( false ); 159 setSorting( false );
160 setPaintingEnabled( FALSE ); 160 setPaintingEnabled( FALSE );
161 161
162 Opie::OPimContactAccess::List::Iterator it;
163 setNumRows( m_viewList.count() ); 162 setNumRows( m_viewList.count() );
164 //int row = 0; 163 //int row = 0;
165 // for ( it = m_viewList.begin(); it != m_viewList.end(); ++it ) 164 // for ( it = m_viewList.begin(); it != m_viewList.end(); ++it )
166 // insertIntoTable( *it, row++ ); 165 // insertIntoTable( *it, row++ );
167 166
168 // setSorting( true ); 167 // setSorting( true );
169 168
170 // resort(); 169 // resort();
171 170
172 updateVisible(); 171 updateVisible();
173 172
174 setPaintingEnabled( TRUE ); 173 setPaintingEnabled( TRUE );
175 174
176} 175}
177 176
178void AbTable::setOrderedList( const QValueList<int> ordered ) 177void AbTable::setOrderedList( const QValueList<int> ordered )
179{ 178{
180 intFields = ordered; 179 intFields = ordered;
181} 180}
182 181
183 182
184bool AbTable::selectContact( int UID ) 183bool AbTable::selectContact( int UID )
185{ 184{
186 odebug << "AbTable::selectContact( " << UID << " )" << oendl; 185 odebug << "AbTable::selectContact( " << UID << " )" << oendl;
187 int rows = numRows(); 186 int rows = numRows();
188 bool found = false; 187 bool found = false;
189 188
190 setPaintingEnabled( FALSE ); 189 setPaintingEnabled( FALSE );
191 odebug << "Search start" << oendl; 190 odebug << "Search start" << oendl;
192 for ( int r = 0; r < rows; ++r ) { 191 for ( int r = 0; r < rows; ++r ) {
193 if ( m_viewList.uidAt( r ) == UID ){ 192 if ( m_viewList.uidAt( r ) == UID ){
194 ensureCellVisible( r, 0 ); 193 ensureCellVisible( r, 0 );
195 setCurrentCell( r, 0 ); 194 setCurrentCell( r, 0 );
196 found = true; 195 found = true;
197 break; 196 break;
198 } 197 }
199 } 198 }
200 odebug << "Search end" << oendl; 199 odebug << "Search end" << oendl;
201 200
202 if ( !found ){ 201 if ( !found ){
203 ensureCellVisible( 0,0 ); 202 ensureCellVisible( 0,0 );
204 setCurrentCell( 0, 0 ); 203 setCurrentCell( 0, 0 );
205 } 204 }
206 205
207 setPaintingEnabled( TRUE ); 206 setPaintingEnabled( TRUE );
208 207
209 return true; 208 return true;
210} 209}