Diffstat (limited to 'kaddressbook/kaddressbookview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/kaddressbookview.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/kaddressbook/kaddressbookview.cpp b/kaddressbook/kaddressbookview.cpp index 424d52a..09859c2 100644 --- a/kaddressbook/kaddressbookview.cpp +++ b/kaddressbook/kaddressbookview.cpp | |||
@@ -44,20 +44,36 @@ KAddressBookView::KAddressBookView( KABC::AddressBook *ab, QWidget *parent, | |||
44 | : QWidget( parent, name ), mAddressBook( ab ), mFieldList() | 44 | : QWidget( parent, name ), mAddressBook( ab ), mFieldList() |
45 | { | 45 | { |
46 | 46 | ||
47 | initGUI(); | 47 | initGUI(); |
48 | } | 48 | } |
49 | 49 | ||
50 | KAddressBookView::~KAddressBookView() | 50 | KAddressBookView::~KAddressBookView() |
51 | { | 51 | { |
52 | kdDebug(5720) << "KAddressBookView::~KAddressBookView: destroying - " | 52 | |
53 | << name() << endl; | ||
54 | } | 53 | } |
55 | 54 | ||
55 | QRegExp KAddressBookView::getRegExp( const QString s ) | ||
56 | { | ||
57 | QRegExp re; | ||
58 | |||
59 | if ( s.length() == 3 && s.mid(1,1) == "-" ) { | ||
60 | QString pattern = "^[" + s.lower() +"]"; | ||
61 | re.setCaseSensitive(false); | ||
62 | re.setPattern( pattern ); | ||
63 | } else { | ||
64 | QString pattern = s.lower()+"*"; | ||
65 | re.setWildcard(true); // most people understand these better. | ||
66 | re.setCaseSensitive(false); | ||
67 | re.setPattern( pattern ); | ||
68 | } | ||
69 | return re; | ||
70 | } | ||
71 | |||
56 | void KAddressBookView::readConfig( KConfig *config ) | 72 | void KAddressBookView::readConfig( KConfig *config ) |
57 | { | 73 | { |
58 | mFieldList = KABC::Field::restoreFields( config, "KABCFields" ); | 74 | mFieldList = KABC::Field::restoreFields( config, "KABCFields" ); |
59 | 75 | ||
60 | if ( mFieldList.isEmpty() ) | 76 | if ( mFieldList.isEmpty() ) |
61 | mFieldList = KABC::Field::defaultFields(); | 77 | mFieldList = KABC::Field::defaultFields(); |
62 | 78 | ||
63 | mDefaultFilterType = (DefaultFilterType)config->readNumEntry( "DefaultFilterType", 1 ); | 79 | mDefaultFilterType = (DefaultFilterType)config->readNumEntry( "DefaultFilterType", 1 ); |