19 #include "foldersetselector.h"
21 #include "globalsettings.h"
22 #include "kmfoldertree.h"
23 #include "simplefoldertree.h"
24 #include "kmfoldercachedimap.h"
28 using namespace KMail;
30 FolderSetSelector::FolderSetSelector( KMFolderTree *ft, TQWidget * parent )
31 : KDialogBase( parent,
"FolderSetSelector", true, TQString(),
Ok|Cancel,
Ok, true )
35 mTreeView =
new KMail::SimpleFolderTreeBase<TQCheckListItem>( makeVBoxMainWidget(), ft,
36 GlobalSettings::self()->lastSelectedFolder(),
false );
37 mTreeView->setFocus();
39 TQListViewItemIterator it( mTreeView );
40 while ( it.current() ) {
41 SimpleFolderTreeItem<TQCheckListItem> *item =
dynamic_cast<SimpleFolderTreeItem<TQCheckListItem>*
>( it.current() );
45 if ( !item->folder() ) {
46 item->setEnabled(
false );
49 if ( item->folder()->folderType() == KMFolderTypeCachedImap
50 &&
static_cast<const KMFolderCachedImap*
>( item->folder()->storage() )->imapPath() ==
"/INBOX/" ) {
53 if ( item->folder()->folderType() != KMFolderTypeCachedImap ) {
54 item->setEnabled(
false );
60 TQValueList< int > FolderSetSelector::selectedFolders()
63 TQListViewItemIterator it( mTreeView );
64 while ( it.current() ) {
65 SimpleFolderTreeItem<TQCheckListItem> *item =
dynamic_cast<SimpleFolderTreeItem<TQCheckListItem>*
>( it.current() );
66 if ( item && item->isOn() && item->folder() )
67 rv.append( item->folder()->id() );
73 void FolderSetSelector::setSelectedFolders(
const TQValueList< int > & folderIds)
75 TQListViewItemIterator it( mTreeView );
76 while ( it.current() ) {
77 SimpleFolderTreeItem<TQCheckListItem> *item =
dynamic_cast<SimpleFolderTreeItem<TQCheckListItem>*
>( it.current() );
78 if ( item && item->folder() ) {
79 if ( folderIds.contains( item->folder()->id() ) )
88 #include "foldersetselector.moc"
@ Ok
The user rights/ACL have been fetched from the server sucessfully.