Diffstat (limited to 'noncore/settings/tabmanager/tablistview.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/tabmanager/tablistview.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/noncore/settings/tabmanager/tablistview.h b/noncore/settings/tabmanager/tablistview.h index 97f9dec..dfd88f7 100644 --- a/noncore/settings/tabmanager/tablistview.h +++ b/noncore/settings/tabmanager/tablistview.h | |||
@@ -2,43 +2,43 @@ | |||
2 | #define TABLISTVIEW_H | 2 | #define TABLISTVIEW_H |
3 | 3 | ||
4 | #include <qlistview.h> | 4 | #include <qlistview.h> |
5 | #include <qcursor.h> | 5 | #include <qcursor.h> |
6 | #include <qapplication.h> | 6 | #include <qapplication.h> |
7 | 7 | ||
8 | class TabListView : public QListView { | 8 | class TabListView : public QListView { |
9 | Q_OBJECT | 9 | Q_OBJECT |
10 | 10 | ||
11 | signals: | 11 | signals: |
12 | void moveItem(QListViewItem *item, QListViewItem *newFolder); | 12 | void moveItem(QListViewItem *item, QListViewItem *newFolder); |
13 | 13 | ||
14 | public: | 14 | public: |
15 | TabListView( QWidget* parent = 0, const char* name = 0) : QListView(parent, name){ currentSelectedItem = NULL; | 15 | TabListView( QWidget* parent = 0, const char* name = 0) : QListView(parent, name){ currentSelectedItem = NULL; |
16 | connect(this, SIGNAL(pressed ( QListViewItem *)), this, SLOT(itemPressed(QListViewItem *))); | 16 | connect(this, SIGNAL(pressed ( QListViewItem *)), this, SLOT(itemPressed(QListViewItem *))); |
17 | internalCursor.setShape(0); | 17 | internalCursor.setShape(0); |
18 | }; | 18 | }; |
19 | 19 | ||
20 | protected: | 20 | protected: |
21 | void contentsMouseReleaseEvent(QMouseEvent* ){ | 21 | void contentsMouseReleaseEvent(QMouseEvent* ){ |
22 | QListViewItem *newGroup = this->currentItem(); | 22 | QListViewItem *newGroup = this->currentItem(); |
23 | // Make sure they are both real. | 23 | // Make sure they are both real. |
24 | if (currentSelectedItem == NULL || newGroup == NULL) | 24 | if (currentSelectedItem == NULL || newGroup == NULL) |
25 | return; | 25 | return; |
26 | // Make sure they are not the same | 26 | // Make sure they are not the same |
27 | if(this->isSelected(currentSelectedItem) == true) | 27 | if(this->isSelected(currentSelectedItem) == true) |
28 | return; | 28 | return; |
29 | 29 | ||
30 | // Ok we have two valid items. | 30 | // Ok we have two valid items. |
31 | if(newGroup->parent()) | 31 | if(newGroup->parent()) |
32 | newGroup = newGroup->parent(); | 32 | newGroup = newGroup->parent(); |
33 | 33 | ||
34 | // Just in case the parent was null | 34 | // Just in case the parent was null |
35 | if(newGroup == NULL) | 35 | if(newGroup == NULL) |
36 | return; | 36 | return; |
37 | 37 | ||
38 | // If the new folder and buddies current parent are the same don't do anything. | 38 | // If the new folder and buddies current parent are the same don't do anything. |
39 | if (newGroup != currentSelectedItem->parent()) | 39 | if (newGroup != currentSelectedItem->parent()) |
40 | moveItem(currentSelectedItem, newGroup); | 40 | moveItem(currentSelectedItem, newGroup); |
41 | currentSelectedItem = NULL; | 41 | currentSelectedItem = NULL; |
42 | qApp->restoreOverrideCursor(); | 42 | qApp->restoreOverrideCursor(); |
43 | }; | 43 | }; |
44 | 44 | ||
@@ -46,20 +46,20 @@ private slots: | |||
46 | void itemPressed(QListViewItem *item){ | 46 | void itemPressed(QListViewItem *item){ |
47 | if(item == NULL || !item->parent()){ | 47 | if(item == NULL || !item->parent()){ |
48 | if(item == NULL) | 48 | if(item == NULL) |
49 | qDebug("Item is NULL"); | 49 | qDebug("Item is NULL"); |
50 | return; | 50 | return; |
51 | } | 51 | } |
52 | 52 | ||
53 | currentSelectedItem = item; | 53 | currentSelectedItem = item; |
54 | internalCursor.setShape(13); | 54 | internalCursor.setShape(13); |
55 | qApp->setOverrideCursor(internalCursor); | 55 | qApp->setOverrideCursor(internalCursor); |
56 | }; | 56 | }; |
57 | 57 | ||
58 | 58 | ||
59 | private: | 59 | private: |
60 | QListViewItem *currentSelectedItem; | 60 | QListViewItem *currentSelectedItem; |
61 | QCursor internalCursor; | 61 | QCursor internalCursor; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | #endif | 64 | #endif |
65 | 65 | ||