Changeset View
Changeset View
Standalone View
Standalone View
src/cantor.h
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | 86 | private Q_SLOTS: | |||
---|---|---|---|---|---|
101 | void updatePanel(); | 101 | void updatePanel(); | ||
102 | private: | 102 | private: | ||
103 | void setupActions(); | 103 | void setupActions(); | ||
104 | void closeEvent(QCloseEvent*) Q_DECL_OVERRIDE; | 104 | void closeEvent(QCloseEvent*) Q_DECL_OVERRIDE; | ||
105 | bool reallyClose(bool checkAllParts = true); | 105 | bool reallyClose(bool checkAllParts = true); | ||
106 | KParts::ReadWritePart* findPart(QWidget* widget); | 106 | KParts::ReadWritePart* findPart(QWidget* widget); | ||
107 | 107 | | |||
108 | private: | 108 | private: | ||
109 | QMap<KParts::ReadWritePart*, QStringList> m_pluginsVisibility; | ||||
asemke: why not to use a more simpler container QMap<KParts::ReadWritePart*, QStringList> and to store… | |||||
When we disable all panels, names list will be empty. sirgienko: When we disable all panels, names list will be empty.
When we create new worksheet names list… | |||||
When we create a new worksheet, there is not pointer/key for the Part in the map available yet. In this case we show all panels (default behaviour). For existing worksheets where the user closed all panels there will be a key in the map pointing to an empty QStringList. asemke: When we create a new worksheet, there is not pointer/key for the Part in the map available yet. | |||||
109 | QList<KParts::ReadWritePart *> m_parts; | 110 | QList<KParts::ReadWritePart *> m_parts; | ||
110 | KParts::ReadWritePart* m_part; | 111 | KParts::ReadWritePart* m_part; | ||
111 | QTabWidget* m_tabWidget; | 112 | QTabWidget* m_tabWidget; | ||
112 | QList<QDockWidget*> m_panels; | 113 | QList<QDockWidget*> m_panels; | ||
113 | QDockWidget* m_helpDocker; | 114 | QDockWidget* m_helpDocker; | ||
114 | }; | 115 | }; | ||
115 | 116 | | |||
116 | #endif // CANTOR_H | 117 | #endif // CANTOR_H |
why not to use a more simpler container QMap<KParts::ReadWritePart*, QStringList> and to store the names of the visible panels only? We don't need to track the invisible panels explicitly. If the name is not in the list, the panel is invisible.