author | ulf69 <ulf69> | 2004-10-02 00:19:45 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-10-02 00:19:45 (UTC) |
commit | ba1176743a536e19bb8b9d68b1c0c0023a0f3101 (patch) (unidiff) | |
tree | 352e97763d1b90eca9884651ab5533ef8ae8affc /libkdepim | |
parent | 7810fe355bd75c83bcdaed646cd1dde8d3c94fcb (diff) | |
download | kdepimpi-ba1176743a536e19bb8b9d68b1c0c0023a0f3101.zip kdepimpi-ba1176743a536e19bb8b9d68b1c0c0023a0f3101.tar.gz kdepimpi-ba1176743a536e19bb8b9d68b1c0c0023a0f3101.tar.bz2 |
fixed a crash when pressing return(enter) in the syncprofilenames combobox
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 3 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 6e6e631..28aac45 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -111,48 +111,49 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
111 | int iii = 0; | 111 | int iii = 0; |
112 | //topLayout->addMultiCellWidget(lab , iii,iii,0,1); | 112 | //topLayout->addMultiCellWidget(lab , iii,iii,0,1); |
113 | //++iii; | 113 | //++iii; |
114 | 114 | ||
115 | mMyMachineName = new QLineEdit(topFrame); | 115 | mMyMachineName = new QLineEdit(topFrame); |
116 | lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame); | 116 | lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame); |
117 | topLayout->addWidget(lab ,iii,0); | 117 | topLayout->addWidget(lab ,iii,0); |
118 | topLayout->addWidget(mMyMachineName,iii,1); | 118 | topLayout->addWidget(mMyMachineName,iii,1); |
119 | ++iii; | 119 | ++iii; |
120 | 120 | ||
121 | QHBox* buttonbox = new QHBox( topFrame); | 121 | QHBox* buttonbox = new QHBox( topFrame); |
122 | topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1); | 122 | topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1); |
123 | ++iii; | 123 | ++iii; |
124 | button = new QPushButton( i18n("New profile"), buttonbox ); | 124 | button = new QPushButton( i18n("New profile"), buttonbox ); |
125 | connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) ); | 125 | connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) ); |
126 | 126 | ||
127 | button = new QPushButton( i18n("Clone profile"), buttonbox ); | 127 | button = new QPushButton( i18n("Clone profile"), buttonbox ); |
128 | connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) ); | 128 | connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) ); |
129 | 129 | ||
130 | button = new QPushButton( i18n("Delete profile"), buttonbox ); | 130 | button = new QPushButton( i18n("Delete profile"), buttonbox ); |
131 | connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) ); | 131 | connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) ); |
132 | 132 | ||
133 | mProfileBox = new QComboBox(topFrame); | 133 | mProfileBox = new QComboBox(topFrame); |
134 | mProfileBox->setEditable ( true ); | 134 | mProfileBox->setEditable ( true ); |
135 | mProfileBox->setInsertionPolicy(QComboBox::NoInsertion); | ||
135 | connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) ); | 136 | connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) ); |
136 | connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) ); | 137 | connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) ); |
137 | 138 | ||
138 | lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame); | 139 | lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame); |
139 | topLayout->addWidget(lab ,iii,0); | 140 | topLayout->addWidget(lab ,iii,0); |
140 | topLayout->addWidget(mProfileBox, iii,1); | 141 | topLayout->addWidget(mProfileBox, iii,1); |
141 | ++iii; | 142 | ++iii; |
142 | 143 | ||
143 | mIncludeInRing = new QCheckBox( i18n("Include in multiple calendar sync"), topFrame ); | 144 | mIncludeInRing = new QCheckBox( i18n("Include in multiple calendar sync"), topFrame ); |
144 | topLayout->addMultiCellWidget(mIncludeInRing, iii,iii,0,1); | 145 | topLayout->addMultiCellWidget(mIncludeInRing, iii,iii,0,1); |
145 | ++iii; | 146 | ++iii; |
146 | mIncludeInRingAB = new QCheckBox( i18n("Include in multiple addressbook sync"), topFrame ); | 147 | mIncludeInRingAB = new QCheckBox( i18n("Include in multiple addressbook sync"), topFrame ); |
147 | topLayout->addMultiCellWidget(mIncludeInRingAB, iii,iii,0,1); | 148 | topLayout->addMultiCellWidget(mIncludeInRingAB, iii,iii,0,1); |
148 | ++iii; | 149 | ++iii; |
149 | mIncludeInRingPWM = new QCheckBox( i18n("Include in multiple pwmanager sync"), topFrame ); | 150 | mIncludeInRingPWM = new QCheckBox( i18n("Include in multiple pwmanager sync"), topFrame ); |
150 | topLayout->addMultiCellWidget(mIncludeInRingPWM, iii,iii,0,1); | 151 | topLayout->addMultiCellWidget(mIncludeInRingPWM, iii,iii,0,1); |
151 | ++iii; | 152 | ++iii; |
152 | 153 | ||
153 | mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); | 154 | mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); |
154 | topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); | 155 | topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); |
155 | ++iii; | 156 | ++iii; |
156 | QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); | 157 | QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); |
157 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); | 158 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); |
158 | ++iii; | 159 | ++iii; |
@@ -326,49 +327,49 @@ void KSyncPrefsDialog::chooseFilePWM() | |||
326 | if ( fn == "" ) | 327 | if ( fn == "" ) |
327 | return; | 328 | return; |
328 | mRemoteFilePWM->setText( fn ); | 329 | mRemoteFilePWM->setText( fn ); |
329 | } | 330 | } |
330 | 331 | ||
331 | void KSyncPrefsDialog::textChanged( const QString & s ) | 332 | void KSyncPrefsDialog::textChanged( const QString & s ) |
332 | { | 333 | { |
333 | if ( mProfileBox->count() == 0 ) | 334 | if ( mProfileBox->count() == 0 ) |
334 | return; | 335 | return; |
335 | if ( currentSelection < 3 ) { | 336 | if ( currentSelection < 3 ) { |
336 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); | 337 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); |
337 | mProfileBox->blockSignals( true ); | 338 | mProfileBox->blockSignals( true ); |
338 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); | 339 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); |
339 | mProfileBox->blockSignals( false ); | 340 | mProfileBox->blockSignals( false ); |
340 | return; | 341 | return; |
341 | } | 342 | } |
342 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); | 343 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); |
343 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; | 344 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; |
344 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; | 345 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; |
345 | prof->setName( s ); | 346 | prof->setName( s ); |
346 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; | 347 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; |
347 | } | 348 | } |
348 | void KSyncPrefsDialog::profileChanged( int item ) | 349 | void KSyncPrefsDialog::profileChanged( int item ) |
349 | { | 350 | { |
350 | //qDebug("KSyncPrefsDialog::profileChanged %d ", item ); | 351 | //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); |
351 | KSyncProfile* prof; | 352 | KSyncProfile* prof; |
352 | saveProfile(); | 353 | saveProfile(); |
353 | currentSelection = item; | 354 | currentSelection = item; |
354 | prof = mSyncProfiles.at(item) ; | 355 | prof = mSyncProfiles.at(item) ; |
355 | mRemotePrecommand->setText(prof->getPreSyncCommand()); | 356 | mRemotePrecommand->setText(prof->getPreSyncCommand()); |
356 | mRemotePostcommand->setText(prof->getPostSyncCommand()); | 357 | mRemotePostcommand->setText(prof->getPostSyncCommand()); |
357 | mLocalTempFile->setText(prof->getLocalTempFile()); | 358 | mLocalTempFile->setText(prof->getLocalTempFile()); |
358 | mRemoteFile->setText(prof->getRemoteFileName()) ; | 359 | mRemoteFile->setText(prof->getRemoteFileName()) ; |
359 | 360 | ||
360 | mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); | 361 | mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); |
361 | mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); | 362 | mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); |
362 | mLocalTempFileAB->setText(prof->getLocalTempFileAB()); | 363 | mLocalTempFileAB->setText(prof->getLocalTempFileAB()); |
363 | mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; | 364 | mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; |
364 | 365 | ||
365 | mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); | 366 | mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); |
366 | mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); | 367 | mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); |
367 | mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); | 368 | mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); |
368 | mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; | 369 | mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; |
369 | 370 | ||
370 | mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); | 371 | mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); |
371 | mPhoneDevice->setText(prof->getPhoneDevice()); | 372 | mPhoneDevice->setText(prof->getPhoneDevice()); |
372 | mPhoneConnection->setText(prof->getPhoneConnection()); | 373 | mPhoneConnection->setText(prof->getPhoneConnection()); |
373 | mPhoneModel->setText(prof->getPhoneModel()); | 374 | mPhoneModel->setText(prof->getPhoneModel()); |
374 | 375 | ||
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index a43ebe2..2bf4e6c 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp | |||
@@ -62,49 +62,49 @@ KSyncProfile* KSyncProfile::clone() | |||
62 | myClone->setWriteBackFuture( mWriteBackFuture ); | 62 | myClone->setWriteBackFuture( mWriteBackFuture ); |
63 | myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); | 63 | myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); |
64 | myClone->setIncludeInRingSync( mIncludeInRingSync ); | 64 | myClone->setIncludeInRingSync( mIncludeInRingSync ); |
65 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); | 65 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); |
66 | myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM ); | 66 | myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM ); |
67 | myClone->setSyncPrefs( mSyncPrefs); | 67 | myClone->setSyncPrefs( mSyncPrefs); |
68 | myClone->setIsLocalFileSync( mIsLocalFileSync ); | 68 | myClone->setIsLocalFileSync( mIsLocalFileSync ); |
69 | myClone->setIsPhoneSync( mIsPhoneSync ); | 69 | myClone->setIsPhoneSync( mIsPhoneSync ); |
70 | myClone->setWriteContactToSIM( mWriteContactToSIM ); | 70 | myClone->setWriteContactToSIM( mWriteContactToSIM ); |
71 | myClone->setName( "noName" ); | 71 | myClone->setName( "noName" ); |
72 | //myClone->setIdentifier( "noID" ); | 72 | //myClone->setIdentifier( "noID" ); |
73 | return myClone; | 73 | return myClone; |
74 | } | 74 | } |
75 | 75 | ||
76 | 76 | ||
77 | void KSyncProfile::setDefault() | 77 | void KSyncProfile::setDefault() |
78 | { | 78 | { |
79 | mPreSyncCommand = i18n("command for downloading remote file to local device"); | 79 | mPreSyncCommand = i18n("command for downloading remote file to local device"); |
80 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); | 80 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); |
81 | mLocalTempFile = "/tmp/mycalendar.ics"; | 81 | mLocalTempFile = "/tmp/mycalendar.ics"; |
82 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; | 82 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; |
83 | mPreSyncCommandAB = i18n("command for downloading remote file to local device"); | 83 | mPreSyncCommandAB = i18n("command for downloading remote file to local device"); |
84 | mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); | 84 | mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); |
85 | mLocalTempFileAB = "/tmp/std.vcf"; | 85 | mLocalTempFileAB = "/tmp/std.vcf"; |
86 | mRemoteFileNamePWM = "/home/polo/kdepim/apps/kabc/localfile.vcf"; | 86 | mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf"; |
87 | mPreSyncCommandPWM = i18n("command for downloading remote file to local device"); | 87 | mPreSyncCommandPWM = i18n("command for downloading remote file to local device"); |
88 | mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device"); | 88 | mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device"); |
89 | mLocalTempFilePWM = "/tmp/passwords.pwm"; | 89 | mLocalTempFilePWM = "/tmp/passwords.pwm"; |
90 | mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm"; | 90 | mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm"; |
91 | mShowSummaryAfterSync = true; | 91 | mShowSummaryAfterSync = true; |
92 | mAskForPreferences = true; | 92 | mAskForPreferences = true; |
93 | mWriteBackExisting = false; | 93 | mWriteBackExisting = false; |
94 | mWriteBackFuture = false; | 94 | mWriteBackFuture = false; |
95 | mWriteBackFutureWeeks = 12; | 95 | mWriteBackFutureWeeks = 12; |
96 | mWriteBackFile = true; | 96 | mWriteBackFile = true; |
97 | mIncludeInRingSync = false; | 97 | mIncludeInRingSync = false; |
98 | mIncludeInRingSyncAB = false; | 98 | mIncludeInRingSyncAB = false; |
99 | mIncludeInRingSyncPWM = false; | 99 | mIncludeInRingSyncPWM = false; |
100 | mSyncPrefs = SYNC_PREF_ASK; | 100 | mSyncPrefs = SYNC_PREF_ASK; |
101 | mIsLocalFileSync = true; | 101 | mIsLocalFileSync = true; |
102 | mName = "noName"; | 102 | mName = "noName"; |
103 | mIsPhoneSync = false; | 103 | mIsPhoneSync = false; |
104 | mWriteContactToSIM = false; | 104 | mWriteContactToSIM = false; |
105 | mPhoneDevice = "/dev/ircomm"; | 105 | mPhoneDevice = "/dev/ircomm"; |
106 | mPhoneConnection = "irda"; | 106 | mPhoneConnection = "irda"; |
107 | mPhoneModel = "6310i"; | 107 | mPhoneModel = "6310i"; |
108 | } | 108 | } |
109 | void KSyncProfile::readConfig(KConfig *config ) | 109 | void KSyncProfile::readConfig(KConfig *config ) |
110 | { | 110 | { |