diff options
Diffstat (limited to 'kmail/filterimporterexporter.cpp')
-rw-r--r-- | kmail/filterimporterexporter.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/kmail/filterimporterexporter.cpp b/kmail/filterimporterexporter.cpp index af77541d1..bfe40170c 100644 --- a/kmail/filterimporterexporter.cpp +++ b/kmail/filterimporterexporter.cpp @@ -39,7 +39,7 @@ #include <kdialogbase.h> #include <klistview.h> -#include <qregexp.h> +#include <tqregexp.h> using namespace KMail; @@ -47,14 +47,14 @@ using namespace KMail; class FilterSelectionDialog : public KDialogBase { public: - FilterSelectionDialog( QWidget * parent = 0 ) + FilterSelectionDialog( TQWidget * parent = 0 ) :KDialogBase( parent, "filterselection", true, i18n("Select Filters"), Ok|Cancel, Ok, true ), wasCancelled( false ) { filtersListView = new KListView( this ); setMainWidget(filtersListView); filtersListView->setSorting( -1 ); - filtersListView->setSelectionMode( QListView::NoSelection ); + filtersListView->setSelectionMode( TQListView::NoSelection ); filtersListView->addColumn( i18n("Filters"), 300 ); filtersListView->setFullWidth( true ); resize( 300, 350 ); @@ -75,26 +75,26 @@ public: return wasCancelled; } - void setFilters( const QValueList<KMFilter*>& filters ) + void setFilters( const TQValueList<KMFilter*>& filters ) { originalFilters = filters; filtersListView->clear(); - QValueListConstIterator<KMFilter*> it = filters.constEnd(); + TQValueListConstIterator<KMFilter*> it = filters.constEnd(); while ( it != filters.constBegin() ) { --it; KMFilter* filter = *it; - QCheckListItem* item = new QCheckListItem( filtersListView, filter->name(), QCheckListItem::CheckBox ); + TQCheckListItem* item = new TQCheckListItem( filtersListView, filter->name(), TQCheckListItem::CheckBox ); item->setOn( true ); } } - QValueList<KMFilter*> selectedFilters() const + TQValueList<KMFilter*> selectedFilters() const { - QValueList<KMFilter*> filters; - QListViewItemIterator it( filtersListView ); + TQValueList<KMFilter*> filters; + TQListViewItemIterator it( filtersListView ); int i = 0; while( it.current() ) { - QCheckListItem* item = static_cast<QCheckListItem*>( it.current() ); + TQCheckListItem* item = static_cast<TQCheckListItem*>( it.current() ); if ( item->isOn() ) filters << originalFilters[i]; ++i; ++it; @@ -103,12 +103,12 @@ public: } private: KListView *filtersListView; - QValueList<KMFilter*> originalFilters; + TQValueList<KMFilter*> originalFilters; bool wasCancelled; }; /* static */ -QValueList<KMFilter*> FilterImporterExporter::readFiltersFromConfig( KConfig* config, bool bPopFilter ) +TQValueList<KMFilter*> FilterImporterExporter::readFiltersFromConfig( KConfig* config, bool bPopFilter ) { KConfigGroupSaver saver(config, "General"); int numFilters = 0; @@ -117,9 +117,9 @@ QValueList<KMFilter*> FilterImporterExporter::readFiltersFromConfig( KConfig* co else numFilters = config->readNumEntry("filters",0); - QValueList<KMFilter*> filters; + TQValueList<KMFilter*> filters; for ( int i=0 ; i < numFilters ; ++i ) { - QString grpName; + TQString grpName; grpName.sprintf("%s #%d", (bPopFilter ? "PopFilter" : "Filter") , i); KConfigGroupSaver saver(config, grpName); KMFilter * filter = new KMFilter(config, bPopFilter); @@ -137,20 +137,20 @@ QValueList<KMFilter*> FilterImporterExporter::readFiltersFromConfig( KConfig* co } /* static */ -void FilterImporterExporter::writeFiltersToConfig( const QValueList<KMFilter*>& filters, KConfig* config, bool bPopFilter ) +void FilterImporterExporter::writeFiltersToConfig( const TQValueList<KMFilter*>& filters, KConfig* config, bool bPopFilter ) { // first, delete all groups: - QStringList filterGroups = - config->groupList().grep( QRegExp( bPopFilter ? "PopFilter #\\d+" : "Filter #\\d+" ) ); - for ( QStringList::Iterator it = filterGroups.begin() ; + TQStringList filterGroups = + config->groupList().grep( TQRegExp( bPopFilter ? "PopFilter #\\d+" : "Filter #\\d+" ) ); + for ( TQStringList::Iterator it = filterGroups.begin() ; it != filterGroups.end() ; ++it ) config->deleteGroup( *it ); int i = 0; - for ( QValueListConstIterator<KMFilter*> it = filters.constBegin() ; + for ( TQValueListConstIterator<KMFilter*> it = filters.constBegin() ; it != filters.constEnd() ; ++it ) { if ( !(*it)->isEmpty() ) { - QString grpName; + TQString grpName; if ( bPopFilter ) grpName.sprintf("PopFilter #%d", i); else @@ -168,7 +168,7 @@ void FilterImporterExporter::writeFiltersToConfig( const QValueList<KMFilter*>& } -FilterImporterExporter::FilterImporterExporter( QWidget* parent, bool popFilter ) +FilterImporterExporter::FilterImporterExporter( TQWidget* parent, bool popFilter ) :mParent( parent), mPopFilter( popFilter ) { } @@ -177,31 +177,31 @@ FilterImporterExporter::~FilterImporterExporter() { } -QValueList<KMFilter*> FilterImporterExporter::importFilters() +TQValueList<KMFilter*> FilterImporterExporter::importFilters() { - QString fileName = KFileDialog::getOpenFileName( QDir::homeDirPath(), QString::null, mParent, i18n("Import Filters") ); + TQString fileName = KFileDialog::getOpenFileName( TQDir::homeDirPath(), TQString::null, mParent, i18n("Import Filters") ); if ( fileName.isEmpty() ) - return QValueList<KMFilter*>(); // cancel + return TQValueList<KMFilter*>(); // cancel { // scoping - QFile f( fileName ); + TQFile f( fileName ); if ( !f.open( IO_ReadOnly ) ) { KMessageBox::error( mParent, i18n("The selected file is not readable. Your file access permissions might be insufficient.") ); - return QValueList<KMFilter*>(); + return TQValueList<KMFilter*>(); } } KConfig config( fileName ); - QValueList<KMFilter*> imported = readFiltersFromConfig( &config, mPopFilter ); + TQValueList<KMFilter*> imported = readFiltersFromConfig( &config, mPopFilter ); FilterSelectionDialog dlg( mParent ); dlg.setFilters( imported ); dlg.exec(); - return dlg.cancelled() ? QValueList<KMFilter*>() : dlg.selectedFilters(); + return dlg.cancelled() ? TQValueList<KMFilter*>() : dlg.selectedFilters(); } -void FilterImporterExporter::exportFilters(const QValueList<KMFilter*> & filters ) +void FilterImporterExporter::exportFilters(const TQValueList<KMFilter*> & filters ) { - KURL saveUrl = KFileDialog::getSaveURL( QDir::homeDirPath(), QString::null, mParent, i18n("Export Filters") ); + KURL saveUrl = KFileDialog::getSaveURL( TQDir::homeDirPath(), TQString::null, mParent, i18n("Export Filters") ); if ( saveUrl.isEmpty() || !Util::checkOverwrite( saveUrl, mParent ) ) return; |