Changeset View
Changeset View
Standalone View
Standalone View
krusader/DiskUsage/radialMap/widget.h
Show All 38 Lines | |||||
39 | namespace RadialMap | 39 | namespace RadialMap | ||
40 | { | 40 | { | ||
41 | class Segment; | 41 | class Segment; | ||
42 | 42 | | |||
43 | class Map : public QPixmap | 43 | class Map : public QPixmap | ||
44 | { | 44 | { | ||
45 | public: | 45 | public: | ||
46 | Map(); | 46 | Map(); | ||
47 | ~Map(); | 47 | ~Map() override; | ||
48 | 48 | | |||
49 | void make(const Directory *, bool = false); | 49 | void make(const Directory *, bool = false); | ||
50 | bool resize(const QRect&); | 50 | bool resize(const QRect&); | ||
51 | 51 | | |||
52 | bool isNull() const { | 52 | bool isNull() const { | ||
53 | return (m_signature == 0); | 53 | return (m_signature == nullptr); | ||
54 | } | 54 | } | ||
55 | void invalidate(const bool); | 55 | void invalidate(const bool); | ||
56 | 56 | | |||
57 | friend class Builder; | 57 | friend class Builder; | ||
58 | friend class Widget; | 58 | friend class Widget; | ||
59 | 59 | | |||
60 | private: | 60 | private: | ||
61 | void paint(uint = 1); | 61 | void paint(uint = 1); | ||
Show All 12 Lines | |||||
74 | uint MAP_2MARGIN; | 74 | uint MAP_2MARGIN; | ||
75 | }; | 75 | }; | ||
76 | 76 | | |||
77 | class Widget : public QWidget | 77 | class Widget : public QWidget | ||
78 | { | 78 | { | ||
79 | Q_OBJECT | 79 | Q_OBJECT | ||
80 | 80 | | |||
81 | public: | 81 | public: | ||
82 | explicit Widget(QWidget* = 0); | 82 | explicit Widget(QWidget* = nullptr); | ||
83 | 83 | | |||
84 | QString path() const; | 84 | QString path() const; | ||
85 | QUrl url(File const * const = 0) const; | 85 | QUrl url(File const * const = nullptr) const; | ||
86 | 86 | | |||
87 | bool isValid() const { | 87 | bool isValid() const { | ||
88 | return m_tree != 0; | 88 | return m_tree != nullptr; | ||
89 | } | 89 | } | ||
90 | 90 | | |||
91 | friend class Label; //FIXME badness | 91 | friend struct Label; //FIXME badness | ||
92 | 92 | | |||
93 | public slots: | 93 | public slots: | ||
94 | void zoomIn(); | 94 | void zoomIn(); | ||
95 | void zoomOut(); | 95 | void zoomOut(); | ||
96 | void create(const Directory*); | 96 | void create(const Directory*); | ||
97 | void invalidate(const bool = true); | 97 | void invalidate(const bool = true); | ||
98 | void refresh(int); | 98 | void refresh(int); | ||
99 | 99 | | |||
100 | private slots: | 100 | private slots: | ||
101 | void resizeTimeout(); | 101 | void resizeTimeout(); | ||
102 | void sendFakeMouseEvent(); | 102 | void sendFakeMouseEvent(); | ||
103 | void deleteJobFinished(KJob*); | 103 | void deleteJobFinished(KJob*); | ||
104 | void createFromCache(const Directory*); | 104 | void createFromCache(const Directory*); | ||
105 | 105 | | |||
106 | signals: | 106 | signals: | ||
107 | void activated(const QUrl&); | 107 | void activated(const QUrl&); | ||
108 | void invalidated(const QUrl&); | 108 | void invalidated(const QUrl&); | ||
109 | void created(const Directory*); | 109 | void created(const Directory*); | ||
110 | void mouseHover(const QString&); | 110 | void mouseHover(const QString&); | ||
111 | 111 | | |||
112 | protected: | 112 | protected: | ||
113 | virtual void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE; | 113 | void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE; | ||
114 | virtual void resizeEvent(QResizeEvent*) Q_DECL_OVERRIDE; | 114 | void resizeEvent(QResizeEvent*) Q_DECL_OVERRIDE; | ||
115 | virtual void mouseMoveEvent(QMouseEvent*) Q_DECL_OVERRIDE; | 115 | void mouseMoveEvent(QMouseEvent*) Q_DECL_OVERRIDE; | ||
116 | virtual void mousePressEvent(QMouseEvent*) Q_DECL_OVERRIDE; | 116 | void mousePressEvent(QMouseEvent*) Q_DECL_OVERRIDE; | ||
117 | 117 | | |||
118 | protected: | 118 | protected: | ||
119 | const Segment *segmentAt(QPoint&) const; //FIXME const reference for a library others can use | 119 | const Segment *segmentAt(QPoint&) const; //FIXME const reference for a library others can use | ||
120 | const Segment *rootSegment() const { | 120 | const Segment *rootSegment() const { | ||
121 | return m_rootSegment; | 121 | return m_rootSegment; | ||
122 | } ///never == 0 | 122 | } ///never == 0 | ||
123 | const Segment *focusSegment() const { | 123 | const Segment *focusSegment() const { | ||
124 | return m_focus; | 124 | return m_focus; | ||
Show All 16 Lines |