- if (index.isValid() && (index.column() == DolphinModel::Name)) {
- m_toggle->setFileItem(itemForIndex(index));
+ const bool showToggle = index.isValid() &&
+ (index.column() == DolphinModel::Name) &&
+ (QApplication::mouseButtons() == Qt::NoButton);
+ if (showToggle) {
+ m_toggle->setUrl(urlForIndex(index));
+
+ if (!m_connected) {
+ connect(m_view->model(), SIGNAL(rowsRemoved(const QModelIndex&, int, int)),
+ this, SLOT(slotRowsRemoved(const QModelIndex&, int, int)));
+ connect(m_view->selectionModel(),
+ SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
+ this,
+ SLOT(slotSelectionChanged(const QItemSelection&, const QItemSelection&)));
+ m_connected = true;
+ }