• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.11.5 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • bookmarks
kbookmarkimporter.cc
Go to the documentation of this file.
1 // -*- c-basic-offset:4; indent-tabs-mode:nil -*-
2 // vim: set ts=4 sts=4 sw=4 et:
3 /* This file is part of the KDE libraries
4  Copyright (C) 2003 Alexander Kellett <lypanov@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #include "kbookmarkimporter.h"
22 
23 #include <kfiledialog.h>
24 #include <kstringhandler.h>
25 #include <klocale.h>
26 #include <kdebug.h>
27 #include <kcharsets.h>
28 #include <qtextcodec.h>
29 
30 #include <sys/types.h>
31 #include <stddef.h>
32 #include <dirent.h>
33 #include <sys/stat.h>
34 #include <assert.h>
35 
36 #include "kbookmarkmanager.h"
37 
38 #include "kbookmarkimporter_ns.h"
39 #include "kbookmarkimporter_opera.h"
40 #include "kbookmarkimporter_ie.h"
41 
42 void KXBELBookmarkImporterImpl::parse()
43 {
44  //kDebug() << "KXBELBookmarkImporterImpl::parse()";
45  KBookmarkManager *manager = KBookmarkManager::managerForFile(m_fileName, QString());
46  KBookmarkGroup root = manager->root();
47  traverse(root);
48  // FIXME delete it!
49  // delete manager;
50 }
51 
52 void KXBELBookmarkImporterImpl::visit(const KBookmark &bk)
53 {
54  //kDebug() << "KXBELBookmarkImporterImpl::visit";
55  if (bk.isSeparator())
56  emit newSeparator();
57  else
58  emit newBookmark(bk.fullText(), bk.url().url(), "");
59 }
60 
61 void KXBELBookmarkImporterImpl::visitEnter(const KBookmarkGroup &grp)
62 {
63  //kDebug() << "KXBELBookmarkImporterImpl::visitEnter";
64  emit newFolder(grp.fullText(), false, "");
65 }
66 
67 void KXBELBookmarkImporterImpl::visitLeave(const KBookmarkGroup &)
68 {
69  //kDebug() << "KXBELBookmarkImporterImpl::visitLeave";
70  emit endFolder();
71 }
72 
73 void KBookmarkImporterBase::setupSignalForwards(QObject *src, QObject *dst)
74 {
75  connect(src, SIGNAL( newBookmark( const QString &, const QString &, const QString & ) ),
76  dst, SIGNAL( newBookmark( const QString &, const QString &, const QString & ) ));
77  connect(src, SIGNAL( newFolder( const QString &, bool, const QString & ) ),
78  dst, SIGNAL( newFolder( const QString &, bool, const QString & ) ));
79  connect(src, SIGNAL( newSeparator() ),
80  dst, SIGNAL( newSeparator() ) );
81  connect(src, SIGNAL( endFolder() ),
82  dst, SIGNAL( endFolder() ) );
83 }
84 
85 KBookmarkImporterBase* KBookmarkImporterBase::factory( const QString &type )
86 {
87  if (type == "netscape")
88  return new KNSBookmarkImporterImpl;
89  else if (type == "mozilla")
90  return new KMozillaBookmarkImporterImpl;
91  else if (type == "xbel")
92  return new KXBELBookmarkImporterImpl;
93  else if (type == "ie")
94  return new KIEBookmarkImporterImpl;
95  else if (type == "opera")
96  return new KOperaBookmarkImporterImpl;
97  else
98  return 0;
99 }
100 
101 #include <kbookmarkimporter.moc>
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Mon May 5 2014 18:13:37 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.11.5 API Reference

Skip menu "kdelibs-4.11.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal