~ubuntu-branches/ubuntu/trusty/krusader/trusty

« back to all changes in this revision

Viewing changes to krusader/Panel/krvfsmodel.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-08-08 13:47:36 UTC
  • mfrom: (1.2.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20110808134736-8e630ivgd2c3sgg5
Tags: 1:2.4.0~beta1-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <QFont>
25
25
 
26
26
#include "krinterview.h"
 
27
#include "krsort.h"
 
28
 
27
29
 
28
30
class vfile;
29
31
class KrViewProperties;
59
61
        sort(lastSortOrder(), lastSortDir());
60
62
    }
61
63
    void clear();
 
64
    QList<vfile*> vfiles() {
 
65
        return _vfiles;
 
66
    }
62
67
    vfile * vfileAt(const QModelIndex &index);
63
68
    vfile *dummyVfile() const {
64
69
        return _dummyVfile;
65
70
    }
66
71
    const QModelIndex & vfileIndex(const vfile *);
67
72
    const QModelIndex & nameIndex(const QString &);
 
73
    const QModelIndex & indexFromUrl(const KUrl &url);
68
74
    virtual Qt::ItemFlags flags(const QModelIndex & index) const;
69
75
    void emitChanged() {
70
76
        emit layoutChanged();
71
77
    }
72
 
    Qt::SortOrder lastSortDir() {
 
78
    Qt::SortOrder lastSortDir() const {
73
79
        return (properties()->sortOptions & KrViewProperties::Descending) ? Qt::DescendingOrder : Qt::AscendingOrder;
74
80
    }
75
 
    int lastSortOrder() {
 
81
    int lastSortOrder() const {
76
82
        return properties()->sortColumn;
77
83
    }
78
84
    void setAlternatingTable(bool altTable) {
83
89
    virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
84
90
 
85
91
protected:
 
92
    virtual KrSort::LessThanFunc lessThanFunc() const {
 
93
        return KrSort::itemLessThan;
 
94
    }
 
95
    virtual KrSort::LessThanFunc greaterThanFunc() const {
 
96
        return KrSort::itemGreaterThan;
 
97
    }
 
98
    virtual QVariant customSortData(vfile *vf) const {
 
99
        return QVariant();
 
100
    }
 
101
    KrSort::Sorter createSorter();
86
102
    QString nameWithoutExtension(const vfile * vf, bool checkEnabled = true) const;
87
103
 
88
104
 
89
105
    QList<vfile*>               _vfiles;
90
106
    QHash<vfile *, QModelIndex> _vfileNdx;
 
107
    //TODO: use url index instead of name index
91
108
    QHash<QString, QModelIndex> _nameNdx;
92
109
    bool                        _extensionEnabled;
93
110
    KrInterView                 * _view;