Commit 4053ac0c authored by con's avatar con
Browse files

Throw some unused things from "ViewManager" away.

parent aea19425
......@@ -1161,7 +1161,6 @@ void MainWindow::writeSettings()
m_settings->endGroup();
m_fileManager->saveRecentFiles();
m_viewManager->saveSettings(m_settings);
m_actionManager->saveSettings(m_settings);
m_editorManager->saveSettings();
m_navigationWidget->saveSettings(m_settings);
......
......@@ -41,7 +41,7 @@ class CORE_EXPORT StatusBarWidget : public IContext
Q_OBJECT
public:
enum StatusBarPosition { First=0, Second=1, Third=2 };
enum StatusBarPosition { First=0, Second=1, Third=2, Last=Third };
StatusBarWidget(QObject *parent = 0);
~StatusBarWidget();
......
......@@ -51,7 +51,7 @@ ViewManager::ViewManager(MainWindow *mainWnd)
: QObject(mainWnd),
m_mainWnd(mainWnd)
{
for (int i = 0; i < 3; ++i) {
for (int i = 0; i <= StatusBarWidget::Last; ++i) {
QWidget *w = new QWidget();
m_mainWnd->statusBar()->insertPermanentWidget(i, w);
w->setLayout(new QHBoxLayout);
......@@ -59,8 +59,8 @@ ViewManager::ViewManager(MainWindow *mainWnd)
w->layout()->setMargin(0);
m_statusBarWidgets.append(w);
}
QLabel *l = new QLabel();
m_mainWnd->statusBar()->insertPermanentWidget(3, l, 1);
m_mainWnd->statusBar()->insertPermanentWidget(StatusBarWidget::Last+1,
new QLabel(), 1);
}
ViewManager::~ViewManager()
......@@ -85,7 +85,6 @@ void ViewManager::objectAdded(QObject *obj)
viewWidget = view->widget();
m_statusBarWidgets.at(view->position())->layout()->addWidget(viewWidget);
m_viewMap.insert(view, viewWidget);
m_mainWnd->addContextObject(view);
}
......@@ -99,11 +98,4 @@ void ViewManager::aboutToRemoveObject(QObject *obj)
void ViewManager::extensionsInitalized()
{
QSettings *settings = m_mainWnd->settings();
m_mainWnd->restoreState(settings->value(QLatin1String("ViewGroup_Default"), QByteArray()).toByteArray());
}
void ViewManager::saveSettings(QSettings *settings)
{
settings->setValue(QLatin1String("ViewGroup_Default"), m_mainWnd->saveState());
}
......@@ -60,15 +60,12 @@ public:
void init();
void extensionsInitalized();
void saveSettings(QSettings *settings);
private slots:
void objectAdded(QObject *obj);
void aboutToRemoveObject(QObject *obj);
private:
QMap<Core::StatusBarWidget *, QWidget *> m_viewMap;
MainWindow *m_mainWnd;
QList<QWidget *> m_statusBarWidgets;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment