summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp47
1 files changed, 34 insertions, 13 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index d891b07..25891a0 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -451,8 +451,8 @@ void KABCore::setContactSelected( const QString &uid )
mActionMail->setEnabled( selected );
mActionMailVCard->setEnabled( selected );
- if (mActionBeam)
- mActionBeam->setEnabled( selected );
+ //if (mActionBeam)
+ //mActionBeam->setEnabled( selected );
- if (mActionBeam)
+ if (mActionBeamVCard)
mActionBeamVCard->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 );