~ubuntu-branches/ubuntu/lucid/ktorrent/lucid

« back to all changes in this revision

Viewing changes to ktorrent/viewmodel.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-12-08 19:17:41 UTC
  • mfrom: (1.2.1 upstream) (0.7.12 sid)
  • Revision ID: james.westby@ubuntu.com-20091208191741-lqlq0xvnlv8ki19u
Tags: 3.3.1+dfsg.1-1ubuntu1
* Merge with Debian Testing remaining changes:
  - Build-depend directly on libboost-serialization1.40-dev since
    libboost-serialization-dev from boost-defaults is not in Main
  - Add in rules: include /usr/lib/kubuntu-desktop-i18n/debhelper/kubuntu.mk
  - Don't use dpkg-source 3.0 format
  - Add quilt to build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
namespace kt
29
29
{
 
30
        class View;
 
31
        class ViewDelegate;
30
32
        class Core;
31
33
        class Group;
32
34
        
39
41
        {
40
42
                Q_OBJECT
41
43
        public:
42
 
                ViewModel(Core* core,QObject* parent);
 
44
                ViewModel(Core* core,View* parent);
43
45
                virtual ~ViewModel();
44
46
                
45
47
                /**
50
52
                
51
53
                /**
52
54
                 * Update the model, checks if data has changed.
 
55
                 $ @param delegate The ViewDelegate, so we don't hide extended items
53
56
                 * @param force_resort Force a resort
54
57
                 * @return true if the model got resorted
55
58
                 */
56
 
                bool update(bool force_resort = false);
 
59
                bool update(ViewDelegate* delegate,bool force_resort = false);
57
60
                
58
61
                /// Is a column a default column for an upload view
59
62
                bool defaultColumnForUpload(int column);
61
64
                /// Is a column a default column for a download view
62
65
                bool defaultColumnForDownload(int column);
63
66
                
64
 
                virtual int rowCount(const QModelIndex & parent) const;
65
 
                virtual int columnCount(const QModelIndex & parent) const;
 
67
                virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
 
68
                virtual int columnCount(const QModelIndex & parent = QModelIndex()) const;
66
69
                virtual QVariant headerData(int section, Qt::Orientation orientation,int role) const;
67
70
                virtual QVariant data(const QModelIndex & index, int role) const;
68
71
                virtual bool removeRows(int row,int count,const QModelIndex & parent);
72
75
                virtual QMimeData* mimeData(const QModelIndexList &indexes) const;
73
76
                virtual bool setData(const QModelIndex & index,const QVariant & value,int role);
74
77
                virtual QModelIndex index(int row,int column,const QModelIndex & parent = QModelIndex()) const;
75
 
                                
 
78
                virtual bool dropMimeData(const QMimeData *data,Qt::DropAction action,int row,int column,const QModelIndex &parent);
 
79
                virtual Qt::DropActions supportedDropActions() const;
76
80
                /**
77
81
                 * Emit the data changed signal
78
82
                 * @param row The row 
174
178
                        
175
179
        private:
176
180
                Core* core;
 
181
                View* view;
177
182
                QList<Item*> torrents;
178
183
                int sort_column;
179
184
                Qt::SortOrder sort_order;