1.1 --- a/exportoofiledialog.cpp Wed Jul 05 10:29:54 2006 +0000
1.2 +++ b/exportoofiledialog.cpp Thu Jul 06 14:47:01 2006 +0000
1.3 @@ -2,12 +2,12 @@
1.4
1.5 #include "exportoofiledialog.h"
1.6
1.7 -ExportOOFileDialog::ExportOOFileDialog():Q3FileDialog()
1.8 +ExportOOFileDialog::ExportOOFileDialog():QFileDialog()
1.9 {
1.10 init();
1.11 }
1.12
1.13 -ExportOOFileDialog::ExportOOFileDialog (QWidget * parent, const char* name, bool modal):Q3FileDialog(parent, name,modal)
1.14 +ExportOOFileDialog::ExportOOFileDialog (QWidget * parent, const QString &caption ):QFileDialog(parent, caption)
1.15 {
1.16 init();
1.17 }
1.18 @@ -18,7 +18,7 @@
1.19 QStringList::Iterator itf=filters.begin();
1.20 while (itf != filters.end())
1.21 {
1.22 - if (*itf==lastFilter) return *itpath;
1.23 + if (*itf==selectedFilter()) return *itpath;
1.24 itpath++;
1.25 itf++;
1.26 }
1.27 @@ -33,31 +33,36 @@
1.28
1.29 QString ExportOOFileDialog::selectedFile()
1.30 {
1.31 - return Q3FileDialog::selectedFile();
1.32 + return QFileDialog::selectedFile();
1.33 }
1.34
1.35
1.36 +void ExportOOFileDialog::show()
1.37 +{
1.38 + setFilters (filters);
1.39 + QFileDialog::show();
1.40 +}
1.41 +
1.42 +void ExportOOFileDialog::init()
1.43 +{
1.44 + setMode( QFileDialog::AnyFile );
1.45 + QDir d;
1.46 + d.setPath ("/usr/share/vym/exports");
1.47 + scanExportConfigs(d);
1.48 + d.setPath (d.homeDirPath()+"/.vym/exports");
1.49 + scanExportConfigs(d);
1.50 + d.setPath (d.currentPath()+"/exports");
1.51 + scanExportConfigs(d);
1.52 +
1.53 + connect (
1.54 + this,SIGNAL (filterSelected(const QString&)),
1.55 + this, SLOT( newConfigPath(const QString &)));
1.56 +}
1.57 +
1.58 void ExportOOFileDialog::addFilter(const QString &f)
1.59 {
1.60 lastFilter=f;
1.61 filters.append (f);
1.62 - Q3FileDialog::addFilter (f);
1.63 -}
1.64 -
1.65 -void ExportOOFileDialog::init()
1.66 -{
1.67 - setMode( Q3FileDialog::AnyFile );
1.68 - QDir d;
1.69 - d.setPath ("/usr/share/vym/exports");
1.70 - scanExportConfigs(d);
1.71 - d.setPath (d.homeDirPath()+"/.vym/exports");
1.72 - scanExportConfigs(d);
1.73 - d.setPath ("exports");
1.74 - scanExportConfigs(d);
1.75 -
1.76 - connect (
1.77 - this,SIGNAL (filterSelected(const QString&)),
1.78 - this, SLOT( newConfigPath(const QString &)));
1.79 }
1.80
1.81 void ExportOOFileDialog::scanExportConfigs(QDir dir)
1.82 @@ -68,7 +73,6 @@
1.83 if (dir.exists())
1.84 {
1.85 // Traverse files
1.86 - QDir dir;
1.87 dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
1.88
1.89 QFileInfoList list = dir.entryInfoList();