stubs for bookmark exporting to IE format

svn path=/trunk/kdebase/konqueror/keditbookmarks/; revision=229153
This commit is contained in:
Alexander Kellett 2003-06-01 18:36:58 +00:00
parent af0e3069d1
commit 49c42b1a92
5 changed files with 22 additions and 4 deletions

View file

@ -119,12 +119,16 @@ void ActionsImpl::slotImport() {
CmdHistory::self()->addCommand(import);
}
void ActionsImpl::slotExportIE() {
CurrentMgr::self()->doExport(CurrentMgr::IEExport);
}
void ActionsImpl::slotExportNS() {
CurrentMgr::self()->doExport(false);
CurrentMgr::self()->doExport(CurrentMgr::NetscapeExport);
}
void ActionsImpl::slotExportMoz() {
CurrentMgr::self()->doExport(true);
CurrentMgr::self()->doExport(CurrentMgr::MozillaExport);
}
/* -------------------------------------- */

View file

@ -51,6 +51,7 @@ public slots:
void slotExpandAll();
void slotCollapseAll();
void slotImport();
void slotExportIE();
void slotExportNS();
void slotExportMoz();

View file

@ -16,6 +16,7 @@
<Action name="importNS"/>
</Menu>
<Menu name="export" noMerge="1"><text>&amp;Export</text>
<Action name="exportIE"/>
<Action name="exportMoz"/>
<Action name="exportNS"/>
</Menu>
@ -139,6 +140,7 @@
<Action name="file_open"/>
<Action name="file_save_as"/>
<Action name="file_quit"/>
<Action name="exportIE"/>
<Action name="exportNS"/>
<Action name="exportMoz"/>
<Action name="expandall"/>

View file

@ -40,6 +40,7 @@
#include <kbookmarkdrag.h>
#include <kbookmarkmanager.h>
#include <kbookmarkimporter.h>
#include <kbookmarkimporter_ie.h>
#include <kbookmarkexporter.h>
#include "listview.h"
@ -144,7 +145,14 @@ void CurrentMgr::notifyManagers() {
DCOPRef("*", objId).send("notifyCompleteChange", QString::fromLatin1(kapp->dcopClient()->appId()));
}
void CurrentMgr::doExport(bool moz) {
void CurrentMgr::doExport(ExportType type) {
if (type == IEExport) {
QString path = KIEBookmarkImporterImpl().findDefaultLocation(true);
KIEBookmarkExporterImpl exporter(mgr(), path);
exporter.write(mgr()->root());
return;
}
bool moz = (type == MozillaExport);
QString path =
(moz)
? KNSBookmarkImporter::mozillaBookmarksFile(true)
@ -314,6 +322,8 @@ void KEBApp::createActions() {
actn, SLOT( slotImport() ), actionCollection(), "importMoz");
(void) new KAction(i18n("&Export to Netscape Bookmarks"), "netscape", 0,
actn, SLOT( slotExportNS() ), actionCollection(), "exportNS");
(void) new KAction(i18n("&Export to IE Bookmarks"), "ie", 0,
actn, SLOT( slotExportIE() ), actionCollection(), "exportIE");
(void) new KAction(i18n("Export to &Mozilla Bookmarks..."), "mozilla", 0,
actn, SLOT( slotExportMoz() ), actionCollection(), "exportMoz");
}

View file

@ -66,7 +66,8 @@ class CurrentMgr : public QObject {
public:
static CurrentMgr* self() { if (!s_mgr) { s_mgr = new CurrentMgr(); } return s_mgr; }
void createManager(const QString &filename);
void doExport(bool moz);
typedef enum {IEExport, MozillaExport, NetscapeExport} ExportType;
void doExport(ExportType type);
void notifyManagers();
QString correctAddress(const QString &address);
KBookmarkManager* mgr() const { return m_mgr; }