X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/3cb3d58fbf0a5d3736579ad7a52a2a46ab9c1d29..c527dc2172:/src/panels/folders/folderspanel.cpp diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp index add7f692b..7a0b4b6b2 100644 --- a/src/panels/folders/folderspanel.cpp +++ b/src/panels/folders/folderspanel.cpp @@ -21,18 +21,17 @@ #include "dolphin_folderspanelsettings.h" #include "dolphin_generalsettings.h" -#include "treeviewcontextmenu.h" #include "foldersitemlistwidget.h" +#include "global.h" +#include "kitemviews/kfileitemlistview.h" +#include "kitemviews/kfileitemmodel.h" +#include "kitemviews/kitemlistcontainer.h" +#include "kitemviews/kitemlistcontroller.h" +#include "kitemviews/kitemlistselectionmanager.h" +#include "treeviewcontextmenu.h" +#include "views/draganddrophelper.h" +#include "views/renamedialog.h" -#include -#include -#include -#include -#include -#include -#include - -#include #include #include #include @@ -41,17 +40,11 @@ #include #include -#include #include #include #include #include -#include - -#include "dolphindebug.h" -#include "global.h" - FoldersPanel::FoldersPanel(QWidget* parent) : Panel(parent), m_updateCurrentItem(false), @@ -112,7 +105,6 @@ void FoldersPanel::rename(const KFileItem& item) m_controller->view()->editRole(index, "text"); } else { RenameDialog* dialog = new RenameDialog(this, KFileItemList() << item); - dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->show(); dialog->raise(); dialog->activateWindow(); @@ -137,7 +129,7 @@ bool FoldersPanel::urlChanged() void FoldersPanel::reloadTree() { if (m_controller) { - loadTree(url(), true); + loadTree(url(), AllowJumpHome); } } @@ -316,7 +308,7 @@ void FoldersPanel::startFadeInAnimation() anim->setDuration(200); } -void FoldersPanel::loadTree(const QUrl& url, bool allowJumpHome) +void FoldersPanel::loadTree(const QUrl& url, FoldersPanel::NavigationBehaviour navigationBehaviour) { Q_ASSERT(m_controller); @@ -327,7 +319,7 @@ void FoldersPanel::loadTree(const QUrl& url, bool allowJumpHome) if (!url.isLocalFile()) { // Clear the path for non-local URLs and use it as base baseUrl = url; - baseUrl.setPath(QString('/')); + baseUrl.setPath(QStringLiteral("/")); } else if (Dolphin::homeUrl().isParentOf(url) || (Dolphin::homeUrl() == url)) { if (FoldersPanelSettings::limitFoldersPanelToHome() ) { baseUrl = Dolphin::homeUrl(); @@ -335,7 +327,7 @@ void FoldersPanel::loadTree(const QUrl& url, bool allowJumpHome) // Use the root directory as base for local URLs (#150941) baseUrl = QUrl::fromLocalFile(QDir::rootPath()); } - } else if (FoldersPanelSettings::limitFoldersPanelToHome() && allowJumpHome) { + } else if (FoldersPanelSettings::limitFoldersPanelToHome() && navigationBehaviour == AllowJumpHome) { baseUrl = Dolphin::homeUrl(); jumpHome = true; } else { @@ -349,7 +341,7 @@ void FoldersPanel::loadTree(const QUrl& url, bool allowJumpHome) } const int index = m_model->index(url); - if (jumpHome == true) { + if (jumpHome) { emit folderActivated(baseUrl); } else if (index >= 0) { updateCurrentItem(index);