Пример #1
0
void KFileDetailView::setSorting( TQDir::SortSpec spec )
{
    int col = 0;
    if ( spec & TQDir::Time )
        col = COL_DATE;
    else if ( spec & TQDir::Size )
        col = COL_SIZE;
    else if ( spec & TQDir::Unsorted )
        col = m_sortingCol;
    else
        col = COL_NAME;

    // inversed, because slotSortingChanged will reverse it
    if ( spec & TQDir::Reversed )
        spec = (TQDir::SortSpec) (spec & ~TQDir::Reversed);
    else
        spec = (TQDir::SortSpec) (spec | TQDir::Reversed);

    m_sortingCol = col;
    KFileView::setSorting( (TQDir::SortSpec) spec );


    // don't emit sortingChanged() when called via setSorting()
    m_blockSortingSignal = true; // can't use blockSignals()
    slotSortingChanged( col );
    m_blockSortingSignal = false;
}
Пример #2
0
KCombiView::KCombiView( TQWidget *parent, const char *name)
  : TQSplitter( parent, name),
    KFileView(),
    right(0),
    m_lastViewForNextItem(0),
    m_lastViewForPrevItem(0)
{
    left = new KFileIconView( this, "left" );
    left->setAcceptDrops(false);
    left->viewport()->setAcceptDrops(false);
    left->setGridX( 160 );
    left->KFileView::setViewMode( Directories );
    left->setArrangement( TQIconView::LeftToRight );
    left->setParentView( this );
    left->setAcceptDrops(false);
    left->installEventFilter( this );
    
    connect( sig, TQT_SIGNAL( sortingChanged( TQDir::SortSpec ) ),
             TQT_SLOT( slotSortingChanged( TQDir::SortSpec ) ));
}
Пример #3
0
DolphinView::DolphinView(QWidget *parent,
                         const KURL& url,
                         Mode mode,
                         bool showHiddenFiles) :
    QWidget(parent),
    m_refreshing(false),
    m_showProgress(false),
    m_mode(mode),
    m_iconsView(0),
    m_detailsView(0),
    m_statusBar(0),
    m_iconSize(0),
    m_folderCount(0),
    m_fileCount(0),
    m_filterBar(0)
{
    setFocusPolicy(QWidget::StrongFocus);
    m_topLayout = new QVBoxLayout(this);

    Dolphin& dolphin = Dolphin::mainWin();

    connect(this, SIGNAL(signalModeChanged()),
            &dolphin, SLOT(slotViewModeChanged()));
    connect(this, SIGNAL(signalShowHiddenFilesChanged()),
            &dolphin, SLOT(slotShowHiddenFilesChanged()));
    connect(this, SIGNAL(signalSortingChanged(DolphinView::Sorting)),
            &dolphin, SLOT(slotSortingChanged(DolphinView::Sorting)));
    connect(this, SIGNAL(signalSortOrderChanged(Qt::SortOrder)),
            &dolphin, SLOT(slotSortOrderChanged(Qt::SortOrder)));

    m_urlNavigator = new URLNavigator(url, this);
    connect(m_urlNavigator, SIGNAL(urlChanged(const KURL&)),
            this, SLOT(slotURLChanged(const KURL&)));
    connect(m_urlNavigator, SIGNAL(urlChanged(const KURL&)),
            &dolphin, SLOT(slotURLChanged(const KURL&)));
    connect(m_urlNavigator, SIGNAL(historyChanged()),
            &dolphin, SLOT(slotHistoryChanged()));

    m_statusBar = new DolphinStatusBar(this);

    m_dirLister = new DolphinDirLister();
    m_dirLister->setAutoUpdate(true);
    m_dirLister->setMainWindow(this);
    m_dirLister->setShowingDotFiles(showHiddenFiles);
    connect(m_dirLister, SIGNAL(clear()),
            this, SLOT(slotClear()));
    connect(m_dirLister, SIGNAL(percent(int)),
            this, SLOT(slotPercent(int)));
    connect(m_dirLister, SIGNAL(deleteItem(KFileItem*)),
            this, SLOT(slotDeleteItem(KFileItem*)));
    connect(m_dirLister, SIGNAL(completed()),
            this, SLOT(slotCompleted()));
    connect(m_dirLister, SIGNAL(infoMessage(const QString&)),
            this, SLOT(slotInfoMessage(const QString&)));
    connect(m_dirLister, SIGNAL(errorMessage(const QString&)),
            this, SLOT(slotErrorMessage(const QString&)));
    connect(m_dirLister, SIGNAL(refreshItems (const KFileItemList&)),
            this, SLOT(slotRefreshItems(const KFileItemList&)));
    connect(m_dirLister, SIGNAL(newItems(const KFileItemList&)),
           this, SLOT(slotAddItems(const KFileItemList&)));

    m_iconSize = KIcon::SizeMedium;

    m_topLayout->addWidget(m_urlNavigator);
    createView();

    m_filterBar = new FilterBar(this);
    m_filterBar->hide();
    m_topLayout->addWidget(m_filterBar);
    connect(m_filterBar, SIGNAL(signalFilterChanged(const QString&)),
           this, SLOT(slotChangeNameFilter(const QString&)));

    m_topLayout->addWidget(m_statusBar);
}