Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinmainwindow.cpp
Show First 20 Lines • Show All 1899 Lines • ▼ Show 20 Line(s) | 1899 | } else { | |||
---|---|---|---|---|---|
1900 | stateChanged(QStringLiteral("has_selection")); | 1900 | stateChanged(QStringLiteral("has_selection")); | ||
1901 | 1901 | | |||
1902 | QAction* renameAction = col->action(KStandardAction::name(KStandardAction::RenameFile)); | 1902 | QAction* renameAction = col->action(KStandardAction::name(KStandardAction::RenameFile)); | ||
1903 | QAction* moveToTrashAction = col->action(KStandardAction::name(KStandardAction::MoveToTrash)); | 1903 | QAction* moveToTrashAction = col->action(KStandardAction::name(KStandardAction::MoveToTrash)); | ||
1904 | QAction* deleteAction = col->action(KStandardAction::name(KStandardAction::DeleteFile)); | 1904 | QAction* deleteAction = col->action(KStandardAction::name(KStandardAction::DeleteFile)); | ||
1905 | QAction* cutAction = col->action(KStandardAction::name(KStandardAction::Cut)); | 1905 | QAction* cutAction = col->action(KStandardAction::name(KStandardAction::Cut)); | ||
1906 | QAction* deleteWithTrashShortcut = col->action(QStringLiteral("delete_shortcut")); // see DolphinViewActionHandler | 1906 | QAction* deleteWithTrashShortcut = col->action(QStringLiteral("delete_shortcut")); // see DolphinViewActionHandler | ||
1907 | QAction* showTarget = col->action(QStringLiteral("show_target")); | 1907 | QAction* showTarget = col->action(QStringLiteral("show_target")); | ||
1908 | QAction* duplicateAction = col->action(QStringLiteral("duplicate")); // see DolphinViewActionHandler | ||||
1908 | 1909 | | |||
1909 | if (list.length() == 1 && list.first().isDir()) { | 1910 | if (list.length() == 1 && list.first().isDir()) { | ||
1910 | addToPlacesAction->setEnabled(true); | 1911 | addToPlacesAction->setEnabled(true); | ||
1911 | addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add '%1' to Places", list.first().name())); | 1912 | addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add '%1' to Places", list.first().name())); | ||
1912 | } else { | 1913 | } else { | ||
1913 | addToPlacesAction->setEnabled(false); | 1914 | addToPlacesAction->setEnabled(false); | ||
1914 | addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add to Places")); | 1915 | addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add to Places")); | ||
1915 | } | 1916 | } | ||
1916 | 1917 | | |||
1917 | KFileItemListProperties capabilities(list); | 1918 | KFileItemListProperties capabilities(list); | ||
1918 | const bool enableMoveToTrash = capabilities.isLocal() && capabilities.supportsMoving(); | 1919 | const bool enableMoveToTrash = capabilities.isLocal() && capabilities.supportsMoving(); | ||
1919 | 1920 | | |||
1920 | renameAction->setEnabled(capabilities.supportsMoving()); | 1921 | renameAction->setEnabled(capabilities.supportsMoving()); | ||
1921 | moveToTrashAction->setEnabled(enableMoveToTrash); | 1922 | moveToTrashAction->setEnabled(enableMoveToTrash); | ||
1922 | deleteAction->setEnabled(capabilities.supportsDeleting()); | 1923 | deleteAction->setEnabled(capabilities.supportsDeleting()); | ||
1923 | deleteWithTrashShortcut->setEnabled(capabilities.supportsDeleting() && !enableMoveToTrash); | 1924 | deleteWithTrashShortcut->setEnabled(capabilities.supportsDeleting() && !enableMoveToTrash); | ||
1924 | cutAction->setEnabled(capabilities.supportsMoving()); | 1925 | cutAction->setEnabled(capabilities.supportsMoving()); | ||
1925 | showTarget->setEnabled(list.length() == 1 && list.at(0).isLink()); | 1926 | showTarget->setEnabled(list.length() == 1 && list.at(0).isLink()); | ||
1927 | duplicateAction->setEnabled(capabilities.supportsWriting()); | ||||
1926 | } | 1928 | } | ||
1927 | } | 1929 | } | ||
1928 | 1930 | | |||
1929 | void DolphinMainWindow::updateViewActions() | 1931 | void DolphinMainWindow::updateViewActions() | ||
1930 | { | 1932 | { | ||
1931 | m_actionHandler->updateViewActions(); | 1933 | m_actionHandler->updateViewActions(); | ||
1932 | 1934 | | |||
1933 | QAction* showFilterBarAction = actionCollection()->action(QStringLiteral("show_filter_bar")); | 1935 | QAction* showFilterBarAction = actionCollection()->action(QStringLiteral("show_filter_bar")); | ||
▲ Show 20 Lines • Show All 421 Lines • Show Last 20 Lines |