summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abtable.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abtable.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index 17277b4..759cb48 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -151,4 +151,5 @@ AbTable::~AbTable()
void AbTable::init()
{
+ showChar = '\0';
setNumRows( 0 );
setNumCols( 2 );
@@ -453,10 +454,11 @@ void AbTable::addEntry( const Contact &newCnt )
void AbTable::resizeRows( int size ) {
-
+/*
if (numRows()) {
for (int i = 0; i < numRows(); i++) {
setRowHeight( i, size );
}
- }
+ }*/
+ updateVisible();
}
@@ -1009,4 +1011,11 @@ void AbTable::setShowCategory( const QString &c )
}
+void AbTable::setShowByLetter( char c )
+{
+ showChar = tolower(c);
+ qDebug( "AbTable::setShowByLetter %c", showChar);
+ updateVisible();
+}
+
QString AbTable::showCategory() const
{
@@ -1033,4 +1042,6 @@ void AbTable::updateVisible()
AbTableItem *ati;
Contact *cnt;
+ QString fileAsName;
+ QString tmpStr;
visible = 0;
@@ -1044,4 +1055,5 @@ void AbTable::updateVisible()
cnt = &contactList[ati];
cats = cnt->categories();
+ fileAsName = cnt->fileAs();
hide = false;
if ( !showCat.isEmpty() ) {
@@ -1063,4 +1075,14 @@ void AbTable::updateVisible()
}
}
+ if ( showChar != '\0' ) {
+ tmpStr = fileAsName.left(1);
+ tmpStr = tmpStr.lower();
+ qDebug( "updateVisible ");
+ qDebug( tmpStr );
+ qDebug( "updateVisible2 %c", showChar );
+ if ( tmpStr != QString(QChar(showChar)) ) {
+ hide = true;
+ }
+ }
if ( hide ) {
if ( currentRow() == row )