QList<DolphinColumnWidget*>::iterator start = m_columns.begin() + columnIndex;
QList<DolphinColumnWidget*>::iterator end = m_columns.end();
for (QList<DolphinColumnWidget*>::iterator it = start; it != end; ++it) {
- (*it)->deleteLater();
+ deleteColumn(*it);
}
m_columns.erase(start, end);
QList<DolphinColumnWidget*>::iterator start = m_columns.begin() + 1;
QList<DolphinColumnWidget*>::iterator end = m_columns.end();
for (QList<DolphinColumnWidget*>::iterator it = start; it != end; ++it) {
- (*it)->deleteLater();
+ deleteColumn(*it);
}
m_columns.erase(start, end);
m_index = 0;
return QPoint(point.x() - topLeft.x(), point.y() - topLeft.y());
}
+void DolphinColumnView::deleteColumn(DolphinColumnWidget* column)
+{
+ if (column != 0) {
+ if (m_controller->itemView() == column) {
+ m_controller->setItemView(0);
+ }
+ column->disconnect();
+ column->deleteLater();
+ }
+}
+
#include "dolphincolumnview.moc"
*/
QPoint columnPosition(DolphinColumnWidget* column, const QPoint& point) const;
+ /**
+ * Deletes the column. If the itemview of the controller is set to the column,
+ * the controllers itemview is set to 0.
+ */
+ void deleteColumn(DolphinColumnWidget* column);
+
private:
DolphinController* m_controller;
bool m_active;
m_itemView = view;
- // TODO: this is a workaround until Qt-issue 176832 has been fixed
- connect(m_itemView, SIGNAL(pressed(const QModelIndex&)),
- this, SLOT(updateOpenTabState()));
+ if (m_itemView != 0) {
+ // TODO: this is a workaround until Qt-issue 176832 has been fixed
+ connect(m_itemView, SIGNAL(pressed(const QModelIndex&)),
+ this, SLOT(updateOpenTabState()));
+ }
}
void DolphinController::triggerUrlChangeRequest(const KUrl& url)