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()
26 void ImportBase::setDir(const QString &p)
31 void ImportBase::setFile (const QString &p)
36 void ImportBase::setMapCenter(MapCenterObj *mc)
41 bool ImportBase::transform()
46 QString ImportBase::getTransformedFile()
48 return transformedFile;
51 /////////////////////////////////////////////////
52 bool ImportKDEBookmarks::transform()
54 transformedFile=tmpDir.path()+"/bookmarks.xml";
57 p.setInputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml");
58 p.setOutputFile (transformedFile);
59 p.setXSLFile (vymBaseDir.path()+"/styles/kdebookmarks2vym.xsl");
66 /////////////////////////////////////////////////
67 bool ImportMM::transform()
70 if (success==unzipDir (tmpDir, inputFile))
72 cout << "Unzipped "<<inputFile<<" to "<<tmpDir.path()<<endl;
74 // Set short name, too. Search from behind:
75 transformedFile=inputFile;
76 int i=transformedFile.findRev("/");
77 if (i>=0) transformedFile=transformedFile.remove (0,i+1);
78 transformedFile.replace(".mmap",".xml");
79 transformedFile=tmpDir.path()+"/"+transformedFile;
80 cout << " transformedFile="<<transformedFile<<endl;
83 p.setInputFile (tmpDir.path()+"/Document.xml");
84 p.setOutputFile (transformedFile);
85 p.setXSLFile (vymBaseDir.path()+"/styles/mmap2vym.xsl");
88 cout << " xslt done"<<endl;