summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/koagenda.cpp1
-rw-r--r--korganizer/kotodoview.cpp3
-rw-r--r--korganizer/mainwindow.cpp8
-rw-r--r--microkde/ofileselector_p.cpp4
5 files changed, 12 insertions, 8 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 7566c6f..4b3f806 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -3936,134 +3936,132 @@ void CalendarView::exportICalendar()
3936 if (filename.right(4) != ".ics") filename += ".ics"; 3936 if (filename.right(4) != ".ics") filename += ".ics";
3937 3937
3938 FileStorage storage( mCalendar, filename, new ICalFormat() ); 3938 FileStorage storage( mCalendar, filename, new ICalFormat() );
3939 storage.save(); 3939 storage.save();
3940} 3940}
3941 3941
3942bool CalendarView::exportVCalendar( QString filename ) 3942bool CalendarView::exportVCalendar( QString filename )
3943{ 3943{
3944 if (mCalendar->journals().count() > 0) { 3944 if (mCalendar->journals().count() > 0) {
3945 int result = KMessageBox::warningContinueCancel(this, 3945 int result = KMessageBox::warningContinueCancel(this,
3946 i18n("The journal entries can not be\nexported to a vCalendar file."), 3946 i18n("The journal entries can not be\nexported to a vCalendar file."),
3947 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), 3947 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
3948 true); 3948 true);
3949 if (result != KMessageBox::Continue) return false; 3949 if (result != KMessageBox::Continue) return false;
3950 } 3950 }
3951 3951
3952 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); 3952 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this);
3953 3953
3954 // Force correct extension 3954 // Force correct extension
3955 if (filename.right(4) != ".vcs") filename += ".vcs"; 3955 if (filename.right(4) != ".vcs") filename += ".vcs";
3956 3956
3957 FileStorage storage( mCalendar, filename, new VCalFormat ); 3957 FileStorage storage( mCalendar, filename, new VCalFormat );
3958 return storage.save(); 3958 return storage.save();
3959 3959
3960} 3960}
3961 3961
3962void CalendarView::eventUpdated(Incidence *) 3962void CalendarView::eventUpdated(Incidence *)
3963{ 3963{
3964 setModified(); 3964 setModified();
3965 // Don't call updateView here. The code, which has caused the update of the 3965 // Don't call updateView here. The code, which has caused the update of the
3966 // event is responsible for updating the view. 3966 // event is responsible for updating the view.
3967 // updateView(); 3967 // updateView();
3968} 3968}
3969 3969
3970void CalendarView::adaptNavigationUnits() 3970void CalendarView::adaptNavigationUnits()
3971{ 3971{
3972 if (mViewManager->currentView()->isEventView()) { 3972 if (mViewManager->currentView()->isEventView()) {
3973 int days = mViewManager->currentView()->currentDateCount(); 3973 int days = mViewManager->currentView()->currentDateCount();
3974 if (days == 1) { 3974 if (days == 1) {
3975 emit changeNavStringPrev(i18n("&Previous Day")); 3975 emit changeNavStringPrev(i18n("&Previous Day"));
3976 emit changeNavStringNext(i18n("&Next Day")); 3976 emit changeNavStringNext(i18n("&Next Day"));
3977 } else { 3977 } else {
3978 emit changeNavStringPrev(i18n("&Previous Week")); 3978 emit changeNavStringPrev(i18n("&Previous Week"));
3979 emit changeNavStringNext(i18n("&Next Week")); 3979 emit changeNavStringNext(i18n("&Next Week"));
3980 } 3980 }
3981 } 3981 }
3982} 3982}
3983 3983
3984void CalendarView::processMainViewSelection( Incidence *incidence ) 3984void CalendarView::processMainViewSelection( Incidence *incidence )
3985{ 3985{
3986 if ( incidence ) mTodoList->clearSelection(); 3986 if ( incidence ) mTodoList->clearSelection();
3987 processIncidenceSelection( incidence ); 3987 processIncidenceSelection( incidence );
3988} 3988}
3989 3989
3990void CalendarView::processTodoListSelection( Incidence *incidence ) 3990void CalendarView::processTodoListSelection( Incidence *incidence )
3991{ 3991{
3992 if ( incidence && mViewManager->currentView() ) { 3992 if ( incidence && mViewManager->currentView() ) {
3993 mViewManager->currentView()->clearSelection(); 3993 mViewManager->currentView()->clearSelection();
3994 } 3994 }
3995 processIncidenceSelection( incidence ); 3995 processIncidenceSelection( incidence );
3996} 3996}
3997 3997
3998void CalendarView::processIncidenceSelection( Incidence *incidence ) 3998void CalendarView::processIncidenceSelection( Incidence *incidence )
3999{ 3999{
4000 emit incidenceSelected( incidence );
4000 if ( incidence == mSelectedIncidence ) return; 4001 if ( incidence == mSelectedIncidence ) return;
4001
4002 mSelectedIncidence = incidence; 4002 mSelectedIncidence = incidence;
4003 4003
4004 emit incidenceSelected( mSelectedIncidence );
4005
4006 if ( incidence && incidence->typeID() == eventID ) { 4004 if ( incidence && incidence->typeID() == eventID ) {
4007 Event *event = static_cast<Event *>( incidence ); 4005 Event *event = static_cast<Event *>( incidence );
4008 if ( event->organizer() == KOPrefs::instance()->email() ) { 4006 if ( event->organizer() == KOPrefs::instance()->email() ) {
4009 emit organizerEventsSelected( true ); 4007 emit organizerEventsSelected( true );
4010 } else { 4008 } else {
4011 emit organizerEventsSelected(false); 4009 emit organizerEventsSelected(false);
4012 } 4010 }
4013 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 4011 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
4014 KOPrefs::instance()->email() ) ) { 4012 KOPrefs::instance()->email() ) ) {
4015 emit groupEventsSelected( true ); 4013 emit groupEventsSelected( true );
4016 } else { 4014 } else {
4017 emit groupEventsSelected(false); 4015 emit groupEventsSelected(false);
4018 } 4016 }
4019 return; 4017 return;
4020 } else { 4018 } else {
4021 if ( incidence && incidence->typeID() == todoID ) { 4019 if ( incidence && incidence->typeID() == todoID ) {
4022 emit todoSelected( true ); 4020 emit todoSelected( true );
4023 Todo *event = static_cast<Todo *>( incidence ); 4021 Todo *event = static_cast<Todo *>( incidence );
4024 if ( event->organizer() == KOPrefs::instance()->email() ) { 4022 if ( event->organizer() == KOPrefs::instance()->email() ) {
4025 emit organizerEventsSelected( true ); 4023 emit organizerEventsSelected( true );
4026 } else { 4024 } else {
4027 emit organizerEventsSelected(false); 4025 emit organizerEventsSelected(false);
4028 } 4026 }
4029 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 4027 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
4030 KOPrefs::instance()->email() ) ) { 4028 KOPrefs::instance()->email() ) ) {
4031 emit groupEventsSelected( true ); 4029 emit groupEventsSelected( true );
4032 } else { 4030 } else {
4033 emit groupEventsSelected(false); 4031 emit groupEventsSelected(false);
4034 } 4032 }
4035 return; 4033 return;
4036 } else { 4034 } else {
4037 emit todoSelected( false ); 4035 emit todoSelected( false );
4038 emit organizerEventsSelected(false); 4036 emit organizerEventsSelected(false);
4039 emit groupEventsSelected(false); 4037 emit groupEventsSelected(false);
4040 } 4038 }
4041 return; 4039 return;
4042 } 4040 }
4043 4041
4044 /* if ( incidence && incidence->typeID() == todoID ) { 4042 /* if ( incidence && incidence->typeID() == todoID ) {
4045 emit todoSelected( true ); 4043 emit todoSelected( true );
4046 } else { 4044 } else {
4047 emit todoSelected( false ); 4045 emit todoSelected( false );
4048 }*/ 4046 }*/
4049} 4047}
4050 4048
4051 4049
4052void CalendarView::checkClipboard() 4050void CalendarView::checkClipboard()
4053{ 4051{
4054#ifndef KORG_NODND 4052#ifndef KORG_NODND
4055 if (ICalDrag::canDecode(QApplication::clipboard()->data())) { 4053 if (ICalDrag::canDecode(QApplication::clipboard()->data())) {
4056 emit pasteEnabled(true); 4054 emit pasteEnabled(true);
4057 } else { 4055 } else {
4058 emit pasteEnabled(false); 4056 emit pasteEnabled(false);
4059 } 4057 }
4060#endif 4058#endif
4061} 4059}
4062 4060
4063void CalendarView::showDates(const DateList &selectedDates) 4061void CalendarView::showDates(const DateList &selectedDates)
4064{ 4062{
4065 // kdDebug() << "CalendarView::selectDates()" << endl; 4063 // kdDebug() << "CalendarView::selectDates()" << endl;
4066 4064
4067 4065
4068 if ( !mBlockShowDates ) { 4066 if ( !mBlockShowDates ) {
4069 if ( mViewManager->currentView() ) { 4067 if ( mViewManager->currentView() ) {
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 92c1cd6..acdf5a0 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -93,129 +93,128 @@ int MarcusBains::todayColumn()
93 QDate currentDate = QDate::currentDate(); 93 QDate currentDate = QDate::currentDate();
94 94
95 DateList dateList = agenda->dateList(); 95 DateList dateList = agenda->dateList();
96 DateList::ConstIterator it; 96 DateList::ConstIterator it;
97 int col = 0; 97 int col = 0;
98 for(it = dateList.begin(); it != dateList.end(); ++it) { 98 for(it = dateList.begin(); it != dateList.end(); ++it) {
99 if((*it) == currentDate) 99 if((*it) == currentDate)
100 return KOGlobals::self()->reverseLayout() ? 100 return KOGlobals::self()->reverseLayout() ?
101 agenda->columns() - 1 - col : col; 101 agenda->columns() - 1 - col : col;
102 ++col; 102 ++col;
103 } 103 }
104 104
105 return -1; 105 return -1;
106} 106}
107void MarcusBains::updateLoc() 107void MarcusBains::updateLoc()
108{ 108{
109 updateLocation(); 109 updateLocation();
110} 110}
111void MarcusBains::updateLocation(bool recalculate) 111void MarcusBains::updateLocation(bool recalculate)
112{ 112{
113 113
114 QTime tim = QTime::currentTime(); 114 QTime tim = QTime::currentTime();
115 //qDebug(" MarcusBains::updateLocation %s ", tim.toString().latin1()); 115 //qDebug(" MarcusBains::updateLocation %s ", tim.toString().latin1());
116 if((tim.hour() == 0) && (oldTime.hour()==23)) 116 if((tim.hour() == 0) && (oldTime.hour()==23))
117 recalculate = true; 117 recalculate = true;
118 118
119 int mins = tim.hour()*60 + tim.minute(); 119 int mins = tim.hour()*60 + tim.minute();
120 int minutesPerCell = 24 * 60 / agenda->rows(); 120 int minutesPerCell = 24 * 60 / agenda->rows();
121 int y = mins*agenda->gridSpacingY()/minutesPerCell; 121 int y = mins*agenda->gridSpacingY()/minutesPerCell;
122 int today = recalculate ? todayColumn() : oldToday; 122 int today = recalculate ? todayColumn() : oldToday;
123 int x = agenda->gridSpacingX()*today; 123 int x = agenda->gridSpacingX()*today;
124 bool disabled = !(KOPrefs::instance()->mMarcusBainsEnabled); 124 bool disabled = !(KOPrefs::instance()->mMarcusBainsEnabled);
125 125
126 oldTime = tim; 126 oldTime = tim;
127 oldToday = today; 127 oldToday = today;
128 128
129 if(disabled || (today<0)) { 129 if(disabled || (today<0)) {
130 hide(); mTimeBox->hide(); 130 hide(); mTimeBox->hide();
131 return; 131 return;
132 } else { 132 } else {
133 show(); mTimeBox->show(); 133 show(); mTimeBox->show();
134 } 134 }
135 135
136 if(recalculate) 136 if(recalculate)
137 setFixedSize(agenda->gridSpacingX(),1); 137 setFixedSize(agenda->gridSpacingX(),1);
138 agenda->moveChild(this, x, y); 138 agenda->moveChild(this, x, y);
139 raise(); 139 raise();
140 140
141 if(recalculate) 141 if(recalculate)
142 //mTimeBox->setFont(QFont("helvetica",10)); 142 //mTimeBox->setFont(QFont("helvetica",10));
143 mTimeBox->setFont(KOPrefs::instance()->mMarcusBainsFont); 143 mTimeBox->setFont(KOPrefs::instance()->mMarcusBainsFont);
144 144
145 mTimeBox->setText(KGlobal::locale()->formatTime(tim, KOPrefs::instance()->mMarcusBainsShowSeconds)); 145 mTimeBox->setText(KGlobal::locale()->formatTime(tim, KOPrefs::instance()->mMarcusBainsShowSeconds));
146 mTimeBox->adjustSize(); 146 mTimeBox->adjustSize();
147 // the -2 below is there because there is a bug in this program 147 // the -2 below is there because there is a bug in this program
148 // somewhere, where the last column of this widget is a few pixels 148 // somewhere, where the last column of this widget is a few pixels
149 // narrower than the other columns. 149 // narrower than the other columns.
150 int offs = (today==agenda->columns()-1) ? -4 : 0; 150 int offs = (today==agenda->columns()-1) ? -4 : 0;
151 agenda->moveChild(mTimeBox, 151 agenda->moveChild(mTimeBox,
152 x+agenda->gridSpacingX()-mTimeBox->width()+offs-1, 152 x+agenda->gridSpacingX()-mTimeBox->width()+offs-1,
153 y-mTimeBox->height()); 153 y-mTimeBox->height());
154 mTimeBox->raise(); 154 mTimeBox->raise();
155 //mTimeBox->setAutoMask(true); 155 //mTimeBox->setAutoMask(true);
156 int secs = QTime::currentTime().second(); 156 int secs = QTime::currentTime().second();
157 qDebug("second %d ", secs );
158 minutes->start( (60 - secs +1)*1000 ,true); 157 minutes->start( (60 - secs +1)*1000 ,true);
159} 158}
160 159
161 160
162//////////////////////////////////////////////////////////////////////////// 161////////////////////////////////////////////////////////////////////////////
163 162
164 163
165/* 164/*
166 Create an agenda widget with rows rows and columns columns. 165 Create an agenda widget with rows rows and columns columns.
167*/ 166*/
168KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, 167KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
169 const char *name,WFlags f) : 168 const char *name,WFlags f) :
170 QScrollView(parent,name,f) 169 QScrollView(parent,name,f)
171{ 170{
172 171
173 mAllAgendaPopup = 0; 172 mAllAgendaPopup = 0;
174 mColumns = columns; 173 mColumns = columns;
175 mRows = rows; 174 mRows = rows;
176 mGridSpacingY = rowSize; 175 mGridSpacingY = rowSize;
177 mAllDayMode = false; 176 mAllDayMode = false;
178#ifndef DESKTOP_VERSION 177#ifndef DESKTOP_VERSION
179 //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 178 //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
180#endif 179#endif
181 mHolidayMask = 0; 180 mHolidayMask = 0;
182 init(); 181 init();
183 connect ( this, SIGNAL (contentsMoving ( int , int ) ), this, SLOT ( slotContentMove(int,int)) ); 182 connect ( this, SIGNAL (contentsMoving ( int , int ) ), this, SLOT ( slotContentMove(int,int)) );
184} 183}
185 184
186/* 185/*
187 Create an agenda widget with columns columns and one row. This is used for 186 Create an agenda widget with columns columns and one row. This is used for
188 all-day events. 187 all-day events.
189*/ 188*/
190KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : 189KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) :
191 QScrollView(parent,name,f) 190 QScrollView(parent,name,f)
192{ 191{
193 mAllAgendaPopup = 0; 192 mAllAgendaPopup = 0;
194 blockResize = false; 193 blockResize = false;
195 mColumns = columns; 194 mColumns = columns;
196 mRows = 1; 195 mRows = 1;
197 //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize); 196 //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize);
198 mGridSpacingY = KOPrefs::instance()->mAllDaySize; 197 mGridSpacingY = KOPrefs::instance()->mAllDaySize;
199 mAllDayMode = true; 198 mAllDayMode = true;
200#ifndef DESKTOP_VERSION 199#ifndef DESKTOP_VERSION
201 //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 200 //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
202#endif 201#endif
203 mHolidayMask = 0; 202 mHolidayMask = 0;
204 init(); 203 init();
205} 204}
206 205
207 206
208KOAgenda::~KOAgenda() 207KOAgenda::~KOAgenda()
209{ 208{
210 if(mMarcusBains) delete mMarcusBains; 209 if(mMarcusBains) delete mMarcusBains;
211 210
212} 211}
213 212
214Incidence *KOAgenda::selectedIncidence() const 213Incidence *KOAgenda::selectedIncidence() const
215{ 214{
216 return (mSelectedItem ? mSelectedItem->incidence() : 0); 215 return (mSelectedItem ? mSelectedItem->incidence() : 0);
217} 216}
218 217
219 218
220QDate KOAgenda::selectedIncidenceDate() const 219QDate KOAgenda::selectedIncidenceDate() const
221{ 220{
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 86e1bd9..a87e6fc 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -1093,152 +1093,155 @@ void KOTodoView::unparentTodo()
1093 } 1093 }
1094} 1094}
1095 1095
1096void KOTodoView::reparentTodo() 1096void KOTodoView::reparentTodo()
1097{ 1097{
1098 if (mActiveItem) { 1098 if (mActiveItem) {
1099 topLevelWidget()->setCaption(i18n("Click on new parent item")); 1099 topLevelWidget()->setCaption(i18n("Click on new parent item"));
1100 pendingSubtodo = mActiveItem; 1100 pendingSubtodo = mActiveItem;
1101 } 1101 }
1102} 1102}
1103void KOTodoView::editTodo() 1103void KOTodoView::editTodo()
1104{ 1104{
1105 if (mActiveItem) { 1105 if (mActiveItem) {
1106 emit editTodoSignal(mActiveItem->todo()); 1106 emit editTodoSignal(mActiveItem->todo());
1107 } 1107 }
1108} 1108}
1109void KOTodoView::cloneTodo() 1109void KOTodoView::cloneTodo()
1110{ 1110{
1111 if (mActiveItem) { 1111 if (mActiveItem) {
1112 emit cloneTodoSignal((Incidence*)mActiveItem->todo()); 1112 emit cloneTodoSignal((Incidence*)mActiveItem->todo());
1113 } 1113 }
1114} 1114}
1115void KOTodoView::cancelTodo() 1115void KOTodoView::cancelTodo()
1116{ 1116{
1117 if (mActiveItem) { 1117 if (mActiveItem) {
1118 emit cancelTodoSignal((Incidence*)mActiveItem->todo()); 1118 emit cancelTodoSignal((Incidence*)mActiveItem->todo());
1119 } 1119 }
1120} 1120}
1121void KOTodoView::moveTodo() 1121void KOTodoView::moveTodo()
1122{ 1122{
1123 if (mActiveItem) { 1123 if (mActiveItem) {
1124 emit moveTodoSignal((Incidence*)mActiveItem->todo()); 1124 emit moveTodoSignal((Incidence*)mActiveItem->todo());
1125 } 1125 }
1126} 1126}
1127void KOTodoView::beamTodo() 1127void KOTodoView::beamTodo()
1128{ 1128{
1129 if (mActiveItem) { 1129 if (mActiveItem) {
1130 emit beamTodoSignal((Incidence*)mActiveItem->todo()); 1130 emit beamTodoSignal((Incidence*)mActiveItem->todo());
1131 } 1131 }
1132} 1132}
1133 1133
1134 1134
1135void KOTodoView::showTodo() 1135void KOTodoView::showTodo()
1136{ 1136{
1137 if (mActiveItem) { 1137 if (mActiveItem) {
1138 emit showTodoSignal(mActiveItem->todo()); 1138 emit showTodoSignal(mActiveItem->todo());
1139 } 1139 }
1140} 1140}
1141 1141
1142void KOTodoView::deleteTodo() 1142void KOTodoView::deleteTodo()
1143{ 1143{
1144 if (mActiveItem) { 1144 if (mActiveItem) {
1145 emit deleteTodoSignal(mActiveItem->todo()); 1145 emit deleteTodoSignal(mActiveItem->todo());
1146 } 1146 }
1147} 1147}
1148 1148
1149void KOTodoView::setNewPriority(int index) 1149void KOTodoView::setNewPriority(int index)
1150{ 1150{
1151 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1151 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1152 mActiveItem->todo()->setPriority(mPriority[index]); 1152 mActiveItem->todo()->setPriority(mPriority[index]);
1153 mActiveItem->construct(); 1153 mActiveItem->construct();
1154 todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); 1154 todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED);
1155 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1155 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1156 } 1156 }
1157 processSelectionChange();
1157} 1158}
1158 1159
1159void KOTodoView::setNewPercentage(int index) 1160void KOTodoView::setNewPercentage(int index)
1160{ 1161{
1161 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1162 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1162 1163
1163 if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { 1164 if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) {
1164 mActiveItem->setOn( true ); 1165 mActiveItem->setOn( true );
1166 processSelectionChange();
1165 return; 1167 return;
1166 } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { 1168 } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) {
1167 KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); 1169 KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent()));
1168 if ( par && par->isOn() ) 1170 if ( par && par->isOn() )
1169 par->setOn( false ); 1171 par->setOn( false );
1170 } 1172 }
1171 if (mPercentage[index] == 100) { 1173 if (mPercentage[index] == 100) {
1172 mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); 1174 mActiveItem->todo()->setCompleted(QDateTime::currentDateTime());
1173 } else { 1175 } else {
1174 mActiveItem->todo()->setCompleted(false); 1176 mActiveItem->todo()->setCompleted(false);
1175 } 1177 }
1176 mActiveItem->todo()->setPercentComplete(mPercentage[index]); 1178 mActiveItem->todo()->setPercentComplete(mPercentage[index]);
1177 mActiveItem->construct(); 1179 mActiveItem->construct();
1178 todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); 1180 todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED);
1179 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1181 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1180 } 1182 }
1183 processSelectionChange();
1181} 1184}
1182 1185
1183void KOTodoView::fillCategories () 1186void KOTodoView::fillCategories ()
1184{ 1187{
1185 mCategoryPopupMenu->clear(); 1188 mCategoryPopupMenu->clear();
1186 if ( ! mActiveItem ) return; 1189 if ( ! mActiveItem ) return;
1187 QStringList checkedCategories = mActiveItem->todo()->categories (); 1190 QStringList checkedCategories = mActiveItem->todo()->categories ();
1188 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); 1191 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
1189 it != KOPrefs::instance()->mCustomCategories.end (); 1192 it != KOPrefs::instance()->mCustomCategories.end ();
1190 ++it) { 1193 ++it) {
1191 int index = mCategoryPopupMenu->insertItem (*it); 1194 int index = mCategoryPopupMenu->insertItem (*it);
1192 mCategory[index] = *it; 1195 mCategory[index] = *it;
1193 if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true); 1196 if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true);
1194 } 1197 }
1195} 1198}
1196void KOTodoView::fillCal () 1199void KOTodoView::fillCal ()
1197{ 1200{
1198 mCalPopupMenu->clear(); 1201 mCalPopupMenu->clear();
1199 if (!mActiveItem) return; 1202 if (!mActiveItem) return;
1200 bool readO = mActiveItem->todo()->isReadOnly(); 1203 bool readO = mActiveItem->todo()->isReadOnly();
1201 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 1204 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
1202 while ( kkf ) { 1205 while ( kkf ) {
1203 int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber); 1206 int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber);
1204 if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO ) 1207 if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO )
1205 mCalPopupMenu->setItemEnabled( index, false ); 1208 mCalPopupMenu->setItemEnabled( index, false );
1206 mCalPopupMenu->setItemChecked (index, kkf->mCalNumber == mActiveItem->todo()->calID()); 1209 mCalPopupMenu->setItemChecked (index, kkf->mCalNumber == mActiveItem->todo()->calID());
1207 kkf = KOPrefs::instance()->mCalendars.next(); 1210 kkf = KOPrefs::instance()->mCalendars.next();
1208 } 1211 }
1209} 1212}
1210void KOTodoView::changedCal (int index ) 1213void KOTodoView::changedCal (int index )
1211{ 1214{
1212 if (!mActiveItem) return; 1215 if (!mActiveItem) return;
1213 mActiveItem->todo()->setCalID( index ); 1216 mActiveItem->todo()->setCalID( index );
1214 mActiveItem->construct(); 1217 mActiveItem->construct();
1215} 1218}
1216void KOTodoView::changedCategories(int index) 1219void KOTodoView::changedCategories(int index)
1217{ 1220{
1218 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1221 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1219 QStringList categories = mActiveItem->todo()->categories (); 1222 QStringList categories = mActiveItem->todo()->categories ();
1220 QString colcat = categories.first(); 1223 QString colcat = categories.first();
1221 if (categories.find (mCategory[index]) != categories.end ()) 1224 if (categories.find (mCategory[index]) != categories.end ())
1222 categories.remove (mCategory[index]); 1225 categories.remove (mCategory[index]);
1223 else 1226 else
1224 categories.insert (categories.end(), mCategory[index]); 1227 categories.insert (categories.end(), mCategory[index]);
1225 categories.sort (); 1228 categories.sort ();
1226 if ( !colcat.isEmpty() ) { 1229 if ( !colcat.isEmpty() ) {
1227 if ( categories.find ( colcat ) != categories.end () ) { 1230 if ( categories.find ( colcat ) != categories.end () ) {
1228 categories.remove( colcat ); 1231 categories.remove( colcat );
1229 categories.prepend( colcat ); 1232 categories.prepend( colcat );
1230 } 1233 }
1231 } 1234 }
1232 mActiveItem->todo()->setCategories (categories); 1235 mActiveItem->todo()->setCategories (categories);
1233 mActiveItem->construct(); 1236 mActiveItem->construct();
1234 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1237 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1235 todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); 1238 todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED);
1236 } 1239 }
1237} 1240}
1238void KOTodoView::itemDoubleClicked(QListViewItem *item) 1241void KOTodoView::itemDoubleClicked(QListViewItem *item)
1239{ 1242{
1240 if ( pendingSubtodo != 0 ) { 1243 if ( pendingSubtodo != 0 ) {
1241 topLevelWidget()->setCaption(i18n("Reparenting aborted!")); 1244 topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
1242 } 1245 }
1243 pendingSubtodo = 0; 1246 pendingSubtodo = 0;
1244 //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); 1247 //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() );
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 88dbd4f..cbf6096 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1621,130 +1621,134 @@ QString MainWindow::defaultFileName()
1621{ 1621{
1622 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1622 return locateLocal( "data", "korganizer/mycalendar.ics" );
1623} 1623}
1624QString MainWindow::syncFileName() 1624QString MainWindow::syncFileName()
1625{ 1625{
1626#ifdef DESKTOP_VERSION 1626#ifdef DESKTOP_VERSION
1627 return locateLocal( "tmp", "synccalendar.ics" ); 1627 return locateLocal( "tmp", "synccalendar.ics" );
1628#else 1628#else
1629 return QString( "/tmp/synccalendar.ics" ); 1629 return QString( "/tmp/synccalendar.ics" );
1630#endif 1630#endif
1631} 1631}
1632#include "koglobals.h" 1632#include "koglobals.h"
1633#include <kcalendarsystem.h> 1633#include <kcalendarsystem.h>
1634void MainWindow::updateWeek(QDate seda) 1634void MainWindow::updateWeek(QDate seda)
1635{ 1635{
1636 int weekNum = KGlobal::locale()->weekNum ( seda ); 1636 int weekNum = KGlobal::locale()->weekNum ( seda );
1637 mWeekPixmap.fill( mWeekBgColor ); 1637 mWeekPixmap.fill( mWeekBgColor );
1638 QPainter p ( &mWeekPixmap ); 1638 QPainter p ( &mWeekPixmap );
1639 p.setFont( mWeekFont ); 1639 p.setFont( mWeekFont );
1640 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1640 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1641 p.end(); 1641 p.end();
1642 QIconSet icon3 ( mWeekPixmap ); 1642 QIconSet icon3 ( mWeekPixmap );
1643 mWeekAction->setIconSet ( icon3 ); 1643 mWeekAction->setIconSet ( icon3 );
1644 1644
1645} 1645}
1646void MainWindow::updateWeekNum(const DateList &selectedDates) 1646void MainWindow::updateWeekNum(const DateList &selectedDates)
1647{ 1647{
1648 updateWeek( selectedDates.first() ); 1648 updateWeek( selectedDates.first() );
1649} 1649}
1650void MainWindow::processIncidenceSelection( Incidence *incidence ) 1650void MainWindow::processIncidenceSelection( Incidence *incidence )
1651{ 1651{
1652 if ( !incidence ) { 1652 if ( !incidence ) {
1653 mShowAction->setMenuText( i18n("Show") ); 1653 mShowAction->setMenuText( i18n("Show") );
1654 enableIncidenceActions( false ); 1654 enableIncidenceActions( false );
1655 mNewSubTodoAction->setEnabled( false ); 1655 mNewSubTodoAction->setEnabled( false );
1656 setCaptionToDates(); 1656 setCaptionToDates();
1657 return; 1657 return;
1658 } 1658 }
1659 QString startString = ""; 1659 QString startString = "";
1660 if ( incidence->typeID() != todoID ) { 1660 if ( incidence->typeID() != todoID ) {
1661 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1661 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1662 if ( incidence->doesFloat() ) { 1662 if ( incidence->doesFloat() ) {
1663 startString += ": "+incidence->dtStartDateStr( true ); 1663 startString += ": "+incidence->dtStartDateStr( true );
1664 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1664 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1665 } else { 1665 } else {
1666 startString = ": "+incidence->dtStartStr(true); 1666 startString = ": "+incidence->dtStartStr(true);
1667 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1667 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1668 } 1668 }
1669 } else { 1669 } else {
1670 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1670 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1671 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1671 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1672 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1672 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1673 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1673 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1674 bool ok; 1674 bool ok;
1675 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1675 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1676 if ( ok ) { 1676 if ( ok ) {
1677 int years = noc.date().year() - incidence->dtStart().date().year(); 1677 int years = noc.date().year() - incidence->dtStart().date().year();
1678 startString += i18n(" (%1 y.)"). arg( years ); 1678 startString += i18n(" (%1 y.)"). arg( years );
1679 } 1679 }
1680 } 1680 }
1681 else 1681 else
1682 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1682 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1683 } 1683 }
1684 } 1684 }
1685 else 1685 else {
1686 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1686 if ( (( KCal::Todo*)incidence)->percentComplete() == 100 )
1687 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) );
1688 else
1689 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1690 }
1687 if ( !incidence->location().isEmpty() ) 1691 if ( !incidence->location().isEmpty() )
1688 startString += " (" +incidence->location()+")"; 1692 startString += " (" +incidence->location()+")";
1689 setCaption( incidence->summary()+startString); 1693 setCaption( incidence->summary()+startString);
1690 enableIncidenceActions( true ); 1694 enableIncidenceActions( true );
1691 if ( incidence->typeID() == eventID ) { 1695 if ( incidence->typeID() == eventID ) {
1692 mShowAction->setMenuText( i18n("Show Event") ); 1696 mShowAction->setMenuText( i18n("Show Event") );
1693 mNewSubTodoAction->setEnabled( false ); 1697 mNewSubTodoAction->setEnabled( false );
1694 } else if ( incidence->typeID() == todoID ) { 1698 } else if ( incidence->typeID() == todoID ) {
1695 mShowAction->setMenuText( i18n("Show Todo") ); 1699 mShowAction->setMenuText( i18n("Show Todo") );
1696 mNewSubTodoAction->setEnabled( true ); 1700 mNewSubTodoAction->setEnabled( true );
1697 } else { 1701 } else {
1698 mShowAction->setMenuText( i18n("Show") ); 1702 mShowAction->setMenuText( i18n("Show") );
1699 mNewSubTodoAction->setEnabled( false ); 1703 mNewSubTodoAction->setEnabled( false );
1700 } 1704 }
1701} 1705}
1702 1706
1703void MainWindow::enableIncidenceActions( bool enabled ) 1707void MainWindow::enableIncidenceActions( bool enabled )
1704{ 1708{
1705 mShowAction->setEnabled( enabled ); 1709 mShowAction->setEnabled( enabled );
1706 mEditAction->setEnabled( enabled ); 1710 mEditAction->setEnabled( enabled );
1707 mDeleteAction->setEnabled( enabled ); 1711 mDeleteAction->setEnabled( enabled );
1708 1712
1709 mCloneAction->setEnabled( enabled ); 1713 mCloneAction->setEnabled( enabled );
1710 mMoveAction->setEnabled( enabled ); 1714 mMoveAction->setEnabled( enabled );
1711#ifndef DESKTOP_VERSION 1715#ifndef DESKTOP_VERSION
1712 mBeamAction->setEnabled( enabled ); 1716 mBeamAction->setEnabled( enabled );
1713#endif 1717#endif
1714 mCancelAction->setEnabled( enabled ); 1718 mCancelAction->setEnabled( enabled );
1715} 1719}
1716 1720
1717void MainWindow::importOL() 1721void MainWindow::importOL()
1718{ 1722{
1719#ifdef _OL_IMPORT_ 1723#ifdef _OL_IMPORT_
1720 mView->clearAllViews(); 1724 mView->clearAllViews();
1721 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1725 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1722 id->exec(); 1726 id->exec();
1723 delete id; 1727 delete id;
1724 mView->calendar()->checkAlarmForIncidence( 0, true ); 1728 mView->calendar()->checkAlarmForIncidence( 0, true );
1725 mView->updateView(); 1729 mView->updateView();
1726#endif 1730#endif
1727} 1731}
1728void MainWindow::importBday() 1732void MainWindow::importBday()
1729{ 1733{
1730 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), 1734 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"),
1731 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1735 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1732 i18n("Import!"), i18n("Cancel"), 0, 1736 i18n("Import!"), i18n("Cancel"), 0,
1733 0, 1 ); 1737 0, 1 );
1734 if ( result == 0 ) { 1738 if ( result == 0 ) {
1735 mView->importBday(); 1739 mView->importBday();
1736 1740
1737 } 1741 }
1738 1742
1739 1743
1740} 1744}
1741void MainWindow::importQtopia() 1745void MainWindow::importQtopia()
1742{ 1746{
1743 //#ifndef DESKTOP_VERSION 1747 //#ifndef DESKTOP_VERSION
1744 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); 1748 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing");
1745#ifdef DESKTOP_VERSION 1749#ifdef DESKTOP_VERSION
1746 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); 1750 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml");
1747#endif 1751#endif
1748 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, 1752 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
1749 i18n("Import!"), i18n("Cancel"), 0, 1753 i18n("Import!"), i18n("Cancel"), 0,
1750 0, 1 ); 1754 0, 1 );
diff --git a/microkde/ofileselector_p.cpp b/microkde/ofileselector_p.cpp
index 488dee2..f4f112e 100644
--- a/microkde/ofileselector_p.cpp
+++ b/microkde/ofileselector_p.cpp
@@ -303,133 +303,133 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st
303 303
304 lay->addWidget( m_view, 1000 ); 304 lay->addWidget( m_view, 1000 );
305 connectSlots(); 305 connectSlots();
306} 306}
307OFileViewFileListView::~OFileViewFileListView() { 307OFileViewFileListView::~OFileViewFileListView() {
308} 308}
309void OFileViewFileListView::slotNew() { 309void OFileViewFileListView::slotNew() {
310 DocLnk lnk; 310 DocLnk lnk;
311 emit selector()->newSelected( lnk ); 311 emit selector()->newSelected( lnk );
312} 312}
313OFileSelectorItem* OFileViewFileListView::currentItem()const{ 313OFileSelectorItem* OFileViewFileListView::currentItem()const{
314 QListViewItem* item = m_view->currentItem(); 314 QListViewItem* item = m_view->currentItem();
315 if (!item ) 315 if (!item )
316 return 0l; 316 return 0l;
317 317
318 return static_cast<OFileSelectorItem*>(item); 318 return static_cast<OFileSelectorItem*>(item);
319} 319}
320void OFileViewFileListView::reread( bool all ) { 320void OFileViewFileListView::reread( bool all ) {
321 m_view->clear(); 321 m_view->clear();
322 322
323 if (selector()->showClose() ) 323 if (selector()->showClose() )
324 m_btnClose->show(); 324 m_btnClose->show();
325 else 325 else
326 m_btnClose->hide(); 326 m_btnClose->hide();
327 327
328 if (selector()->showNew() ) 328 if (selector()->showNew() )
329 m_btnNew->show(); 329 m_btnNew->show();
330 else 330 else
331 m_btnNew->hide(); 331 m_btnNew->hide();
332 332
333 m_mimes = selector()->currentMimeType(); 333 m_mimes = selector()->currentMimeType();
334 m_all = all; 334 m_all = all;
335 335
336 QDir dir( m_currentDir ); 336 QDir dir( m_currentDir );
337 if (!dir.exists() ) 337 if (!dir.exists() )
338 return; 338 return;
339 topLevelWidget()->setCaption( dir.path() ); 339 topLevelWidget()->setCaption( dir.path() );
340 dir.setSorting( QDir::Name | QDir::DirsFirst | QDir::Reversed ); 340 dir.setSorting( QDir::Name | QDir::DirsFirst | QDir::Reversed );
341 int filter; 341 int filter;
342 if (m_all ) 342 if (m_all )
343 filter = QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All; 343 filter = QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All;
344 else 344 else
345 filter = QDir::Files | QDir::Dirs | QDir::All; 345 filter = QDir::Files | QDir::Dirs | QDir::All;
346 dir.setFilter( filter ); 346 dir.setFilter( filter );
347 347
348 // now go through all files 348 // now go through all files
349 const QFileInfoList *list = dir.entryInfoList(); 349 const QFileInfoList *list = dir.entryInfoList();
350 if (!list) { 350 if (!list) {
351 cdUP(); 351 cdUP();
352 return; 352 return;
353 } 353 }
354 QFileInfoListIterator it( *list ); 354 QFileInfoListIterator it( *list );
355 QFileInfo *fi; 355 QFileInfo *fi;
356 while( (fi=it.current() ) ){ 356 while( (fi=it.current() ) ){
357 if( fi->fileName() == QString::fromLatin1("..") || fi->fileName() == QString::fromLatin1(".") ){ 357 if( fi->fileName() == QString::fromLatin1("..") || fi->fileName() == QString::fromLatin1(".") ){
358 ++it; 358 ++it;
359 continue; 359 continue;
360 } 360 }
361 361
362 /* 362 /*
363 * It is a symlink we try to resolve it now but don't let us attack by DOS 363 * It is a symlink we try to resolve it now but don't let us attack by DOS
364 * 364 *
365 */ 365 */
366 if( fi->isSymLink() ){ 366 if( fi->isSymLink() ){
367 qDebug("SYMLINK "); 367 //qDebug("SYMLINK ");
368 QString file = fi->readLink(); 368 QString file = fi->readLink();
369 for( int i = 0; i<=5; i++) { // 5 tries to prevent dos 369 for( int i = 0; i<=5; i++) { // 5 tries to prevent dos
370 QFileInfo info( file ); 370 QFileInfo info( file );
371 qDebug("FILE %s ", file.latin1()); 371 //qDebug("FILE %s ", file.latin1());
372 if( !info.exists() ){ 372 if( !info.exists() ){
373 addSymlink( fi, TRUE ); 373 addSymlink( fi, TRUE );
374 break; 374 break;
375 }else if( info.isDir() ){ 375 }else if( info.isDir() ){
376 addDir( fi, TRUE ); 376 addDir( fi, TRUE );
377 break; 377 break;
378 }else if( info.isFile() ){ 378 }else if( info.isFile() ){
379 addFile( fi, TRUE ); 379 addFile( fi, TRUE );
380 break; 380 break;
381 }else if( info.isSymLink() ){ 381 }else if( info.isSymLink() ){
382 file = info.readLink() ; 382 file = info.readLink() ;
383 break; 383 break;
384 }else if( i == 4){ // couldn't resolve symlink add it as symlink 384 }else if( i == 4){ // couldn't resolve symlink add it as symlink
385 addSymlink( fi ); 385 addSymlink( fi );
386 } 386 }
387 } // off for loop for symlink resolving 387 } // off for loop for symlink resolving
388 }else if( fi->isDir() ) 388 }else if( fi->isDir() )
389 addDir( fi ); 389 addDir( fi );
390 else if( fi->isFile() ) 390 else if( fi->isFile() )
391 addFile( fi ); 391 addFile( fi );
392 392
393 ++it; 393 ++it;
394 } // of while loop 394 } // of while loop
395 m_view->sort(); 395 m_view->sort();
396 396
397} 397}
398int OFileViewFileListView::fileCount()const{ 398int OFileViewFileListView::fileCount()const{
399 return m_view->childCount(); 399 return m_view->childCount();
400} 400}
401QString OFileViewFileListView::currentDir()const{ 401QString OFileViewFileListView::currentDir()const{
402 return m_currentDir; 402 return m_currentDir;
403} 403}
404OFileSelector* OFileViewFileListView::selector() { 404OFileSelector* OFileViewFileListView::selector() {
405 return m_sel; 405 return m_sel;
406} 406}
407 407
408bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) { 408bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) {
409#if 0 409#if 0
410 if ( e->type() == QEvent::KeyPress ) { 410 if ( e->type() == QEvent::KeyPress ) {
411 QKeyEvent *k = (QKeyEvent *)e; 411 QKeyEvent *k = (QKeyEvent *)e;
412 if ( (k->key()==Key_Enter) || (k->key()==Key_Return)) { 412 if ( (k->key()==Key_Enter) || (k->key()==Key_Return)) {
413 slotClicked( Qt::LeftButton,m_view->currentItem(),QPoint(0,0),0); 413 slotClicked( Qt::LeftButton,m_view->currentItem(),QPoint(0,0),0);
414 return true; 414 return true;
415 } 415 }
416 } 416 }
417#endif 417#endif
418 return false; 418 return false;
419} 419}
420 420
421 421
422void OFileViewFileListView::connectSlots() { 422void OFileViewFileListView::connectSlots() {
423 connect(m_view, SIGNAL(clicked(QListViewItem*) ), 423 connect(m_view, SIGNAL(clicked(QListViewItem*) ),
424 this, SLOT(slotCurrentChanged(QListViewItem*) ) ); 424 this, SLOT(slotCurrentChanged(QListViewItem*) ) );
425 connect(m_view, SIGNAL(mouseButtonClicked(int, QListViewItem*, const QPoint&, int ) ), 425 connect(m_view, SIGNAL(mouseButtonClicked(int, QListViewItem*, const QPoint&, int ) ),
426 this, SLOT(slotClicked(int, QListViewItem*, const QPoint&, int ) ) ); 426 this, SLOT(slotClicked(int, QListViewItem*, const QPoint&, int ) ) );
427 connect(m_view, SIGNAL(doubleClicked( QListViewItem* )), 427 connect(m_view, SIGNAL(doubleClicked( QListViewItem* )),
428 this, SLOT(slotDoubleClicked(QListViewItem* ) ) ); 428 this, SLOT(slotDoubleClicked(QListViewItem* ) ) );
429 connect(m_view, SIGNAL(returnPressed( QListViewItem* )), 429 connect(m_view, SIGNAL(returnPressed( QListViewItem* )),
430 this, SLOT(slotDoubleClicked(QListViewItem* ) ) ); 430 this, SLOT(slotDoubleClicked(QListViewItem* ) ) );
431} 431}
432void OFileViewFileListView::slotCurrentChanged( QListViewItem* item) { 432void OFileViewFileListView::slotCurrentChanged( QListViewItem* item) {
433 if (!item) 433 if (!item)
434 return; 434 return;
435#if 0 435#if 0