Logo Search packages:      
Sourcecode: kdar version File versions  Download package

void KDarConfig::newDirectoryFilter (  )  [virtual, slot]

Sets a new directory filter in the directory listview.

Definition at line 1726 of file kdarConfig.cpp.

References makeQStringList().

Referenced by slotEditDirectoryFilter(), and slotNewDirectoryFilter().

{
    if ( m_directoryDlg->listRadioButton->isChecked() )
    {
        QString subDir;
        subDir = m_directoryDlg->directoryListComboBox->currentText();
        if ( !subDir.isEmpty() )
        {
            if ( subDir != i18n( "select all filters from list", "All of the above" ) )
            {
                //Add the filter if it is not already in the list
                QStringList tmpList = makeQStringList( directoryFiltersListView, 1 );
                if ( !tmpList.contains( subDir ) )
                {
                    QString type = m_directoryDlg->directoryListTypeComboBox->currentText();
                    (void) new QListViewItem( directoryFiltersListView, type, subDir );
                }
            }
            else
            {
                QString type = m_directoryDlg->directoryListTypeComboBox->currentText();
                for (int i = 0; i<( m_directoryDlg->directoryListComboBox->count()-1 );++i)
                {
                    //Add the filter if it is not already in the list
                    QStringList tmpList = makeQStringList( directoryFiltersListView, 1 );
                    subDir = m_directoryDlg->directoryListComboBox->text(i);
                    if ( !tmpList.contains( subDir ) )
                    {
                        (void) new QListViewItem(directoryFiltersListView, type, subDir);
                    }
                }
            }
            emit directoryMaskListChanged();
        }
    }
    else
    {
        QString subDir = m_directoryDlg->directoryFilterValueKURLRequester->lineEdit()->text();
        if ( !subDir.isEmpty() )
        {
            //Add the filter if it is not already in the list
            QStringList tmpList = makeQStringList( directoryFiltersListView, 1 );
            if ( !tmpList.contains( subDir ) )
            {
                QString type = m_directoryDlg->directoryFilesystemTypeComboBox->currentText();
                (void) new QListViewItem(directoryFiltersListView, type, subDir);
            }
            emit directoryMaskListChanged();
        }
    }
}


Generated by  Doxygen 1.6.0   Back to index