-rw-r--r-- | kaddressbook/kabcore.cpp | 57 | ||||
-rw-r--r-- | kmicromail/viewmail.cpp | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 5 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 6 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 4 | ||||
-rw-r--r-- | libkcal/phoneformat.cpp | 4 | ||||
-rw-r--r-- | version | 2 |
7 files changed, 22 insertions, 60 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 2e408b7..11eeabc 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -695,105 +695,66 @@ void KABCore::export2phone() KPimGlobalPrefs::instance()->mEx2PhoneModel ); QStringList uids = mViewManager->selectedUids(); if ( uids.isEmpty() ) return; QString fileName = getPhoneFile(); if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) return; message(i18n("Exporting to phone...")); QTimer::singleShot( 1, this , SLOT ( writeToPhone())); } QString KABCore::getPhoneFile() { -#ifdef _WIN32_ +#ifdef DESKTOP_VERSION return locateLocal("tmp", "phonefile.vcf"); #else return "/tmp/phonefile.vcf"; #endif } void KABCore::writeToPhone( ) { if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) message(i18n("Export to phone finished!")); else qDebug(i18n("Error exporting to phone")); } void KABCore::beamVCard() { QStringList uids = mViewManager->selectedUids(); if ( !uids.isEmpty() ) beamVCard( uids ); } void KABCore::beamVCard(const QStringList& uids) { -/*US - QString beamFilename; - Opie::OPimContact c; - if ( actionPersonal->isOn() ) { - beamFilename = addressbookPersonalVCardName(); - if ( !QFile::exists( beamFilename ) ) - return; // can't beam a non-existent file - Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, - beamFilename ); - Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); - Opie::OPimContactAccess::List allList = access->allRecords(); - Opie::OPimContactAccess::List::Iterator it = allList.begin(); // Just take first - c = *it; - - delete access; - } else { - unlink( beamfile ); // delete if exists - mkdir("/tmp/obex/", 0755); - c = m_abView -> currentEntry(); - Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, - beamfile ); - Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); - access->add( c ); - access->save(); - delete access; - - beamFilename = beamfile; - } - - owarn << "Beaming: " << beamFilename << oendl; -*/ - -#if 0 - QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); - - QString dirName = tmpdir + "/" + KApplication::randomString( 8 ); - - QString name = "contact.vcf"; - QString fileName = dirName + "/" + name; -#endif - // LR: we should use the /tmp dir, because: /tmp = RAM, (HOME)/kdepim = flash memory - // + // LR: we should use the /tmp dir on the Zaurus, + // because: /tmp = RAM, (HOME)/kdepim = flash memory + +#ifdef DESKTOP_VERSION + QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); +#else QString fileName = "/tmp/kapibeamfile.vcf"; +#endif - - //QDir().mkdir( dirName, true ); - - KABC::VCardConverter converter; QString description; QString datastream; for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { KABC::Addressee a = mAddressBook->findByUid( *it ); if ( a.isEmpty() ) continue; if (description.isEmpty()) description = a.formattedName(); QString vcard; converter.addresseeToVCard( a, vcard ); int start = 0; int next; @@ -2849,28 +2810,28 @@ bool KABCore::syncPhone() void KABCore::getFile( bool success ) { if ( ! success ) { message( i18n("Error receiving file. Nothing changed!") ); return; } mAddressBook->importFromFile( sentSyncFile() , false, true ); message( i18n("Pi-Sync successful!") ); mViewManager->refreshView(); } void KABCore::syncFileRequest() { mAddressBook->export2File( sentSyncFile() ); } QString KABCore::sentSyncFile() { -#ifdef _WIN32_ +#ifdef DESKTOP_VERSION return locateLocal( "tmp", "copysyncab.vcf" ); #else return QString( "/tmp/copysyncab.vcf" ); #endif } void KABCore::setCaptionBack() { mMessageTimer->stop(); topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); } diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp index 6e560d7..32a3b7c 100644 --- a/kmicromail/viewmail.cpp +++ b/kmicromail/viewmail.cpp @@ -240,33 +240,37 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int { encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); if (content) { QFile output(str); output.open(IO_WriteOnly); output.writeBlock(content->Content(),content->Length()); output.close(); delete content; } } } break ; case 2: { +#ifdef DESKTOP_VERSION + QString tmpfile = locateLocal( "tmp", "opiemail-image"); +#else QString tmpfile = "/tmp/opiemail-image"; +#endif encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); if (content) { QFile output(tmpfile); output.open(IO_WriteOnly); output.writeBlock(content->Content(),content->Length()); output.close(); delete content; MailImageDlg iview(""); iview.setName(tmpfile); KApplication::execDialog(&iview); output.remove(); } } break; case 1: if ( ( ( AttachItem* )item )->Partnumber() == -1 ) diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 290c0b9..884c61a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2290,34 +2290,37 @@ void CalendarView::beamIncidence(Incidence * Inc) void CalendarView::beamCalendar() { QPtrList<Incidence> delSel = mCalendar->rawIncidences(); //qDebug("beamCalendar() "); beamIncidenceList( delSel ); } void CalendarView::beamFilteredCalendar() { QPtrList<Incidence> delSel = mCalendar->incidences(); //qDebug("beamFilteredCalendar() "); beamIncidenceList( delSel ); } void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) { if ( beamDialog->exec () == QDialog::Rejected ) return; - +#ifdef DESKTOP_VERSION + QString fn = locateLocal( "tmp", "kopibeamfile" ); +#else QString fn = "/tmp/kopibeamfile"; +#endif QString mes; bool createbup = true; if ( createbup ) { QString description = "\n"; CalendarLocal* cal = new CalendarLocal(); if ( beamDialog->beamLocal() ) cal->setLocalTime(); else cal->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); Incidence *incidence = delSel.first(); bool addText = false; if ( delSel.count() < 10 ) addText = true; else { description.sprintf(i18n(" %d items?"),delSel.count() ); } diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 651442b..258f738 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -189,38 +189,32 @@ KOPrefs::KOPrefs() : KPrefs::setCurrentGroup("RemoteSyncing"); // addItemBool("UsePasswd",&mUsePassWd,false); // addItemBool("WriteBackFile",&mWriteBackFile,true); // addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false); // addItemBool("AskForPreferences",&mAskForPreferences,true); // addItemBool("ShowSyncSummary",&mShowSyncSummary,true); addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); addItemBool("ShowSyncEvents",&mShowSyncEvents,false); addItemInt("LastSyncTime",&mLastSyncTime,0); #ifdef _WIN32_ QString hdp= locateLocal("data","korganizer")+"\\\\"; #else QString hdp= locateLocal("data","korganizer")+"/"; #endif -// addItemString("RemoteIP",&mRemoteIP, "192.168.0.65"); -// addItemString("RemoteUser",&mRemoteUser, "zaurus"); -// addItemString("RemotePassWd",&mRemotePassWd, ""); -// addItemString("RemoteFile", &mRemoteFile, hdp+"mycalendar.ics"); -// addItemString("LocalTempFile",&mLocalTempFile, "/tmp/tempsyncfile.ics" ); - KPrefs::setCurrentGroup("LoadSaveFileNames"); addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); KPrefs::setCurrentGroup("Locale"); addItemInt("PreferredLanguage",&mPreferredLanguage,0); addItemInt("PreferredTime",&mPreferredTime,0); addItemInt("PreferredDate",&mPreferredDate,0); addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); addItemBool("ShortDateInViewer",&mShortDateInViewer,false); addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 06470b8..c3e9f75 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1201,36 +1201,36 @@ void MainWindow::aboutKnownBugs() i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), QMessageBox::NoIcon, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); msg->exec(); delete msg; } QString MainWindow::defaultFileName() { return locateLocal( "data", "korganizer/mycalendar.ics" ); } QString MainWindow::syncFileName() { -#ifdef _WIN32_ +#ifdef DESKTOP_VERSION return locateLocal( "tmp", "synccalendar.ics" ); #else - return QString( "/tmp/kopitempfile.ics" ); + return QString( "/tmp/synccalendar.ics" ); #endif } void MainWindow::processIncidenceSelection( Incidence *incidence ) { if ( !incidence ) { enableIncidenceActions( false ); mNewSubTodoAction->setEnabled( false ); setCaptionToDates(); return; } //KGlobal::locale()->formatDateTime(nextA, true); QString startString = ""; diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 101db57..900fc04 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp @@ -277,33 +277,33 @@ ulong PhoneFormat::getCsum( const QStringList & attList) } } //QString dump = attList.join(","); //qDebug("csum: %d %s", cSum,dump.latin1()); return cSum; } //extern "C" GSM_Error GSM_InitConnection(GSM_StateMachine *s, int ReplyNum); #include <stdlib.h> #define DEBUGMODE false bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) { QString fileName; -#ifdef _WIN32_ +#ifdef DESKTOP_VERSION fileName = locateLocal("tmp", "phonefile.vcs"); #else fileName = "/tmp/phonefile.vcs"; #endif QString command; if ( ! PhoneAccess::readFromPhone( fileName )) { return false; } VCalFormat vfload; vfload.setLocalTime ( true ); qDebug("loading file ..."); if ( ! vfload.load( calendar, fileName ) ) return false; QPtrList<Event> er = calendar->rawEvents(); Event* ev = er.first(); @@ -464,33 +464,33 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from ) else to->setPriority(from->priority()); } #include <qcstring.h> void PhoneFormat::afterSave( Incidence* inc,const QString& id ,const QString& csum) { inc->setID( mProfileName, id ); inc->setCsum( mProfileName, csum); inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); } bool PhoneFormat::writeToPhone( Calendar * calendar) { -#ifdef _WIN32_ +#ifdef DESKTOP_VERSION QString fileName = locateLocal("tmp", "phonefile.vcs"); #else QString fileName = "/tmp/phonefile.vcs"; #endif VCalFormat vfsave; vfsave.setLocalTime ( true ); QString id = calendar->timeZoneId(); calendar->setLocalTime(); if ( ! vfsave.save( calendar, fileName ) ) return false; calendar->setTimeZoneId( id ); return PhoneAccess::writeToPhone( fileName ); } bool PhoneFormat::save( Calendar *calendar) { @@ -1 +1 @@ -version = "1.9.8"; +version = "1.9.9"; |