summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp22
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp6
2 files changed, 26 insertions, 2 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index b378330..192f8c0 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -1281,158 +1281,178 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e)
1281 } else { 1281 } else {
1282 emit currentChanged( ci ); 1282 emit currentChanged( ci );
1283 } 1283 }
1284 } 1284 }
1285 } 1285 }
1286 e->accept(); 1286 e->accept();
1287 } 1287 }
1288 break; 1288 break;
1289 default: 1289 default:
1290 e->ignore(); 1290 e->ignore();
1291 } 1291 }
1292} 1292}
1293KOListViewListView::KOListViewListView(KOListView * lv ) 1293KOListViewListView::KOListViewListView(KOListView * lv )
1294 : KListView( lv, "kolistlistview", false ) 1294 : KListView( lv, "kolistlistview", false )
1295{ 1295{
1296 mYMousePos = 0; 1296 mYMousePos = 0;
1297 setAllColumnsShowFocus( true ); 1297 setAllColumnsShowFocus( true );
1298 mPopupTimer = new QTimer(this); 1298 mPopupTimer = new QTimer(this);
1299 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); 1299 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu()));
1300#ifndef DESKTOP_VERSION 1300#ifndef DESKTOP_VERSION
1301 //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); 1301 //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
1302#endif 1302#endif
1303 setSelectionMode( QListView::Multi ); 1303 setSelectionMode( QListView::Multi );
1304 setMultiSelection( true); 1304 setMultiSelection( true);
1305} 1305}
1306bool KOListViewListView::hasMultiSelection(QListViewItem* item) 1306bool KOListViewListView::hasMultiSelection(QListViewItem* item)
1307{ 1307{
1308 QListViewItem *qitem = firstChild (); 1308 QListViewItem *qitem = firstChild ();
1309 while ( qitem ) { 1309 while ( qitem ) {
1310 if ( qitem->isSelected() && item != qitem ) 1310 if ( qitem->isSelected() && item != qitem )
1311 return true; 1311 return true;
1312 qitem = qitem->nextSibling(); 1312 qitem = qitem->nextSibling();
1313 } 1313 }
1314 return false; 1314 return false;
1315} 1315}
1316void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 1316void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
1317{ 1317{
1318 if (!e) return; 1318 if (!e) return;
1319 QPoint vp = contentsToViewport(e->pos()); 1319 QPoint vp = contentsToViewport(e->pos());
1320 QListViewItem *item = itemAt(vp); 1320 QListViewItem *item = itemAt(vp);
1321 if (!item) { 1321 if (!item) {
1322 emit newEvent(); 1322 emit newEvent();
1323 return; 1323 return;
1324 } 1324 }
1325 KListView::contentsMouseDoubleClickEvent(e); 1325 KListView::contentsMouseDoubleClickEvent(e);
1326} 1326}
1327#if 0 1327#if 0
1328void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) 1328void KOListViewListView::contentsMousePressEvent(QMouseEvent *e)
1329{ 1329{
1330 //qDebug("contentsMousePressEvent++++ "); 1330 //qDebug("contentsMousePressEvent++++ ");
1331 KListView::contentsMousePressEvent( e ); 1331 KListView::contentsMousePressEvent( e );
1332 if ( e->button() == RightButton ) { 1332 if ( e->button() == RightButton ) {
1333 QListViewItem* ci = currentItem(); 1333 QListViewItem* ci = currentItem();
1334 clearSelection () ; 1334 clearSelection () ;
1335 if ( ci ) 1335 if ( ci )
1336 ci->setSelected( true ); 1336 ci->setSelected( true );
1337 } 1337 }
1338} 1338}
1339void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) 1339void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
1340{ 1340{
1341 KListView::contentsMouseReleaseEvent(e); 1341 KListView::contentsMouseReleaseEvent(e);
1342} 1342}
1343void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) 1343void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e)
1344{ 1344{
1345 KListView::contentsMouseMoveEvent(e); 1345 KListView::contentsMouseMoveEvent(e);
1346} 1346}
1347#endif 1347#endif
1348void KOListViewListView::popupMenu() 1348void KOListViewListView::popupMenu()
1349{ 1349{
1350 mPopupTimer->stop(); 1350 mPopupTimer->stop();
1351 QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton ); 1351 QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton );
1352 QApplication::postEvent( this->viewport(), e ); 1352 QApplication::postEvent( this->viewport(), e );
1353 1353
1354} 1354}
1355void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) 1355void KOListViewListView::contentsMousePressEvent(QMouseEvent *e)
1356{ 1356{
1357 //qDebug("contentsMousePressEvent++++ %d %d", e->pos().y(), e->globalPos().y()); 1357 //qDebug("contentsMousePressEvent++++ %d %d", e->pos().y(), e->globalPos().y());
1358 mYMousePos = mapToGlobal( (e->pos())).y(); 1358 mYMousePos = mapToGlobal( (e->pos())).y();
1359 if ( e->button() == LeftButton ) { 1359 if ( e->button() == LeftButton ) {
1360 mPopupTimer->start( 600 ); 1360 mPopupTimer->start( 600 );
1361 mEventPos = contentsToViewport(e->pos()); 1361 mEventPos = contentsToViewport(e->pos());
1362 mEventGlobalPos = e->globalPos(); 1362 mEventGlobalPos = e->globalPos();
1363 } 1363 }
1364 KListView::contentsMousePressEvent( e ); 1364 KListView::contentsMousePressEvent( e );
1365 if ( e->button() == RightButton ) { 1365 if ( e->button() == RightButton ) {
1366 QListViewItem* ci = currentItem(); 1366 QListViewItem* ci = currentItem();
1367 //clearSelection(); 1367 //clearSelection();
1368 if ( ci ) 1368 if ( ci )
1369 ci->setSelected( true ); 1369 ci->setSelected( true );
1370 } 1370 }
1371} 1371}
1372void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) 1372void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
1373{ 1373{
1374 mPopupTimer->stop(); 1374 mPopupTimer->stop();
1375 KListView::contentsMouseReleaseEvent(e); 1375 KListView::contentsMouseReleaseEvent(e);
1376} 1376}
1377void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) 1377void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e)
1378{ 1378{
1379 // qDebug("contentsMouseMoveEv....... "); 1379 // qDebug("contentsMouseMoveEv....... ");
1380 // qDebug("start: %d current %d ",mYMousePos , mapToGlobal( (e->pos())).y() ); 1380 // qDebug("start: %d current %d ",mYMousePos , mapToGlobal( (e->pos())).y() );
1381 int diff = mYMousePos - mapToGlobal( (e->pos())).y(); 1381 int diff = mYMousePos - mapToGlobal( (e->pos())).y();
1382 if ( diff < 0 ) diff = -diff; 1382 if ( diff < 0 ) diff = -diff;
1383 if ( diff > 15 ) 1383 if ( diff > 15 )
1384 mPopupTimer->stop(); 1384 mPopupTimer->stop();
1385 else { 1385 else {
1386 mEventPos = contentsToViewport(e->pos()); 1386 mEventPos = contentsToViewport(e->pos());
1387 mEventGlobalPos = e->globalPos(); 1387 mEventGlobalPos = e->globalPos();
1388 } 1388 }
1389 KListView::contentsMouseMoveEvent(e); 1389 KListView::contentsMouseMoveEvent(e);
1390} 1390}
1391 1391
1392#define protected public 1392#define protected public
1393#include <qheader.h> 1393#include <qheader.h>
1394#undef protected 1394#undef protected
1395void KOListViewListView::printList() 1395void KOListViewListView::printList()
1396{ 1396{
1397#ifdef DESKTOP_VERSION 1397#ifdef DESKTOP_VERSION
1398 KOPrintPrefs pp ( this ); 1398 KOPrintPrefs pp ( this );
1399 if (!pp.exec() ) 1399 if (!pp.exec() )
1400 return; 1400 return;
1401 int scaleval = pp.printMode() ; 1401 int scaleval = pp.printMode() ;
1402 1402
1403 QPrinter printer; 1403 QPrinter printer;
1404 if (!printer.setup() ) 1404 if (!printer.setup() )
1405 return; 1405 return;
1406 clearSelection (); 1406 clearSelection ();
1407 QPainter p; 1407 QPainter p;
1408 p.begin ( &printer ); 1408 p.begin ( &printer );
1409 p.setFont(font());
1409 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 1410 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
1410 float dx, dy; 1411 float dx, dy;
1411 int wid = (m.width() * 9)/10; 1412 int wid = (m.width() * 9)/10;
1412 dx = (float) wid/(float)contentsWidth (); 1413 dx = (float) wid/(float)contentsWidth ();
1413 dy = (float)(m.height()) / (float)contentsHeight (); 1414 dy = (float)(m.height()) / (float)contentsHeight ();
1414 float scale; 1415 float scale;
1415 // scale to fit the width or height of the paper 1416 // scale to fit the width or height of the paper
1416 if ( dx < dy ) 1417 if ( dx < dy )
1417 scale = dx; 1418 scale = dx;
1418 else 1419 else
1419 scale = dy; 1420 scale = dy;
1420 1421
1421 p.translate( m.width()/10,m.width()/10 ); 1422 p.translate( m.width()/10,m.width()/10 );
1422 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) { 1423 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
1423 p.scale( scale, scale ); 1424 p.scale( scale, scale );
1424 } 1425 }
1425 1426
1426 int cou = header()->count(); 1427 int cou = header()->count();
1427 int iii; 1428 int iii;
1428 QRect rect ( 0,0,0, header()->height()); 1429 QRect rect ( 0,0,0, header()->height());
1429 for ( iii = 0; iii < cou; ++iii ) { 1430 for ( iii = 0; iii < cou; ++iii ) {
1430 rect.setLeft ( header()->sectionPos( iii ) ); 1431 rect.setLeft ( header()->sectionPos( iii ) );
1431 rect.setRight ( header()->sectionPos( iii ) + header()->sectionSize (iii)); 1432 rect.setRight ( header()->sectionPos( iii ) + header()->sectionSize (iii));
1432 header()->paintSection ( & p, header()->mapToIndex (iii), rect ); 1433 header()->paintSection ( & p, header()->mapToIndex (iii), rect );
1433 } 1434 }
1434 p.translate( 0, header()->height()); 1435 p.translate( 0, header()->height());
1435 drawContentsOffset ( &p, 0,0, 0,0, contentsWidth (), contentsHeight () ); 1436 //drawContentsOffset ( &p, 0,0, 0,0, contentsWidth (), contentsHeight () );
1437
1438 const QColorGroup &cg = colorGroup();
1439 KOListViewItem* item = (KOListViewItem* )firstChild();
1440 int yOff = 0;
1441 while ( item ) {
1442 p.translate( 0, yOff );
1443 p.save();
1444 for ( iii = 0; iii < cou; ++iii ) {
1445 int align = columnAlignment( iii );
1446 if ( align == AlignAuto ) align = AlignLeft;
1447 p.restore();
1448 p.save();
1449 p.translate( header()->sectionPos( iii ), 0);
1450 item->paintCell( &p, cg, iii, header()->sectionSize (iii), align );
1451 }
1452 yOff = item->height();
1453 item = (KOListViewItem* )(item->itemBelow());
1454 p.restore();
1455 }
1436 p.end(); 1456 p.end();
1437#endif 1457#endif
1438} 1458}
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 764c495..292951b 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -800,208 +800,212 @@ void KDEPIMConfigWidget::updateClientWidgets()
800 enabled = false; 800 enabled = false;
801 } 801 }
802 else 802 else
803 { 803 {
804 enabled = true; 804 enabled = true;
805 } 805 }
806 806
807 807
808 mChannel->setReadOnly(readonly); 808 mChannel->setReadOnly(readonly);
809 mMessage->setReadOnly(readonly); 809 mMessage->setReadOnly(readonly);
810 mParameters->setReadOnly(readonly); 810 mParameters->setReadOnly(readonly);
811 if ( mMessage2 ) 811 if ( mMessage2 )
812 mMessage2->setReadOnly(readonly); 812 mMessage2->setReadOnly(readonly);
813 if ( mParameters2 ) 813 if ( mParameters2 )
814 mParameters2->setReadOnly(readonly); 814 mParameters2->setReadOnly(readonly);
815 815
816 mChannel->setEnabled(enabled); 816 mChannel->setEnabled(enabled);
817 mMessage->setEnabled(enabled); 817 mMessage->setEnabled(enabled);
818 mParameters->setEnabled(enabled); 818 mParameters->setEnabled(enabled);
819 if ( mMessage2 ) 819 if ( mMessage2 )
820 mMessage2->setEnabled(enabled); 820 mMessage2->setEnabled(enabled);
821 if ( mParameters2 ) 821 if ( mParameters2 )
822 mParameters2->setEnabled(enabled); 822 mParameters2->setEnabled(enabled);
823 823
824 824
825 825
826 mClient->setCurrentItem(mCurrentClient); 826 mClient->setCurrentItem(mCurrentClient);
827 827
828 828
829 // enable/disable the extra message/parameter field 829 // enable/disable the extra message/parameter field
830 if (mCurrentApp == ExternalAppHandler::EMAIL) 830 if (mCurrentApp == ExternalAppHandler::EMAIL)
831 { 831 {
832 } 832 }
833 else 833 else
834 { 834 {
835 if ( mMessage2 ) 835 if ( mMessage2 )
836 mMessage2->setText( "" ); 836 mMessage2->setText( "" );
837 if ( mParameters2 ) 837 if ( mParameters2 )
838 mParameters2->setText( "" ); 838 mParameters2->setText( "" );
839 } 839 }
840 840
841 if (enabled == true) { 841 if (enabled == true) {
842 if ( mMessage2 ) 842 if ( mMessage2 )
843 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 843 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
844 if ( mParameters2 ) 844 if ( mParameters2 )
845 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 845 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
846 } 846 }
847 847
848 848
849 blockSignals( blocked ); 849 blockSignals( blocked );
850 850
851} 851}
852 852
853void KDEPIMConfigWidget::usrReadConfig() 853void KDEPIMConfigWidget::usrReadConfig()
854{ 854{
855 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 855 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
856 856
857 bool blocked = signalsBlocked(); 857 bool blocked = signalsBlocked();
858 blockSignals( true ); 858 blockSignals( true );
859 859
860 if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) 860 if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir )
861 mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); 861 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
862 else { 862 else {
863 mBackupUrl->setURL(prefs->mBackupDatadir); 863 mBackupUrl->setURL(prefs->mBackupDatadir);
864 864
865 } 865 }
866 mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); 866 mBackupNumbersSpin->setValue( prefs->mBackupNumbers );
867 mBackupDayCountSpin->setValue( prefs->mBackupDayCount); 867 mBackupDayCountSpin->setValue( prefs->mBackupDayCount);
868 868
869 QString dummy = prefs->mUserDateFormatLong; 869 QString dummy = prefs->mUserDateFormatLong;
870 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 870 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
871 dummy = prefs->mUserDateFormatShort; 871 dummy = prefs->mUserDateFormatShort;
872 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 872 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
873 873
874 QDate current ( 2001, 1,1); 874 QDate current ( 2001, 1,1);
875 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); 875 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1));
876 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); 876 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1));
877 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); 877 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId));
878 878
879 mEmailClient = prefs->mEmailClient; 879 mEmailClient = prefs->mEmailClient;
880 mEmailOtherChannel = prefs->mEmailOtherChannel; 880 mEmailOtherChannel = prefs->mEmailOtherChannel;
881 mEmailOtherMessage = prefs->mEmailOtherMessage; 881 mEmailOtherMessage = prefs->mEmailOtherMessage;
882 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; 882 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters;
883 mEmailOtherMessage2 = prefs->mEmailOtherMessage2; 883 mEmailOtherMessage2 = prefs->mEmailOtherMessage2;
884 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; 884 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2;
885 885
886 mPhoneClient = prefs->mPhoneClient; 886 mPhoneClient = prefs->mPhoneClient;
887 mPhoneOtherChannel = prefs->mPhoneOtherChannel; 887 mPhoneOtherChannel = prefs->mPhoneOtherChannel;
888 mPhoneOtherMessage = prefs->mPhoneOtherMessage; 888 mPhoneOtherMessage = prefs->mPhoneOtherMessage;
889 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; 889 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters;
890 890
891 mFaxClient = prefs->mFaxClient; 891 mFaxClient = prefs->mFaxClient;
892 mFaxOtherChannel = prefs->mFaxOtherChannel; 892 mFaxOtherChannel = prefs->mFaxOtherChannel;
893 mFaxOtherMessage = prefs->mFaxOtherMessage; 893 mFaxOtherMessage = prefs->mFaxOtherMessage;
894 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; 894 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters;
895 895
896 mSMSClient = prefs->mSMSClient; 896 mSMSClient = prefs->mSMSClient;
897 mSMSOtherChannel = prefs->mSMSOtherChannel; 897 mSMSOtherChannel = prefs->mSMSOtherChannel;
898 mSMSOtherMessage = prefs->mSMSOtherMessage; 898 mSMSOtherMessage = prefs->mSMSOtherMessage;
899 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; 899 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters;
900 900
901 mPagerClient = prefs->mPagerClient; 901 mPagerClient = prefs->mPagerClient;
902 mPagerOtherChannel = prefs->mPagerOtherChannel; 902 mPagerOtherChannel = prefs->mPagerOtherChannel;
903 mPagerOtherMessage = prefs->mPagerOtherMessage; 903 mPagerOtherMessage = prefs->mPagerOtherMessage;
904 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; 904 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters;
905 905
906 mSipClient = prefs->mSipClient; 906 mSipClient = prefs->mSipClient;
907 mSipOtherChannel = prefs->mSipOtherChannel; 907 mSipOtherChannel = prefs->mSipOtherChannel;
908 mSipOtherMessage = prefs->mSipOtherMessage; 908 mSipOtherMessage = prefs->mSipOtherMessage;
909 mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; 909 mSipOtherMessageParameters = prefs->mSipOtherMessageParameters;
910 910
911 mCurrentApp = ExternalAppHandler::EMAIL; 911 mCurrentApp = ExternalAppHandler::EMAIL;
912 mCurrentClient = mEmailClient; 912 mCurrentClient = mEmailClient;
913 913
914 updateClientWidgets(); 914 updateClientWidgets();
915 915
916 blockSignals( blocked ); 916 blockSignals( blocked );
917 917
918} 918}
919 919
920void KDEPIMConfigWidget::usrWriteConfig() 920void KDEPIMConfigWidget::usrWriteConfig()
921{ 921{
922 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 922 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
923 923
924 saveEditFieldSettings(); 924 saveEditFieldSettings();
925 925
926 prefs->mBackupNumbers = mBackupNumbersSpin->value(); 926 prefs->mBackupNumbers = mBackupNumbersSpin->value();
927 prefs->mBackupDayCount = mBackupDayCountSpin->value(); 927 prefs->mBackupDayCount = mBackupDayCountSpin->value();
928 prefs->mBackupDatadir = mBackupUrl->url(); 928 QString bup_url = mBackupUrl->url();
929 if ( bup_url.right(1) != "/" && bup_url.right(1) != "\\" )
930 bup_url += "/";
931
932 prefs->mBackupDatadir = bup_url;
929 933
930 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 934 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
931 prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); 935 prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
932 936
933 prefs->mTimeZoneId = mTimeZoneCombo->currentText(); 937 prefs->mTimeZoneId = mTimeZoneCombo->currentText();
934 QDate date; 938 QDate date;
935 date = mStartDateSavingEdit->date(); 939 date = mStartDateSavingEdit->date();
936 int sub = 0; 940 int sub = 0;
937 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 941 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
938 sub = 1; 942 sub = 1;
939 prefs->mDaylightsavingStart = date.dayOfYear()-sub; 943 prefs->mDaylightsavingStart = date.dayOfYear()-sub;
940 date = mEndDateSavingEdit->date(); 944 date = mEndDateSavingEdit->date();
941 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 945 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
942 sub = 1; 946 sub = 1;
943 else 947 else
944 sub = 0; 948 sub = 0;
945 prefs->mDaylightsavingEnd = date.dayOfYear()-sub; 949 prefs->mDaylightsavingEnd = date.dayOfYear()-sub;
946 950
947 951
948 prefs->mEmailClient = mEmailClient; 952 prefs->mEmailClient = mEmailClient;
949 prefs->mEmailOtherChannel = mEmailOtherChannel; 953 prefs->mEmailOtherChannel = mEmailOtherChannel;
950 prefs->mEmailOtherMessage = mEmailOtherMessage; 954 prefs->mEmailOtherMessage = mEmailOtherMessage;
951 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; 955 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters;
952 prefs->mEmailOtherMessage2 = mEmailOtherMessage2; 956 prefs->mEmailOtherMessage2 = mEmailOtherMessage2;
953 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; 957 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2;
954 958
955 prefs->mPhoneClient = mPhoneClient; 959 prefs->mPhoneClient = mPhoneClient;
956 prefs->mPhoneOtherChannel = mPhoneOtherChannel; 960 prefs->mPhoneOtherChannel = mPhoneOtherChannel;
957 prefs->mPhoneOtherMessage = mPhoneOtherMessage; 961 prefs->mPhoneOtherMessage = mPhoneOtherMessage;
958 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; 962 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters;
959 963
960 prefs->mFaxClient = mFaxClient; 964 prefs->mFaxClient = mFaxClient;
961 prefs->mFaxOtherChannel = mFaxOtherChannel; 965 prefs->mFaxOtherChannel = mFaxOtherChannel;
962 prefs->mFaxOtherMessage = mFaxOtherMessage; 966 prefs->mFaxOtherMessage = mFaxOtherMessage;
963 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; 967 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters;
964 968
965 prefs->mSMSClient = mSMSClient; 969 prefs->mSMSClient = mSMSClient;
966 prefs->mSMSOtherChannel = mSMSOtherChannel; 970 prefs->mSMSOtherChannel = mSMSOtherChannel;
967 prefs->mSMSOtherMessage = mSMSOtherMessage; 971 prefs->mSMSOtherMessage = mSMSOtherMessage;
968 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; 972 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters;
969 973
970 prefs->mPagerClient = mPagerClient; 974 prefs->mPagerClient = mPagerClient;
971 prefs->mPagerOtherChannel = mPagerOtherChannel; 975 prefs->mPagerOtherChannel = mPagerOtherChannel;
972 prefs->mPagerOtherMessage = mPagerOtherMessage; 976 prefs->mPagerOtherMessage = mPagerOtherMessage;
973 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; 977 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters;
974 978
975 979
976 prefs->mSipClient = mSipClient; 980 prefs->mSipClient = mSipClient;
977 prefs->mSipOtherChannel = mSipOtherChannel; 981 prefs->mSipOtherChannel = mSipOtherChannel;
978 prefs->mSipOtherMessage = mSipOtherMessage; 982 prefs->mSipOtherMessage = mSipOtherMessage;
979 prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; 983 prefs->mSipOtherMessageParameters = mSipOtherMessageParameters;
980 984
981 //release the cache that other views can access the changed values instantanious 985 //release the cache that other views can access the changed values instantanious
982 ExternalAppHandler::instance()->loadConfig(); 986 ExternalAppHandler::instance()->loadConfig();
983 KPimGlobalPrefs::instance()->setGlobalConfig(); 987 KPimGlobalPrefs::instance()->setGlobalConfig();
984} 988}
985 989
986 990
987void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, 991void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text,
988 const QStringList *tags) 992 const QStringList *tags)
989{ 993{
990 if (tags) { 994 if (tags) {
991 int i = tags->findIndex(text); 995 int i = tags->findIndex(text);
992 if (i > 0) combo->setCurrentItem(i); 996 if (i > 0) combo->setCurrentItem(i);
993 } else { 997 } else {
994 for(int i=0;i<combo->count();++i) { 998 for(int i=0;i<combo->count();++i) {
995 if (combo->text(i) == text) { 999 if (combo->text(i) == text) {
996 combo->setCurrentItem(i); 1000 combo->setCurrentItem(i);
997 break; 1001 break;
998 } 1002 }
999 } 1003 }
1000 } 1004 }
1001} 1005}
1002 1006
1003 1007
1004void KDEPIMConfigWidget::textChanged( const QString& text ) 1008void KDEPIMConfigWidget::textChanged( const QString& text )
1005{ 1009{
1006 emit changed( true ); 1010 emit changed( true );
1007} 1011}