- BufferWidget behaves now like a view
[quassel.git] / src / qtui / mainwin.cpp
index 7e7d61a..56f7d7e 100644 (file)
@@ -128,10 +128,8 @@ void MainWin::init() {
 
 
   // attach the BufferWidget to the PropertyMapper
-  Client::bufferModel()->mapProperty(0, NetworkModel::BufferIdRole, ui.bufferWidget, "currentBuffer");
-  Client::bufferModel()->mapProperty(0, NetworkModel::NetworkIdRole, ui.bufferWidget, "currentNetwork");
-  connect(Client::networkModel(), SIGNAL(bufferAboutToBeRemoved(BufferId)),
-          ui.bufferWidget, SLOT(removeBuffer(BufferId)));
+  ui.bufferWidget->setModel(Client::bufferModel());
+  ui.bufferWidget->setSelectionModel(Client::bufferModel()->standardSelectionModel());
 
   // attach the NickList to the PropertyMapper
   Client::bufferModel()->mapProperty(0, NetworkModel::BufferIdRole, nickListWidget, "currentBuffer");
@@ -275,7 +273,6 @@ void MainWin::showDebugConsole() {
 void MainWin::closeEvent(QCloseEvent *event)
 {
   //if (userReallyWantsToQuit()) {
-    ui.bufferWidget->saveState();
     UiSettings s;
     s.setValue("MainWinSize", size());
     s.setValue("MainWinPos", pos());