-rw-r--r-- | bin/kdepim/WhatsNew.txt | 4 | ||||
-rw-r--r-- | kabc/addresseedialog.cpp | 15 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 8 |
3 files changed, 20 insertions, 7 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index c4557ef..2aac9ff 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,66 +1,70 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.1.9 ************ | ||
4 | |||
5 | KO/Pi: | ||
6 | Fixed some problems of the new search options in the search dialog. | ||
3 | 7 | ||
4 | ********** VERSION 2.1.8 ************ | 8 | ********** VERSION 2.1.8 ************ |
5 | 9 | ||
6 | KO/Pi: | 10 | KO/Pi: |
7 | Added info about the completion state of a todo in the ListView/Searchdialog. | 11 | Added info about the completion state of a todo in the ListView/Searchdialog. |
8 | If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. | 12 | If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. |
9 | Fixed some updating problems when changing the filter. | 13 | Fixed some updating problems when changing the filter. |
10 | 14 | ||
11 | KA/Pi: | 15 | KA/Pi: |
12 | In the addressee selection dialog now the formatted name is shown, if not empty. | 16 | In the addressee selection dialog now the formatted name is shown, if not empty. |
13 | Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. | 17 | Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. |
14 | Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. | 18 | Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. |
15 | 19 | ||
16 | Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. | 20 | Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. |
17 | Fixed the sorting for size in the file selector on the Z. | 21 | Fixed the sorting for size in the file selector on the Z. |
18 | 22 | ||
19 | Changed the color selection dialog on the Zaurus to a more user friendly version. | 23 | Changed the color selection dialog on the Zaurus to a more user friendly version. |
20 | 24 | ||
21 | ********** VERSION 2.1.7 ************ | 25 | ********** VERSION 2.1.7 ************ |
22 | 26 | ||
23 | KO/Pi: | 27 | KO/Pi: |
24 | Fixed several problems in the new Resource handling. | 28 | Fixed several problems in the new Resource handling. |
25 | Added more options to the search dialog. | 29 | Added more options to the search dialog. |
26 | Fixed a problem in the Month view. | 30 | Fixed a problem in the Month view. |
27 | Added more options to the dialog when setting a todo to stopped. | 31 | Added more options to the dialog when setting a todo to stopped. |
28 | 32 | ||
29 | Fixed two small problems in KO/Pi Alarm applet. | 33 | Fixed two small problems in KO/Pi Alarm applet. |
30 | 34 | ||
31 | ********** VERSION 2.1.6 ************ | 35 | ********** VERSION 2.1.6 ************ |
32 | 36 | ||
33 | This release is for testing only. | 37 | This release is for testing only. |
34 | 38 | ||
35 | KO/Pi: | 39 | KO/Pi: |
36 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. | 40 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. |
37 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. | 41 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. |
38 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. | 42 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. |
39 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. | 43 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. |
40 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. | 44 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. |
41 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. | 45 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. |
42 | 46 | ||
43 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. | 47 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. |
44 | In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. | 48 | In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. |
45 | Now on every sync the set of calendars is synced which are enabled in the resource view. | 49 | Now on every sync the set of calendars is synced which are enabled in the resource view. |
46 | 50 | ||
47 | A calendar is enabled in the resource view if the "eye" column is checked. | 51 | A calendar is enabled in the resource view if the "eye" column is checked. |
48 | You can set a calendar to be the default for new items( "+" column ). | 52 | You can set a calendar to be the default for new items( "+" column ). |
49 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. | 53 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. |
50 | To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... | 54 | To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... |
51 | 55 | ||
52 | 56 | ||
53 | ********** VERSION 2.1.5 ************ | 57 | ********** VERSION 2.1.5 ************ |
54 | 58 | ||
55 | This is the new stable version. | 59 | This is the new stable version. |
56 | Bugfix: | 60 | Bugfix: |
57 | Fixed a problem with agenda popup on the desktop in KO/Pi. | 61 | Fixed a problem with agenda popup on the desktop in KO/Pi. |
58 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. | 62 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. |
59 | Added config option to not display completed todos in agenda view. | 63 | Added config option to not display completed todos in agenda view. |
60 | Addressee view is now using the formatted name, if defined. | 64 | Addressee view is now using the formatted name, if defined. |
61 | That makes it possible to display "lastname, firstname" in that view now. | 65 | That makes it possible to display "lastname, firstname" in that view now. |
62 | To set the formatted name for all contacts, please use menu: | 66 | To set the formatted name for all contacts, please use menu: |
63 | Edit->Change->Set formatted name. | 67 | Edit->Change->Set formatted name. |
64 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. | 68 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. |
65 | 69 | ||
66 | ********** VERSION 2.1.4 ************ | 70 | ********** VERSION 2.1.4 ************ |
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp index 3e7b72c..9197850 100644 --- a/kabc/addresseedialog.cpp +++ b/kabc/addresseedialog.cpp | |||
@@ -14,157 +14,160 @@ | |||
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | #include <qpushbutton.h> | 22 | #include <qpushbutton.h> |
23 | #include <qgroupbox.h> | 23 | #include <qgroupbox.h> |
24 | #include <qapplication.h> | 24 | #include <qapplication.h> |
25 | #include <qregexp.h> | 25 | #include <qregexp.h> |
26 | #include <qvbox.h> | 26 | #include <qvbox.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | 28 | ||
29 | #include <klocale.h> | 29 | #include <klocale.h> |
30 | #include <kdebug.h> | 30 | #include <kdebug.h> |
31 | #include <kglobalsettings.h> | 31 | #include <kglobalsettings.h> |
32 | 32 | ||
33 | #include "stdaddressbook.h" | 33 | #include "stdaddressbook.h" |
34 | 34 | ||
35 | #include "addresseedialog.h" | 35 | #include "addresseedialog.h" |
36 | #include "KDGanttMinimizeSplitter.h" | 36 | #include "KDGanttMinimizeSplitter.h" |
37 | //#include "addresseedialog.moc" | 37 | //#include "addresseedialog.moc" |
38 | 38 | ||
39 | using namespace KABC; | 39 | using namespace KABC; |
40 | 40 | ||
41 | AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : | 41 | AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : |
42 | QListViewItem( parent ), | 42 | QListViewItem( parent ), |
43 | mAddressee( addressee ) | 43 | mAddressee( addressee ) |
44 | { | 44 | { |
45 | setText( Name,addressee.realName()); | 45 | setText( Name,addressee.realName()); |
46 | setText( Email, addressee.preferredEmail() ); | 46 | setText( Email, addressee.preferredEmail() ); |
47 | setText( Category, addressee.categories().join(";") ); | 47 | setText( Category, addressee.categories().join(";") ); |
48 | } | 48 | } |
49 | 49 | ||
50 | QString AddresseeItem::key( int column, bool ) const | 50 | QString AddresseeItem::key( int column, bool ) const |
51 | { | 51 | { |
52 | 52 | ||
53 | if (column == Email) { | 53 | if (column == Email) { |
54 | QString value = text(Email); | 54 | QString value = text(Email); |
55 | int val = value.findRev("@"); | 55 | int val = value.findRev("@"); |
56 | return value.mid( val) + value.left( val ); | 56 | return value.mid( val) + value.left( val ); |
57 | } | 57 | } |
58 | return text(column).lower(); | 58 | return text(column).lower(); |
59 | } | 59 | } |
60 | 60 | ||
61 | AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : | 61 | AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : |
62 | KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), | 62 | KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), |
63 | Ok|Cancel, No, parent ), mMultiple( multiple ) | 63 | Ok|Cancel, No, parent ), mMultiple( multiple ) |
64 | { | 64 | { |
65 | qDebug("NEW AddresseeDialog "); | 65 | qDebug("NEW AddresseeDialog "); |
66 | QWidget *topWidget = plainPage(); | 66 | QWidget *topWidget = plainPage(); |
67 | 67 | ||
68 | QBoxLayout *topLayout = new QHBoxLayout( topWidget ); | 68 | QBoxLayout *topLayout = new QHBoxLayout( topWidget ); |
69 | 69 | ||
70 | 70 | ||
71 | KDGanttMinimizeSplitter* mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, topWidget); | 71 | KDGanttMinimizeSplitter* mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, topWidget); |
72 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 72 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
73 | 73 | ||
74 | topLayout->addWidget(mMiniSplitter ); | 74 | topLayout->addWidget(mMiniSplitter ); |
75 | 75 | ||
76 | QWidget *listWidget = new QWidget( mMiniSplitter ); | 76 | QWidget *listWidget = new QWidget( mMiniSplitter ); |
77 | 77 | ||
78 | QBoxLayout *listLayout = new QVBoxLayout (listWidget) ; | 78 | QVBoxLayout *listLayout = new QVBoxLayout (listWidget) ; |
79 | //topLayout->addLayout( listLayout ); | 79 | //topLayout->addLayout( listLayout ); |
80 | 80 | ||
81 | mAddresseeList = new KListView( listWidget ); | 81 | mAddresseeList = new KListView( listWidget ); |
82 | mAddresseeList->addColumn( i18n("Name") ); | 82 | mAddresseeList->addColumn( i18n("Name") ); |
83 | mAddresseeList->addColumn( i18n("Email") ); | 83 | mAddresseeList->addColumn( i18n("Email") ); |
84 | mAddresseeList->addColumn( i18n("Category") ); | 84 | mAddresseeList->addColumn( i18n("Category") ); |
85 | mAddresseeList->setAllColumnsShowFocus( true ); | 85 | mAddresseeList->setAllColumnsShowFocus( true ); |
86 | mAddresseeList->setFullWidth( true ); | 86 | mAddresseeList->setFullWidth( true ); |
87 | listLayout->addWidget( mAddresseeList ); | 87 | listLayout->addWidget( mAddresseeList ); |
88 | connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), | 88 | connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), |
89 | SLOT( slotOk() ) ); | 89 | SLOT( slotOk() ) ); |
90 | 90 | ||
91 | QHBox* searchBox = new QHBox ( listWidget ); | 91 | //QHBox* searchBox = new QHBox ( listWidget ); |
92 | mAddresseeEdit = new QLineEdit( searchBox ); | 92 | mAddresseeEdit = new QLineEdit( listWidget ); |
93 | connect( mAddresseeEdit, SIGNAL( returnPressed() ), | 93 | connect( mAddresseeEdit, SIGNAL( returnPressed() ), |
94 | SLOT( loadAddressBook() ) ); | 94 | SLOT( loadAddressBook() ) ); |
95 | mAddresseeEdit->setFocus(); | 95 | mAddresseeEdit->setFocus(); |
96 | QPushButton *searchButton = new QPushButton( i18n("Search!"), searchBox ); | 96 | QPushButton *searchButton = new QPushButton( i18n("Search!"), listWidget ); |
97 | connect ( searchButton, SIGNAL( clicked() ), SLOT( loadAddressBook() ) ); | 97 | connect ( searchButton, SIGNAL( clicked() ), SLOT( loadAddressBook() ) ); |
98 | 98 | ||
99 | listLayout->addWidget( searchBox ); | 99 | QHBoxLayout *searchLayout = new QHBoxLayout (listLayout) ; |
100 | searchLayout->addWidget( mAddresseeEdit ); | ||
101 | searchLayout->addWidget( searchButton ); | ||
102 | //listLayout->addWidget( searchBox ); | ||
100 | 103 | ||
101 | if ( mMultiple ) { | 104 | if ( mMultiple ) { |
102 | //QBoxLayout *selectedLayout = new QVBoxLayout; | 105 | //QBoxLayout *selectedLayout = new QVBoxLayout; |
103 | //topLayout->addLayout( selectedLayout ); | 106 | //topLayout->addLayout( selectedLayout ); |
104 | //topLayout->setSpacing( spacingHint() ); | 107 | //topLayout->setSpacing( spacingHint() ); |
105 | 108 | ||
106 | QVBox *selectedGroup = new QVBox( mMiniSplitter ); | 109 | QVBox *selectedGroup = new QVBox( mMiniSplitter ); |
107 | new QLabel ( i18n("Selected:"), selectedGroup ); | 110 | new QLabel ( i18n("Selected:"), selectedGroup ); |
108 | //selectedLayout->addWidget( selectedGroup ); | 111 | //selectedLayout->addWidget( selectedGroup ); |
109 | 112 | ||
110 | mSelectedList = new KListView( selectedGroup ); | 113 | mSelectedList = new KListView( selectedGroup ); |
111 | mSelectedList->addColumn( i18n("Name") ); | 114 | mSelectedList->addColumn( i18n("Name") ); |
112 | mSelectedList->addColumn( i18n("Email") ); | 115 | mSelectedList->addColumn( i18n("Email") ); |
113 | mSelectedList->setAllColumnsShowFocus( true ); | 116 | mSelectedList->setAllColumnsShowFocus( true ); |
114 | mSelectedList->setFullWidth( true ); | 117 | mSelectedList->setFullWidth( true ); |
115 | //connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), | 118 | //connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), |
116 | // SLOT( removeSelected() ) ); | 119 | // SLOT( removeSelected() ) ); |
117 | connect( mSelectedList, SIGNAL( clicked( QListViewItem * ) ), | 120 | connect( mSelectedList, SIGNAL( clicked( QListViewItem * ) ), |
118 | SLOT( removeSelected() ) ); | 121 | SLOT( removeSelected() ) ); |
119 | connect( mSelectedList, SIGNAL( returnPressed( QListViewItem *) ), | 122 | connect( mSelectedList, SIGNAL( returnPressed( QListViewItem *) ), |
120 | SLOT( removeSelected() ) ); | 123 | SLOT( removeSelected() ) ); |
121 | 124 | ||
122 | #if 0 | 125 | #if 0 |
123 | QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); | 126 | QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); |
124 | connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); | 127 | connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); |
125 | 128 | ||
126 | #endif | 129 | #endif |
127 | connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), | 130 | connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), |
128 | SLOT( addSelected( QListViewItem * ) ) ); | 131 | SLOT( addSelected( QListViewItem * ) ) ); |
129 | connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), | 132 | connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), |
130 | SLOT( selectNextItem( QListViewItem * ) ) ); | 133 | SLOT( selectNextItem( QListViewItem * ) ) ); |
131 | 134 | ||
132 | } | 135 | } |
133 | 136 | ||
134 | mAddressBook = StdAddressBook::self( true ); | 137 | mAddressBook = StdAddressBook::self( true ); |
135 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), | 138 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), |
136 | SLOT( addressBookChanged() ) ); | 139 | SLOT( addressBookChanged() ) ); |
137 | #if 0 | 140 | #if 0 |
138 | connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), | 141 | connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), |
139 | SLOT( addressBookChanged() ) ); | 142 | SLOT( addressBookChanged() ) ); |
140 | #endif | 143 | #endif |
141 | loadAddressBook(); | 144 | loadAddressBook(); |
142 | QValueList<int> splitterSize; | 145 | QValueList<int> splitterSize; |
143 | splitterSize.append( ( width() / 5 ) * 3 ); | 146 | splitterSize.append( ( width() / 5 ) * 3 ); |
144 | splitterSize.append( ( width() / 5 ) *2 ); | 147 | splitterSize.append( ( width() / 5 ) *2 ); |
145 | mMiniSplitter->setSizes( splitterSize ); | 148 | mMiniSplitter->setSizes( splitterSize ); |
146 | } | 149 | } |
147 | 150 | ||
148 | AddresseeDialog::~AddresseeDialog() | 151 | AddresseeDialog::~AddresseeDialog() |
149 | { | 152 | { |
150 | qDebug("DELETE AddresseeDialog "); | 153 | qDebug("DELETE AddresseeDialog "); |
151 | } | 154 | } |
152 | 155 | ||
153 | void AddresseeDialog::loadAddressBook() | 156 | void AddresseeDialog::loadAddressBook() |
154 | { | 157 | { |
155 | mAddresseeList->clear(); | 158 | mAddresseeList->clear(); |
156 | mItemDict.clear(); | 159 | mItemDict.clear(); |
157 | if ( mAddresseeEdit->text().isEmpty() ) { | 160 | if ( mAddresseeEdit->text().isEmpty() ) { |
158 | AddressBook::Iterator it; | 161 | AddressBook::Iterator it; |
159 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 162 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
160 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 163 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
161 | continue; | 164 | continue; |
162 | new AddresseeItem( mAddresseeList, (*it) ); | 165 | new AddresseeItem( mAddresseeList, (*it) ); |
163 | } | 166 | } |
164 | return; | 167 | return; |
165 | } | 168 | } |
166 | //mAddresseeEdit->completionObject()->clear(); | 169 | //mAddresseeEdit->completionObject()->clear(); |
167 | QRegExp re; | 170 | QRegExp re; |
168 | re.setWildcard(true); // most people understand these better. | 171 | re.setWildcard(true); // most people understand these better. |
169 | re.setCaseSensitive(false); | 172 | re.setCaseSensitive(false); |
170 | re.setPattern( "*"+ mAddresseeEdit->text() + "*"); | 173 | re.setPattern( "*"+ mAddresseeEdit->text() + "*"); |
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index a8de297..0713980 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -500,89 +500,95 @@ void SearchDialog::search(const QRegExp &re) | |||
500 | } | 500 | } |
501 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { | 501 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { |
502 | QPtrList<Attendee> tmpAList = tod->attendees(); | 502 | QPtrList<Attendee> tmpAList = tod->attendees(); |
503 | Attendee *a; | 503 | Attendee *a; |
504 | for (a = tmpAList.first(); a; a = tmpAList.next()) { | 504 | for (a = tmpAList.first(); a; a = tmpAList.next()) { |
505 | if (mSearchAName->isChecked()) { | 505 | if (mSearchAName->isChecked()) { |
506 | #if QT_VERSION >= 0x030000 | 506 | #if QT_VERSION >= 0x030000 |
507 | if (re.search(a->name()) != -1) | 507 | if (re.search(a->name()) != -1) |
508 | #else | 508 | #else |
509 | if (re.match(a->name()) != -1) | 509 | if (re.match(a->name()) != -1) |
510 | #endif | 510 | #endif |
511 | { | 511 | { |
512 | if ( mSubItems->isChecked() ) | 512 | if ( mSubItems->isChecked() ) |
513 | mMatchedTodos.remove(tod); | 513 | mMatchedTodos.remove(tod); |
514 | else if (!mMatchedTodos.contains( tod )) | 514 | else if (!mMatchedTodos.contains( tod )) |
515 | mMatchedTodos.append(tod); | 515 | mMatchedTodos.append(tod); |
516 | break; | 516 | break; |
517 | } | 517 | } |
518 | } | 518 | } |
519 | if (mSearchAEmail->isChecked()) { | 519 | if (mSearchAEmail->isChecked()) { |
520 | #if QT_VERSION >= 0x030000 | 520 | #if QT_VERSION >= 0x030000 |
521 | if (re.search(a->email()) != -1) | 521 | if (re.search(a->email()) != -1) |
522 | #else | 522 | #else |
523 | if (re.match(a->email()) != -1) | 523 | if (re.match(a->email()) != -1) |
524 | #endif | 524 | #endif |
525 | { | 525 | { |
526 | if ( mSubItems->isChecked() ) | 526 | if ( mSubItems->isChecked() ) |
527 | mMatchedTodos.remove(tod); | 527 | mMatchedTodos.remove(tod); |
528 | else if (!mMatchedTodos.contains( tod )) | 528 | else if (!mMatchedTodos.contains( tod )) |
529 | mMatchedTodos.append(tod); | 529 | mMatchedTodos.append(tod); |
530 | break; | 530 | break; |
531 | } | 531 | } |
532 | } | 532 | } |
533 | } | 533 | } |
534 | } | 534 | } |
535 | } | 535 | } |
536 | } | 536 | } |
537 | 537 | ||
538 | QPtrList<Journal> journals = mCalendar->journals( ); | 538 | QPtrList<Journal> journals = mCalendar->journals( ); |
539 | if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { | 539 | if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { |
540 | if ( mRefineItems->isChecked() ) journals = mMatchedJournals ; | 540 | if ( mRefineItems->isChecked() ) journals = mMatchedJournals ; |
541 | mMatchedJournals.clear(); | 541 | mMatchedJournals.clear(); |
542 | } | 542 | } |
543 | if (mSearchJournal->isChecked() ) { | 543 | if (mSearchJournal->isChecked() ) { |
544 | Journal* journ; | 544 | Journal* journ; |
545 | 545 | ||
546 | for(journ=journals.first();journ;journ=journals.next()) { | 546 | for(journ=journals.first();journ;journ=journals.next()) { |
547 | if ( journ->dtStart().date() <= mEndDate->date() | 547 | if ( journ->dtStart().date() <= mEndDate->date() |
548 | &&journ->dtStart().date() >= mStartDate->date()) { | 548 | &&journ->dtStart().date() >= mStartDate->date()) { |
549 | #if QT_VERSION >= 0x030000 | 549 | #if QT_VERSION >= 0x030000 |
550 | if (re.search(journ->description()) != -1) | 550 | if (re.search(journ->description()) != -1) |
551 | #else | 551 | #else |
552 | if (re.match(journ->description()) != -1) | 552 | if (re.match(journ->description()) != -1) |
553 | #endif | 553 | #endif |
554 | { | 554 | { |
555 | if ( mSubItems->isChecked() ) | 555 | if ( mSubItems->isChecked() ) |
556 | mMatchedJournals.remove(journ); | 556 | mMatchedJournals.remove(journ); |
557 | else if (!mMatchedJournals.contains( journ )) | 557 | else if (!mMatchedJournals.contains( journ )) |
558 | mMatchedJournals.append(journ); | 558 | mMatchedJournals.append(journ); |
559 | continue; | 559 | continue; |
560 | } | 560 | } |
561 | } | 561 | } |
562 | } | 562 | } |
563 | } | 563 | } |
564 | 564 | if ( mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() < 1 ) { | |
565 | qDebug("count %d ", mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() ); | ||
566 | if ( mRefineItems->isChecked() ) | ||
567 | mRefineItems->setChecked( false ); | ||
568 | else if ( mSubItems->isChecked() ) | ||
569 | mSubItems->setChecked( false ); | ||
570 | } | ||
565 | } | 571 | } |
566 | 572 | ||
567 | void SearchDialog::keyPressEvent ( QKeyEvent *e) | 573 | void SearchDialog::keyPressEvent ( QKeyEvent *e) |
568 | { | 574 | { |
569 | switch ( e->key() ) { | 575 | switch ( e->key() ) { |
570 | case Qt::Key_Escape: | 576 | case Qt::Key_Escape: |
571 | close(); | 577 | close(); |
572 | break; | 578 | break; |
573 | case Qt::Key_F: | 579 | case Qt::Key_F: |
574 | if ( e->state() == Qt::ControlButton ) { | 580 | if ( e->state() == Qt::ControlButton ) { |
575 | 581 | ||
576 | } | 582 | } |
577 | break; | 583 | break; |
578 | case Qt::Key_Return: | 584 | case Qt::Key_Return: |
579 | case Qt::Key_Enter: | 585 | case Qt::Key_Enter: |
580 | doSearch(); | 586 | doSearch(); |
581 | break; | 587 | break; |
582 | 588 | ||
583 | default: | 589 | default: |
584 | e->ignore(); | 590 | e->ignore(); |
585 | } | 591 | } |
586 | } | 592 | } |
587 | 593 | ||
588 | //mMatchedJournals; | 594 | //mMatchedJournals; |