if (m_container->controller()->selectionManager()->hasSelection()) {
// Give a summary of the status of the selected files
const KFileItemList list = selectedItems();
if (m_container->controller()->selectionManager()->hasSelection()) {
// Give a summary of the status of the selected files
const KFileItemList list = selectedItems();
if (GeneralSettings::useTabForSwitchingSplitView()) {
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
if (keyEvent->key() == Qt::Key_Tab && keyEvent->modifiers() == Qt::NoModifier) {
if (GeneralSettings::useTabForSwitchingSplitView()) {
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
if (keyEvent->key() == Qt::Key_Tab && keyEvent->modifiers() == Qt::NoModifier) {
void DolphinView::wheelEvent(QWheelEvent* event)
{
if (event->modifiers().testFlag(Qt::ControlModifier)) {
void DolphinView::wheelEvent(QWheelEvent* event)
{
if (event->modifiers().testFlag(Qt::ControlModifier)) {
- emit requestContextMenu(pos.toPoint(), item, url(), QList<QAction*>());
+ Q_EMIT requestContextMenu(pos.toPoint(), item, url(), QList<QAction*>());
- emit requestContextMenu(pos.toPoint(), KFileItem(), url(), QList<QAction*>());
+ Q_EMIT requestContextMenu(pos.toPoint(), KFileItem(), url(), QList<QAction*>());
QPointer<QMenu> menu = new QMenu(QApplication::activeWindow());
KItemListView* view = m_container->controller()->view();
QPointer<QMenu> menu = new QMenu(QApplication::activeWindow());
KItemListView* view = m_container->controller()->view();
// Add all roles to the menu that can be shown or hidden by the user
const QList<KFileItemModel::RoleInfo> rolesInfo = KFileItemModel::rolesInformation();
// Add all roles to the menu that can be shown or hidden by the user
const QList<KFileItemModel::RoleInfo> rolesInfo = KFileItemModel::rolesInformation();
// Apply the current column-widths as custom column-widths and turn
// off the automatic resizing of the columns
QList<int> columnWidths;
// Apply the current column-widths as custom column-widths and turn
// off the automatic resizing of the columns
QList<int> columnWidths;
- columnWidths.reserve(view->visibleRoles().count());
- foreach (const QByteArray& role, view->visibleRoles()) {
+ const auto visibleRoles = view->visibleRoles();
+ columnWidths.reserve(visibleRoles.count());
+ for (const QByteArray& role : visibleRoles) {
- columnWidths.reserve(view->visibleRoles().count());
- foreach (const QByteArray& role, view->visibleRoles()) {
+ const auto visibleRoles = view->visibleRoles();
+ columnWidths.reserve(visibleRoles.count());
+ for (const QByteArray& role : visibleRoles) {
void DolphinView::slotDirectoryRedirection(const QUrl& oldUrl, const QUrl& newUrl)
{
if (oldUrl.matches(url(), QUrl::StripTrailingSlash)) {
void DolphinView::slotDirectoryRedirection(const QUrl& oldUrl, const QUrl& newUrl)
{
if (oldUrl.matches(url(), QUrl::StripTrailingSlash)) {
// in DolphinView::slotDirectoryLoadingCompleted()
if (m_isFolderWritable) {
m_isFolderWritable = false;
// in DolphinView::slotDirectoryLoadingCompleted()
if (m_isFolderWritable) {
m_isFolderWritable = false;
// because the view might not be in its final state yet.
QTimer::singleShot(0, this, &DolphinView::updateViewState);
// because the view might not be in its final state yet.
QTimer::singleShot(0, this, &DolphinView::updateViewState);
}
}
const bool hiddenFilesShown = props.hiddenFilesShown();
if (hiddenFilesShown != m_model->showHiddenFiles()) {
m_model->setShowHiddenFiles(hiddenFilesShown);
}
}
const bool hiddenFilesShown = props.hiddenFilesShown();
if (hiddenFilesShown != m_model->showHiddenFiles()) {
m_model->setShowHiddenFiles(hiddenFilesShown);
}
const bool groupedSorting = props.groupedSorting();
if (groupedSorting != m_model->groupedSorting()) {
m_model->setGroupedSorting(groupedSorting);
}
const bool groupedSorting = props.groupedSorting();
if (groupedSorting != m_model->groupedSorting()) {
m_model->setGroupedSorting(groupedSorting);
}
const QByteArray sortRole = props.sortRole();
if (sortRole != m_model->sortRole()) {
m_model->setSortRole(sortRole);
}
const QByteArray sortRole = props.sortRole();
if (sortRole != m_model->sortRole()) {
m_model->setSortRole(sortRole);
}
const Qt::SortOrder sortOrder = props.sortOrder();
if (sortOrder != m_model->sortOrder()) {
m_model->setSortOrder(sortOrder);
}
const Qt::SortOrder sortOrder = props.sortOrder();
if (sortOrder != m_model->sortOrder()) {
m_model->setSortOrder(sortOrder);
}
const bool sortFoldersFirst = props.sortFoldersFirst();
if (sortFoldersFirst != m_model->sortDirectoriesFirst()) {
m_model->setSortDirectoriesFirst(sortFoldersFirst);
}
const bool sortFoldersFirst = props.sortFoldersFirst();
if (sortFoldersFirst != m_model->sortDirectoriesFirst()) {
m_model->setSortDirectoriesFirst(sortFoldersFirst);
const QList<QByteArray> previousVisibleRoles = m_visibleRoles;
m_visibleRoles = visibleRoles;
m_view->setVisibleRoles(visibleRoles);
const QList<QByteArray> previousVisibleRoles = m_visibleRoles;
m_visibleRoles = visibleRoles;
m_view->setVisibleRoles(visibleRoles);
// Changing the preview-state might result in a changed zoom-level
if (oldZoomLevel != zoomLevel()) {
// Changing the preview-state might result in a changed zoom-level
if (oldZoomLevel != zoomLevel()) {