Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/kdiroperator.cpp
Context not available. | |||||
197 | 197 | | |||
---|---|---|---|---|---|
198 | bool dirHighlighting; | 198 | bool dirHighlighting; | ||
199 | bool onlyDoubleClickSelectsFiles; | 199 | bool onlyDoubleClickSelectsFiles; | ||
200 | bool followDirectories; | ||||
200 | QString lastURL; // used for highlighting a directory on cdUp | 201 | QString lastURL; // used for highlighting a directory on cdUp | ||
201 | QTimer *progressDelayTimer; | 202 | QTimer *progressDelayTimer; | ||
202 | int dropOptions; | 203 | int dropOptions; | ||
Context not available. | |||||
237 | previewWidth(0), | 238 | previewWidth(0), | ||
238 | dirHighlighting(false), | 239 | dirHighlighting(false), | ||
239 | onlyDoubleClickSelectsFiles(!qApp->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick)), | 240 | onlyDoubleClickSelectsFiles(!qApp->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick)), | ||
241 | followDirectories(true), | ||||
240 | progressDelayTimer(nullptr), | 242 | progressDelayTimer(nullptr), | ||
241 | dropOptions(0), | 243 | dropOptions(0), | ||
242 | actionMenu(nullptr), | 244 | actionMenu(nullptr), | ||
Context not available. | |||||
2412 | return d->onlyDoubleClickSelectsFiles; | 2414 | return d->onlyDoubleClickSelectsFiles; | ||
2413 | } | 2415 | } | ||
2414 | 2416 | | |||
2417 | void KDirOperator::setFollowDirectories(bool enable) | ||||
2418 | { | ||||
2419 | d->followDirectories = enable; | ||||
2420 | } | ||||
2421 | | ||||
2422 | bool KDirOperator::followDirectories() const | ||||
2423 | { | ||||
2424 | return d->followDirectories; | ||||
2425 | } | ||||
2426 | | ||||
2415 | void KDirOperator::Private::_k_slotStarted() | 2427 | void KDirOperator::Private::_k_slotStarted() | ||
2416 | { | 2428 | { | ||
2417 | progressBar->setValue(0); | 2429 | progressBar->setValue(0); | ||
Context not available. | |||||
2516 | } | 2528 | } | ||
2517 | 2529 | | |||
2518 | if (item.isDir()) { | 2530 | if (item.isDir()) { | ||
2519 | parent->selectDir(item); | 2531 | // Only allow disabling following directories on Tree and DetailTree | ||
2532 | // views as selected directories in these views still expand when | ||||
2533 | // selected. For other views, disabling following directories would | ||||
2534 | // make selecting a directory a noop which is unintuitive. | ||||
2535 | if (followDirectories || & | ||||
2536 | (viewKind != KFile::Tree && viewKind != KFile::DetailTree)) { | ||||
2537 | parent->selectDir(item); | ||||
2538 | } | ||||
2520 | } else { | 2539 | } else { | ||
2521 | parent->selectFile(item); | 2540 | parent->selectFile(item); | ||
2522 | } | 2541 | } | ||
Context not available. | |||||
2781 | 2800 | | |||
2782 | void KDirOperator::Private::_k_slotDirectoryCreated(const QUrl &url) | 2801 | void KDirOperator::Private::_k_slotDirectoryCreated(const QUrl &url) | ||
2783 | { | 2802 | { | ||
2784 | parent->setUrl(url, true); | 2803 | if (followDirectories) { | ||
2804 | parent->setUrl(url, true); | ||||
2805 | } | ||||
2785 | } | 2806 | } | ||
2786 | 2807 | | |||
2787 | void KDirOperator::setSupportedSchemes(const QStringList &schemes) | 2808 | void KDirOperator::setSupportedSchemes(const QStringList &schemes) | ||
Context not available. |