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