Changeset View
Changeset View
Standalone View
Standalone View
src/dolphintabwidget.h
Show All 16 Lines | |||||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | ||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ | ||
19 | 19 | | |||
20 | #ifndef DOLPHIN_TAB_WIDGET_H | 20 | #ifndef DOLPHIN_TAB_WIDGET_H | ||
21 | #define DOLPHIN_TAB_WIDGET_H | 21 | #define DOLPHIN_TAB_WIDGET_H | ||
22 | 22 | | |||
23 | #include <QTabWidget> | 23 | #include <QTabWidget> | ||
24 | #include <QUrl> | 24 | #include <QUrl> | ||
25 | #include <QMap> | ||||
25 | 26 | | |||
26 | class DolphinViewContainer; | 27 | class DolphinViewContainer; | ||
27 | class DolphinTabPage; | 28 | class DolphinTabPage; | ||
28 | class KConfigGroup; | 29 | class KConfigGroup; | ||
29 | 30 | | |||
30 | class DolphinTabWidget : public QTabWidget | 31 | class DolphinTabWidget : public QTabWidget | ||
31 | { | 32 | { | ||
32 | Q_OBJECT | 33 | Q_OBJECT | ||
▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Line(s) | 107 | public slots: | |||
167 | */ | 168 | */ | ||
168 | void slotPlacesPanelVisibilityChanged(bool visible); | 169 | void slotPlacesPanelVisibilityChanged(bool visible); | ||
169 | 170 | | |||
170 | /** | 171 | /** | ||
171 | * Is called when the user wants to reopen a previously closed tab from | 172 | * Is called when the user wants to reopen a previously closed tab from | ||
172 | * the recent tabs menu. | 173 | * the recent tabs menu. | ||
173 | */ | 174 | */ | ||
174 | void restoreClosedTab(const QByteArray& state); | 175 | void restoreClosedTab(const QByteArray& state); | ||
175 | 176 | | |||
ngraham: Unnecessary whitespace change | |||||
176 | private slots: | 177 | private slots: | ||
177 | /** | 178 | /** | ||
178 | * Opens the tab with the index \a index in a new Dolphin instance and closes | 179 | * Opens the tab with the index \a index in a new Dolphin instance and closes | ||
179 | * this tab. | 180 | * this tab. | ||
180 | */ | 181 | */ | ||
181 | void detachTab(int index); | 182 | void detachTab(int index); | ||
182 | 183 | | |||
183 | /** | 184 | /** | ||
Show All 11 Lines | |||||
195 | /** | 196 | /** | ||
196 | * The active view url of a tab has been changed so update the text and the | 197 | * The active view url of a tab has been changed so update the text and the | ||
197 | * icon of the corresponding tab. | 198 | * icon of the corresponding tab. | ||
198 | */ | 199 | */ | ||
199 | void tabUrlChanged(const QUrl& url); | 200 | void tabUrlChanged(const QUrl& url); | ||
200 | 201 | | |||
201 | void currentTabChanged(int index); | 202 | void currentTabChanged(int index); | ||
202 | 203 | | |||
204 | /** | ||||
205 | * Call to rename tab at index \a index to name \a name. | ||||
206 | * Tab is stored in map as its uuid. | ||||
207 | */ | ||||
208 | void renameTab(int index, const QString& name); | ||||
209 | | ||||
203 | protected: | 210 | protected: | ||
204 | void tabInserted(int index) override; | 211 | void tabInserted(int index) override; | ||
205 | void tabRemoved(int index) override; | 212 | void tabRemoved(int index) override; | ||
206 | 213 | | |||
207 | private: | 214 | private: | ||
208 | /** | 215 | /** | ||
209 | * @param tabPage The tab page to get the name of | 216 | * @param tabPage The tab page to get the name of | ||
210 | * @return The name of the tab page | 217 | * @return The name of the tab page | ||
211 | */ | 218 | */ | ||
212 | QString tabName(DolphinTabPage* tabPage) const; | 219 | QString tabName(DolphinTabPage* tabPage) const; | ||
213 | 220 | | |||
214 | private: | 221 | private: | ||
215 | /** Caches the (negated) places panel visibility */ | 222 | /** Caches the (negated) places panel visibility */ | ||
216 | bool m_placesSelectorVisible; | 223 | bool m_placesSelectorVisible; | ||
217 | 224 | | |||
218 | int m_lastViewedTab; | 225 | int m_lastViewedTab; | ||
226 | QMap<QUuid, QString> m_tabNames; | ||||
Why is this information stored here and not in the individual Tab Pages? If a Tab Page knew it's own name, you wouldn't need the UUID stuff so it could simplify the code quite a bit. hallas: Why is this information stored here and not in the individual Tab Pages? If a Tab Page knew… | |||||
219 | }; | 227 | }; | ||
220 | 228 | | |||
221 | #endif | 229 | #endif |
Unnecessary whitespace change