~ubuntu-branches/ubuntu/karmic/kdepim/karmic-backports

« back to all changes in this revision

Viewing changes to kcontactmanager/xxport/ldap/ldap_xxport.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi, Alessandro Ghersi, Harald Sitter
  • Date: 2009-06-27 04:40:05 UTC
  • mfrom: (1.1.39 upstream)
  • Revision ID: james.westby@ubuntu.com-20090627044005-4y2vm9xz7rvmzi4p
Tags: 4:4.2.95svn20090701-0ubuntu1
[ Alessandro Ghersi ]
* New upstream release
  - Bump build-deps
* Remove akonadi-kde and libmaildir4 packages
  - remove akonadi-kde.install and libmaildir4.install
  - remove libmaildir4 from debian/rules
  - remove akonadi-kde and libmaildir4 from depends
  - remove akonadi-kde and libmaildir4 from installgen
* Update kdepim-dev.install
* Update kpilot.install
* Add akonadi-kde and libmaildir4 transitional packages

[ Harald Sitter ]
* KAddressbook replaces Kontact << 4.2.85 (LP: #378373)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    This file is part of KContactManager.
3
 
    Copyright (c) 2000 - 2009 Oliver Strutynski <olistrut@gmx.de>
4
 
                              Tobias Koenig <tokoe@kde.org>
5
 
                              Sebastian Sauer <sebsauer@kdab.net>
6
 
 
7
 
    This program is free software; you can redistribute it and/or modify
8
 
    it under the terms of the GNU General Public License as published by
9
 
    the Free Software Foundation; either version 2 of the License, or
10
 
    (at your option) any later version.
11
 
 
12
 
    This program is distributed in the hope that it will be useful,
13
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
 
    GNU General Public License for more details.
16
 
 
17
 
    You should have received a copy of the GNU General Public License
18
 
    along with this program; if not, write to the Free Software
19
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
 
 
21
 
    As a special exception, permission is given to link this program
22
 
    with any edition of Qt, and distribute the resulting executable,
23
 
    without including the source code for Qt in the source distribution.
24
 
*/
25
 
 
26
 
#include "ldap_xxport.h"
27
 
#include "ldapsearchdialog.h"
28
 
 
29
 
//#include <QtCore/QFile>
30
 
//#include <QtCore/QTextStream>
31
 
 
32
 
//#include <kabc/ldifconverter.h>
33
 
//#include <kcodecs.h>
34
 
//#include <kfiledialog.h>
35
 
//#include <kio/netaccess.h>
36
 
//#include <klocale.h>
37
 
//#include <kmessagebox.h>
38
 
//#include <ktemporaryfile.h>
39
 
//#include <kurl.h>
40
 
#include <kdebug.h>
41
 
 
42
 
LDAPXXPort::LDAPXXPort( QWidget *parentWidget )
43
 
  : XXPort( parentWidget )
44
 
{
45
 
}
46
 
 
47
 
KABC::Addressee::List LDAPXXPort::importContacts() const
48
 
{
49
 
  KABC::Addressee::List contacts;
50
 
 
51
 
  KABC::AddressBook *ab = 0;
52
 
  KABCore *core = 0;
53
 
  LDAPSearchDialog dlg(ab, core, parentWidget());
54
 
  dlg.exec();
55
 
  contacts = dlg.m_result;
56
 
 
57
 
/*
58
 
  const QString fileName = KFileDialog::getOpenFileName( QDir::homePath(), "text/x-ldif", 0 );
59
 
  if ( fileName.isEmpty() )
60
 
    return contacts;
61
 
 
62
 
  QFile file( fileName );
63
 
  if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
64
 
    const QString msg = i18n( "<qt>Unable to open <b>%1</b> for reading.</qt>", fileName );
65
 
    KMessageBox::error( parentWidget(), msg );
66
 
    return contacts;
67
 
  }
68
 
 
69
 
  QTextStream stream( &file );
70
 
  stream.setCodec( "ISO 8859-1" );
71
 
 
72
 
  const QString wholeFile = stream.readAll();
73
 
  const QDateTime dtDefault = QFileInfo( file ).lastModified();
74
 
  file.close();
75
 
 
76
 
  KABC::LDAPConverter::LDAPToAddressee( wholeFile, contacts, dtDefault );
77
 
*/
78
 
  return contacts;
79
 
}
80
 
 
81
 
bool LDAPXXPort::exportContacts( const KABC::Addressee::List &contacts ) const
82
 
{
83
 
    Q_UNUSED(contacts);
84
 
    return false;
85
 
}