author | zautrix <zautrix> | 2004-08-06 08:39:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-06 08:39:55 (UTC) |
commit | 15edf84bf2bdd1cb00cbdc37d0402b9587c40f21 (patch) (side-by-side diff) | |
tree | f4da393d531292ff6702aed0936f2405bdf20555 | |
parent | 3bf62eb85312197352b7c836239d6d239e9a70cf (diff) | |
download | kdepimpi-15edf84bf2bdd1cb00cbdc37d0402b9587c40f21.zip kdepimpi-15edf84bf2bdd1cb00cbdc37d0402b9587c40f21.tar.gz kdepimpi-15edf84bf2bdd1cb00cbdc37d0402b9587c40f21.tar.bz2 |
Fixed some beaming problems
-rw-r--r-- | kaddressbook/kabcore.cpp | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index d891b07..25891a0 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -451,9 +451,9 @@ void KABCore::setContactSelected( const QString &uid ) mActionMail->setEnabled( selected ); mActionMailVCard->setEnabled( selected ); - if (mActionBeam) - mActionBeam->setEnabled( selected ); + //if (mActionBeam) + //mActionBeam->setEnabled( selected ); - if (mActionBeam) - mActionBeamVCard->setEnabled( selected ); + if (mActionBeamVCard) + mActionBeamVCard->setEnabled( selected ); mActionWhoAmI->setEnabled( selected ); @@ -586,4 +586,8 @@ void KABCore::beamMySelf() beamVCard(uids); + } else { + KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); + + } } @@ -630,4 +634,6 @@ void KABCore::beamVCard(const QStringList& uids) owarn << "Beaming: " << beamFilename << oendl; */ + +#if 0 QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); @@ -637,7 +643,11 @@ void KABCore::beamVCard(const QStringList& uids) QString fileName = dirName + "/" + name; +#endif + // LR: we should use the /tmp dir, because: /tmp = RAM, (HOME)/kdepim = flash memory + // + QString fileName = "/tmp/kdepimbeamfile"; - QDir().mkdir( dirName, true ); + //QDir().mkdir( dirName, true ); QFile outFile(fileName); @@ -664,11 +674,16 @@ void KABCore::beamVCard(const QStringList& uids) } + } else { + qDebug("Error open temp beam file "); + return; } outFile.close(); +#ifndef DESKTOP_VERSION Ir *ir = new Ir( this ); connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); ir->send( fileName, description, "text/x-vCard" ); +#endif } @@ -676,5 +691,7 @@ void KABCore::beamVCard(const QStringList& uids) void KABCore::beamDone( Ir *ir ) { +#ifndef DESKTOP_VERSION delete ir; +#endif } @@ -1491,10 +1508,17 @@ void KABCore::initActions() mActionBeamVCard = 0; + mActionBeam = 0; + +#ifndef DESKTOP_VERSION if ( Ir::supported() ) { - mActionBeamVCard = new KAction( i18n( "Beam v&Card" ), "beam", 0, this, + mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, SLOT( beamVCard() ), actionCollection(), "kaddressbook_beam_vcard" ); + + mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, + SLOT( beamMySelf() ), actionCollection(), + "kaddressbook_beam_myself" ); } - +#endif mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, @@ -1598,10 +1622,5 @@ void KABCore::initActions() "set_personal" ); - mActionBeam = 0; - if ( Ir::supported() ) { - mActionBeam = new KAction( i18n( "&Beam Who Am I" ), "beam", 0, this, - SLOT( beamMySelf() ), actionCollection(), - "kaddressbook_beam_myself" ); - } + @@ -1694,5 +1713,8 @@ void KABCore::addActionsManually() fileMenu->insertSeparator(); mActionMailVCard->plug( fileMenu ); +#ifndef DESKTOP_VERSION if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); + if ( Ir::supported() ) mActionBeam->plug(fileMenu ); +#endif fileMenu->insertSeparator(); mActionQuit->plug( fileMenu ); @@ -1735,5 +1757,4 @@ void KABCore::addActionsManually() mActionWhoAmI->plug( settingsMenu ); - if ( Ir::supported() ) mActionBeam->plug( settingsMenu ); mActionCategories->plug( settingsMenu ); |