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 followNewDirectories; | ||||
201 | bool followSelectedDirectories; | ||||
200 | QString lastURL; // used for highlighting a directory on cdUp | 202 | QString lastURL; // used for highlighting a directory on cdUp | ||
201 | QTimer *progressDelayTimer; | 203 | QTimer *progressDelayTimer; | ||
202 | int dropOptions; | 204 | int dropOptions; | ||
Context not available. | |||||
237 | previewWidth(0), | 239 | previewWidth(0), | ||
238 | dirHighlighting(false), | 240 | dirHighlighting(false), | ||
239 | onlyDoubleClickSelectsFiles(!qApp->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick)), | 241 | onlyDoubleClickSelectsFiles(!qApp->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick)), | ||
242 | followNewDirectories(true), | ||||
243 | followSelectedDirectories(true), | ||||
240 | progressDelayTimer(nullptr), | 244 | progressDelayTimer(nullptr), | ||
241 | dropOptions(0), | 245 | dropOptions(0), | ||
242 | actionMenu(nullptr), | 246 | actionMenu(nullptr), | ||
Context not available. | |||||
2412 | return d->onlyDoubleClickSelectsFiles; | 2416 | return d->onlyDoubleClickSelectsFiles; | ||
2413 | } | 2417 | } | ||
2414 | 2418 | | |||
2419 | void KDirOperator::setFollowNewDirectories(bool enable) | ||||
2420 | { | ||||
2421 | d->followNewDirectories = enable; | ||||
2422 | } | ||||
2423 | | ||||
2424 | bool KDirOperator::followNewDirectories() const | ||||
2425 | { | ||||
2426 | return d->followNewDirectories; | ||||
2427 | } | ||||
2428 | | ||||
2429 | void KDirOperator::setFollowSelectedDirectories(bool enable) | ||||
2430 | { | ||||
2431 | d->followSelectedDirectories = enable; | ||||
2432 | } | ||||
2433 | | ||||
2434 | bool KDirOperator::followSelectedDirectories() const | ||||
2435 | { | ||||
2436 | return d->followSelectedDirectories; | ||||
2437 | } | ||||
2438 | | ||||
2415 | void KDirOperator::Private::_k_slotStarted() | 2439 | void KDirOperator::Private::_k_slotStarted() | ||
2416 | { | 2440 | { | ||
2417 | progressBar->setValue(0); | 2441 | progressBar->setValue(0); | ||
Context not available. | |||||
2516 | } | 2540 | } | ||
2517 | 2541 | | |||
2518 | if (item.isDir()) { | 2542 | if (item.isDir()) { | ||
2519 | parent->selectDir(item); | 2543 | // Only allow disabling following selected directories on Tree and | ||
2544 | // DetailTree views as selected directories in these views still expand | ||||
2545 | // when selected. For other views, disabling following selected | ||||
2546 | // directories would make selecting a directory a noop which is | ||||
2547 | // unintuitive. | ||||
2548 | if (followSelectedDirectories || | ||||
2549 | (viewKind != KFile::Tree && viewKind != KFile::DetailTree)) { | ||||
2550 | parent->selectDir(item); | ||||
2551 | } | ||||
2520 | } else { | 2552 | } else { | ||
2521 | parent->selectFile(item); | 2553 | parent->selectFile(item); | ||
2522 | } | 2554 | } | ||
Context not available. | |||||
2781 | 2813 | | |||
2782 | void KDirOperator::Private::_k_slotDirectoryCreated(const QUrl &url) | 2814 | void KDirOperator::Private::_k_slotDirectoryCreated(const QUrl &url) | ||
2783 | { | 2815 | { | ||
2784 | parent->setUrl(url, true); | 2816 | if (followNewDirectories) { | ||
2817 | parent->setUrl(url, true); | ||||
2818 | } | ||||
2785 | } | 2819 | } | ||
2786 | 2820 | | |||
2787 | void KDirOperator::setSupportedSchemes(const QStringList &schemes) | 2821 | void KDirOperator::setSupportedSchemes(const QStringList &schemes) | ||
Context not available. |