• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kio/bookmarks
 

kio/bookmarks

  • kio
  • bookmarks
kbookmarkimporter.cc
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 <kfiledialog.h>
22 #include <kstringhandler.h>
23 #include <klocale.h>
24 #include <kdebug.h>
25 #include <kcharsets.h>
26 #include <tqtextcodec.h>
27 
28 #include <sys/types.h>
29 #include <stddef.h>
30 #include <dirent.h>
31 #include <sys/stat.h>
32 #include <assert.h>
33 
34 #include "kbookmarkmanager.h"
35 
36 #include "kbookmarkimporter_ns.h"
37 #include "kbookmarkimporter_opera.h"
38 #include "kbookmarkimporter_ie.h"
39 
40 #include "kbookmarkimporter.h"
41 
42 void KXBELBookmarkImporterImpl::parse()
43 {
44  //kdDebug() << "KXBELBookmarkImporterImpl::parse()" << endl;
45  KBookmarkManager *manager = KBookmarkManager::managerForFile(m_fileName);
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  //kdDebug() << "KXBELBookmarkImporterImpl::visit" << endl;
55  if (bk.isSeparator())
56  emit newSeparator();
57  else
58  emit newBookmark(bk.fullText(), bk.url().url().utf8(), "");
59 }
60 
61 void KXBELBookmarkImporterImpl::visitEnter(const KBookmarkGroup &grp)
62 {
63  //kdDebug() << "KXBELBookmarkImporterImpl::visitEnter" << endl;
64  emit newFolder(grp.fullText(), false, "");
65 }
66 
67 void KXBELBookmarkImporterImpl::visitLeave(const KBookmarkGroup &)
68 {
69  //kdDebug() << "KXBELBookmarkImporterImpl::visitLeave" << endl;
70  emit endFolder();
71 }
72 
73 void KBookmarkImporterBase::setupSignalForwards(TQObject *src, TQObject *dst)
74 {
75  connect(src, TQT_SIGNAL( newBookmark( const TQString &, const TQCString &, const TQString & ) ),
76  dst, TQT_SIGNAL( newBookmark( const TQString &, const TQCString &, const TQString & ) ));
77  connect(src, TQT_SIGNAL( newFolder( const TQString &, bool, const TQString & ) ),
78  dst, TQT_SIGNAL( newFolder( const TQString &, bool, const TQString & ) ));
79  connect(src, TQT_SIGNAL( newSeparator() ),
80  dst, TQT_SIGNAL( newSeparator() ) );
81  connect(src, TQT_SIGNAL( endFolder() ),
82  dst, TQT_SIGNAL( endFolder() ) );
83 }
84 
85 KBookmarkImporterBase* KBookmarkImporterBase::factory( const TQString &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>

kio/bookmarks

Skip menu "kio/bookmarks"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kio/bookmarks

Skip menu "kio/bookmarks"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/bookmarks by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |