imports.cpp
author insilmaril
Thu, 16 Feb 2006 10:54:13 +0000
changeset 208 4b7a2fb8e5e4
parent 205 30c4a6c7ff10
child 215 e211e2fc9d54
permissions -rw-r--r--
copied new logo to _all_ icons
     1 #include <qmessagebox.h>
     2 
     3 #include "imports.h"
     4 #include "file.h"
     5 #include "linkablemapobj.h"
     6 #include "misc.h"
     7 #include "mainwindow.h"
     8 #include "xsltproc.h"
     9 
    10 extern Main *mainWindow;
    11 
    12 ImportBase::ImportBase()
    13 {
    14 	// Create tmpdir
    15 	tmpDir.setPath (makeUniqueDir("/tmp/vym-XXXXXX"));
    16 }
    17 
    18 
    19 ImportBase::~ImportBase()
    20 {
    21 	// Remove tmpdir
    22 	removeDir (tmpDir);
    23 }
    24 
    25 void ImportBase::setDir(const QString &p)
    26 {
    27 	inputDir=p;
    28 }
    29 
    30 void ImportBase::setFile (const QString &p)
    31 {
    32 	inputFile=p;
    33 }
    34 
    35 void ImportBase::setMapCenter(MapCenterObj *mc)
    36 {
    37 	mapCenter=mc;
    38 }
    39 
    40 /////////////////////////////////////////////////
    41 void ImportKDEBookmarks::transform()
    42 {
    43 	transformedFile=tmpDir.path()+"/bookmarks.xml";
    44 
    45 	XSLTProc p;
    46 	p.setInputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml");
    47 	p.setOutputFile (transformedFile);
    48 	p.setXSLFile ("styles/kdebookmarks2vym.xsl");
    49 	p.process();
    50 }
    51 
    52 QString ImportKDEBookmarks::getTransformedFile()
    53 {
    54 	return transformedFile;
    55 }
    56