1 #include <qmessagebox.h>
5 #include "linkablemapobj.h"
7 #include "mainwindow.h"
10 extern Main *mainWindow;
11 extern QDir vymBaseDir;
13 ImportBase::ImportBase()
16 tmpDir.setPath (makeUniqueDir("/tmp/vym-XXXXXX"));
20 ImportBase::~ImportBase()
23 // FIXME just testing!
27 void ImportBase::setDir(const QString &p)
32 void ImportBase::setFile (const QString &p)
37 void ImportBase::setMapCenter(MapCenterObj *mc)
42 bool ImportBase::transform()
47 QString ImportBase::getTransformedFile()
49 return transformedFile;
52 /////////////////////////////////////////////////
53 bool ImportKDEBookmarks::transform()
55 transformedFile=tmpDir.path()+"/bookmarks.xml";
58 p.setInputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml");
59 p.setOutputFile (transformedFile);
60 p.setXSLFile (vymBaseDir.path()+"/styles/kdebookmarks2vym.xsl");
67 /////////////////////////////////////////////////
68 bool ImportMM::transform()
71 if (success==unzipDir (tmpDir, inputFile))
73 cout << "Unzipped "<<inputFile<<" to "<<tmpDir.path()<<endl;
75 // Set short name, too. Search from behind:
76 transformedFile=inputFile;
77 int i=transformedFile.findRev("/");
78 if (i>=0) transformedFile=transformedFile.remove (0,i+1);
79 transformedFile.replace(".mmap",".xml");
80 transformedFile=tmpDir.path()+"/"+transformedFile;
81 cout << " transformedFile="<<transformedFile<<endl;
84 p.setInputFile (tmpDir.path()+"/Document.xml");
85 p.setOutputFile (transformedFile);
86 p.setXSLFile (vymBaseDir.path()+"/styles/mmap2vym.xsl");
89 cout << " xslt done"<<endl;