Changeset View
Changeset View
Standalone View
Standalone View
src/views/dolphinview.cpp
Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Line(s) | 170 | connect(m_view, &DolphinItemListView::roleEditingCanceled, | |||
---|---|---|---|---|---|
171 | this, &DolphinView::slotRoleEditingCanceled); | 171 | this, &DolphinView::slotRoleEditingCanceled); | ||
172 | connect(m_view->header(), &KItemListHeader::columnWidthChangeFinished, | 172 | connect(m_view->header(), &KItemListHeader::columnWidthChangeFinished, | ||
173 | this, &DolphinView::slotHeaderColumnWidthChangeFinished); | 173 | this, &DolphinView::slotHeaderColumnWidthChangeFinished); | ||
174 | 174 | | |||
175 | KItemListSelectionManager* selectionManager = controller->selectionManager(); | 175 | KItemListSelectionManager* selectionManager = controller->selectionManager(); | ||
176 | connect(selectionManager, &KItemListSelectionManager::selectionChanged, | 176 | connect(selectionManager, &KItemListSelectionManager::selectionChanged, | ||
177 | this, &DolphinView::slotSelectionChanged); | 177 | this, &DolphinView::slotSelectionChanged); | ||
178 | 178 | | |||
179 | #ifdef HAVE_BALOO | ||||
179 | m_toolTipManager = new ToolTipManager(this); | 180 | m_toolTipManager = new ToolTipManager(this); | ||
180 | connect(m_toolTipManager, &ToolTipManager::urlActivated, this, &DolphinView::urlActivated); | 181 | connect(m_toolTipManager, &ToolTipManager::urlActivated, this, &DolphinView::urlActivated); | ||
182 | #endif | ||||
181 | 183 | | |||
182 | m_versionControlObserver = new VersionControlObserver(this); | 184 | m_versionControlObserver = new VersionControlObserver(this); | ||
183 | m_versionControlObserver->setModel(m_model); | 185 | m_versionControlObserver->setModel(m_model); | ||
184 | connect(m_versionControlObserver, &VersionControlObserver::infoMessage, this, &DolphinView::infoMessage); | 186 | connect(m_versionControlObserver, &VersionControlObserver::infoMessage, this, &DolphinView::infoMessage); | ||
185 | connect(m_versionControlObserver, &VersionControlObserver::errorMessage, this, &DolphinView::errorMessage); | 187 | connect(m_versionControlObserver, &VersionControlObserver::errorMessage, this, &DolphinView::errorMessage); | ||
186 | connect(m_versionControlObserver, &VersionControlObserver::operationCompletedMessage, this, &DolphinView::operationCompletedMessage); | 188 | connect(m_versionControlObserver, &VersionControlObserver::operationCompletedMessage, this, &DolphinView::operationCompletedMessage); | ||
187 | 189 | | |||
188 | m_twoClicksRenamingTimer = new QTimer(this); | 190 | m_twoClicksRenamingTimer = new QTimer(this); | ||
▲ Show 20 Lines • Show All 836 Lines • ▼ Show 20 Line(s) | |||||
1025 | { | 1027 | { | ||
1026 | const KFileItem item = m_model->fileItem(index); | 1028 | const KFileItem item = m_model->fileItem(index); | ||
1027 | 1029 | | |||
1028 | if (GeneralSettings::showToolTips() && !m_dragging) { | 1030 | if (GeneralSettings::showToolTips() && !m_dragging) { | ||
1029 | QRectF itemRect = m_container->controller()->view()->itemContextRect(index); | 1031 | QRectF itemRect = m_container->controller()->view()->itemContextRect(index); | ||
1030 | const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint()); | 1032 | const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint()); | ||
1031 | itemRect.moveTo(pos); | 1033 | itemRect.moveTo(pos); | ||
1032 | 1034 | | |||
1035 | #ifdef HAVE_BALOO | ||||
1033 | m_toolTipManager->showToolTip(item, itemRect, nativeParentWidget()->windowHandle()); | 1036 | m_toolTipManager->showToolTip(item, itemRect, nativeParentWidget()->windowHandle()); | ||
1037 | #endif | ||||
1034 | } | 1038 | } | ||
1035 | 1039 | | |||
1036 | emit requestItemInfo(item); | 1040 | emit requestItemInfo(item); | ||
1037 | } | 1041 | } | ||
1038 | 1042 | | |||
1039 | void DolphinView::slotItemUnhovered(int index) | 1043 | void DolphinView::slotItemUnhovered(int index) | ||
1040 | { | 1044 | { | ||
1041 | Q_UNUSED(index); | 1045 | Q_UNUSED(index); | ||
▲ Show 20 Lines • Show All 360 Lines • ▼ Show 20 Line(s) | 1387 | if (!selectionManager->hasSelection()) { | |||
1402 | selectionManager->beginAnchoredSelection(selectionManager->currentItem()); | 1406 | selectionManager->beginAnchoredSelection(selectionManager->currentItem()); | ||
1403 | selectionManager->setSelectedItems(selectedItems); | 1407 | selectionManager->setSelectedItems(selectedItems); | ||
1404 | } | 1408 | } | ||
1405 | } | 1409 | } | ||
1406 | } | 1410 | } | ||
1407 | 1411 | | |||
1408 | void DolphinView::hideToolTip() | 1412 | void DolphinView::hideToolTip() | ||
1409 | { | 1413 | { | ||
1414 | #ifdef HAVE_BALOO | ||||
1410 | if (GeneralSettings::showToolTips()) { | 1415 | if (GeneralSettings::showToolTips()) { | ||
1411 | m_toolTipManager->hideToolTip(); | 1416 | m_toolTipManager->hideToolTip(); | ||
1412 | } | 1417 | } | ||
1418 | #endif | ||||
1413 | } | 1419 | } | ||
1414 | 1420 | | |||
1415 | void DolphinView::calculateItemCount(int& fileCount, | 1421 | void DolphinView::calculateItemCount(int& fileCount, | ||
1416 | int& folderCount, | 1422 | int& folderCount, | ||
1417 | KIO::filesize_t& totalFileSize) const | 1423 | KIO::filesize_t& totalFileSize) const | ||
1418 | { | 1424 | { | ||
1419 | const int itemCount = m_model->count(); | 1425 | const int itemCount = m_model->count(); | ||
1420 | for (int i = 0; i < itemCount; ++i) { | 1426 | for (int i = 0; i < itemCount; ++i) { | ||
▲ Show 20 Lines • Show All 388 Lines • Show Last 20 Lines |