3 #include "exportoofiledialog.h"
5 ExportOOFileDialog::ExportOOFileDialog():Q3FileDialog()
10 ExportOOFileDialog::ExportOOFileDialog (QWidget * parent, const char* name, bool modal):Q3FileDialog(parent, name,modal)
15 QString ExportOOFileDialog::selectedConfig()
17 QStringList::Iterator itpath=configPaths.begin();
18 QStringList::Iterator itf=filters.begin();
19 while (itf != filters.end())
21 if (*itf==lastFilter) return *itpath;
25 qWarning ("ExportOOFileDialog::selectedConfig No filter found!");
29 void ExportOOFileDialog::newConfigPath(const QString &s)
34 QString ExportOOFileDialog::selectedFile()
36 return Q3FileDialog::selectedFile();
40 void ExportOOFileDialog::addFilter(const QString &f)
44 Q3FileDialog::addFilter (f);
47 void ExportOOFileDialog::init()
49 setMode( Q3FileDialog::AnyFile );
51 d.setPath ("/usr/share/vym/exports");
53 d.setPath (d.homeDirPath()+"/.vym/exports");
55 d.setPath ("exports");
59 this,SIGNAL (filterSelected(const QString&)),
60 this, SLOT( newConfigPath(const QString &)));
63 void ExportOOFileDialog::scanExportConfigs(QDir dir)
65 // Scan existing export configurations
72 dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
74 QFileInfoList list = dir.entryInfoList();
75 for (int i = 0; i < list.size(); ++i) {
76 QFileInfo fi = list.at(i);
78 if (fi.fileName().endsWith(".conf") )
80 configPaths.append (fi.absFilePath());
82 set.readSettings (fi.absFilePath());
83 addFilter (set.readEntry("Name") + " (*.odp)");