-rw-r--r-- | kaddressbook/kabcore.cpp | 57 |
1 files changed, 9 insertions, 48 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 2e408b7..11eeabc 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -707,9 +707,9 @@ void KABCore::export2phone() | |||
707 | 707 | ||
708 | } | 708 | } |
709 | QString KABCore::getPhoneFile() | 709 | QString KABCore::getPhoneFile() |
710 | { | 710 | { |
711 | #ifdef _WIN32_ | 711 | #ifdef DESKTOP_VERSION |
712 | return locateLocal("tmp", "phonefile.vcf"); | 712 | return locateLocal("tmp", "phonefile.vcf"); |
713 | #else | 713 | #else |
714 | return "/tmp/phonefile.vcf"; | 714 | return "/tmp/phonefile.vcf"; |
715 | #endif | 715 | #endif |
@@ -731,57 +731,18 @@ void KABCore::beamVCard() | |||
731 | 731 | ||
732 | 732 | ||
733 | void KABCore::beamVCard(const QStringList& uids) | 733 | void KABCore::beamVCard(const QStringList& uids) |
734 | { | 734 | { |
735 | /*US | ||
736 | QString beamFilename; | ||
737 | Opie::OPimContact c; | ||
738 | if ( actionPersonal->isOn() ) { | ||
739 | beamFilename = addressbookPersonalVCardName(); | ||
740 | if ( !QFile::exists( beamFilename ) ) | ||
741 | return; // can't beam a non-existent file | ||
742 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, | ||
743 | beamFilename ); | ||
744 | Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); | ||
745 | Opie::OPimContactAccess::List allList = access->allRecords(); | ||
746 | Opie::OPimContactAccess::List::Iterator it = allList.begin(); // Just take first | ||
747 | c = *it; | ||
748 | |||
749 | delete access; | ||
750 | } else { | ||
751 | unlink( beamfile ); // delete if exists | ||
752 | mkdir("/tmp/obex/", 0755); | ||
753 | c = m_abView -> currentEntry(); | ||
754 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, | ||
755 | beamfile ); | ||
756 | Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); | ||
757 | access->add( c ); | ||
758 | access->save(); | ||
759 | delete access; | ||
760 | |||
761 | beamFilename = beamfile; | ||
762 | } | ||
763 | |||
764 | owarn << "Beaming: " << beamFilename << oendl; | ||
765 | */ | ||
766 | |||
767 | #if 0 | ||
768 | QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); | ||
769 | |||
770 | QString dirName = tmpdir + "/" + KApplication::randomString( 8 ); | ||
771 | |||
772 | QString name = "contact.vcf"; | ||
773 | 735 | ||
774 | QString fileName = dirName + "/" + name; | 736 | // LR: we should use the /tmp dir on the Zaurus, |
775 | #endif | 737 | // because: /tmp = RAM, (HOME)/kdepim = flash memory |
776 | // LR: we should use the /tmp dir, because: /tmp = RAM, (HOME)/kdepim = flash memory | 738 | |
777 | // | 739 | #ifdef DESKTOP_VERSION |
740 | QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); | ||
741 | #else | ||
778 | QString fileName = "/tmp/kapibeamfile.vcf"; | 742 | QString fileName = "/tmp/kapibeamfile.vcf"; |
743 | #endif | ||
779 | 744 | ||
780 | |||
781 | //QDir().mkdir( dirName, true ); | ||
782 | |||
783 | |||
784 | KABC::VCardConverter converter; | 745 | KABC::VCardConverter converter; |
785 | QString description; | 746 | QString description; |
786 | QString datastream; | 747 | QString datastream; |
787 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { | 748 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { |
@@ -2861,9 +2822,9 @@ void KABCore::syncFileRequest() | |||
2861 | mAddressBook->export2File( sentSyncFile() ); | 2822 | mAddressBook->export2File( sentSyncFile() ); |
2862 | } | 2823 | } |
2863 | QString KABCore::sentSyncFile() | 2824 | QString KABCore::sentSyncFile() |
2864 | { | 2825 | { |
2865 | #ifdef _WIN32_ | 2826 | #ifdef DESKTOP_VERSION |
2866 | return locateLocal( "tmp", "copysyncab.vcf" ); | 2827 | return locateLocal( "tmp", "copysyncab.vcf" ); |
2867 | #else | 2828 | #else |
2868 | return QString( "/tmp/copysyncab.vcf" ); | 2829 | return QString( "/tmp/copysyncab.vcf" ); |
2869 | #endif | 2830 | #endif |