From 91eb6aa37ae38c73441b6100a4ea9beb35e982f4 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Wed, 20 Dec 2017 08:25:12 +0100 Subject: [PATCH 1/9] SVN_SILENT made messages (.desktop file) - always resolve ours In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop" --- src/dolphinpart.desktop | 2 +- src/settings/kcm/kcmdolphingeneral.desktop | 6 +++--- src/settings/kcm/kcmdolphinnavigation.desktop | 4 ++-- src/settings/kcm/kcmdolphinservices.desktop | 4 ++-- src/settings/kcm/kcmdolphinviewmodes.desktop | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/dolphinpart.desktop b/src/dolphinpart.desktop index a0d7a96b24..9bf9f95cf2 100644 --- a/src/dolphinpart.desktop +++ b/src/dolphinpart.desktop @@ -170,7 +170,7 @@ Name[gl]=Detalles Name[he]=פרטים Name[hu]=Részletek Name[ia]=Detalios -Name[id]=Detail +Name[id]=Perincian Name[it]=Dettagli Name[ja]=詳細 Name[ko]=자세히 diff --git a/src/settings/kcm/kcmdolphingeneral.desktop b/src/settings/kcm/kcmdolphingeneral.desktop index eb9809bb82..c05e5b1a13 100644 --- a/src/settings/kcm/kcmdolphingeneral.desktop +++ b/src/settings/kcm/kcmdolphingeneral.desktop @@ -56,7 +56,7 @@ Comment[fr]=Ce service permet de configurer les paramètres généraux de Dolphi Comment[gl]=Este servizo permite configurar opcións xerais de Dolphin. Comment[hu]=Ez a szolgáltatás lehetővé teszi a Dolphin általános beállításainak módosítását. Comment[ia]=Iste servicio permitte configuration del preferentias general de Dolphin. -Comment[id]=Layanan ini memungkinkan konfigurasi pengaturan umum Dolphin. +Comment[id]=Layanan ini memungkinkan konfigurasi setelan umum Dolphin. Comment[it]=Questo servizio permette di configurare le impostazioni generali di Dolphin. Comment[ja]=Dolphin の全般的な設定を行います Comment[ko]=이 서비스는 일반 Dolphin 설정을 담당합니다. @@ -152,7 +152,7 @@ Comment[fr]=Configuration des paramètres généraux du gestionnaire de fichiers Comment[gl]=Configurar opcións xerais de xestores de ficheiros. Comment[hu]=A fájlkezelő általános beállításainak módosítása Comment[ia]=Configura preferentias del gerente general de file -Comment[id]=Konfigurasi pengaturan manajer berkas umum +Comment[id]=Konfigurasi setelan pengelola berkas umum Comment[it]=Configura le impostazioni generali del gestore dei file Comment[ja]=ファイルマネージャの全般的な設定を行います Comment[ko]=일반 파일 관리자 설정 @@ -195,7 +195,7 @@ X-KDE-Keywords[gl]=xestor de ficheiros X-KDE-Keywords[he]=מנהל קבצים X-KDE-Keywords[hu]=fájlkezelő X-KDE-Keywords[ia]=gerente de file -X-KDE-Keywords[id]=manajer berkas +X-KDE-Keywords[id]=pengelola berkas X-KDE-Keywords[it]=gestore dei file X-KDE-Keywords[ja]=ファイルマネージャ X-KDE-Keywords[ko]=파일 관리자 diff --git a/src/settings/kcm/kcmdolphinnavigation.desktop b/src/settings/kcm/kcmdolphinnavigation.desktop index 238f5d2669..024654a5ec 100644 --- a/src/settings/kcm/kcmdolphinnavigation.desktop +++ b/src/settings/kcm/kcmdolphinnavigation.desktop @@ -152,7 +152,7 @@ Comment[fr]=Configuration la navigation avec le gestionnaire de fichiers Comment[gl]=Configurar a navegación do xestor de ficheiros. Comment[hu]=A fájlkezelő navigálásának beállítása Comment[ia]=Configura navigation del gerente de file -Comment[id]=Konfigurasi navigasi manajer berkas +Comment[id]=Konfigurasi navigasi pengelola berkas Comment[it]=Configura la navigazione col gestore dei file Comment[ja]=ファイルマネージャでのナビゲーションを設定します Comment[ko]=파일 관리자 탐색 설정 @@ -196,7 +196,7 @@ X-KDE-Keywords[gl]=xestor de ficheiros X-KDE-Keywords[he]=מנהל קבצים X-KDE-Keywords[hu]=fájlkezelő X-KDE-Keywords[ia]=gerente de file -X-KDE-Keywords[id]=manajer berkas +X-KDE-Keywords[id]=pengelola berkas X-KDE-Keywords[it]=gestore dei file X-KDE-Keywords[ja]=ファイルマネージャ X-KDE-Keywords[ko]=파일 관리자 diff --git a/src/settings/kcm/kcmdolphinservices.desktop b/src/settings/kcm/kcmdolphinservices.desktop index 0b41019a82..195b4d2a36 100644 --- a/src/settings/kcm/kcmdolphinservices.desktop +++ b/src/settings/kcm/kcmdolphinservices.desktop @@ -110,7 +110,7 @@ Comment[fr]=Configuration des services du gestionnaire de fichiers Comment[gl]=Configurar servizos de xestores de ficheiros. Comment[hu]=A fájlkezelő szolgáltatásainak beállítása Comment[ia]=Configura servicios del gerente de file -Comment[id]=Konfigurasi layanan manajer berkas +Comment[id]=Konfigurasi layanan pengelola berkas Comment[it]=Configura i servizi del gestore dei file Comment[ja]=ファイルマネージャのサービスを設定します Comment[ko]=파일 관리자 서비스 설정 @@ -153,7 +153,7 @@ X-KDE-Keywords[gl]=xestor de ficheiros X-KDE-Keywords[he]=מנהל קבצים X-KDE-Keywords[hu]=fájlkezelő X-KDE-Keywords[ia]=gerente de file -X-KDE-Keywords[id]=manajer berkas +X-KDE-Keywords[id]=pengelola berkas X-KDE-Keywords[it]=gestore dei file X-KDE-Keywords[ja]=ファイルマネージャ X-KDE-Keywords[ko]=파일 관리자 diff --git a/src/settings/kcm/kcmdolphinviewmodes.desktop b/src/settings/kcm/kcmdolphinviewmodes.desktop index 41062deff1..32943b1c98 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.desktop +++ b/src/settings/kcm/kcmdolphinviewmodes.desktop @@ -150,7 +150,7 @@ Comment[fr]=Configuration les modes d'affichage du gestionnaire de fichiers Comment[gl]=Configurar os modos de vista do xestor de ficheiros. Comment[hu]=A fájlkezelő nézetmódjainak beállítása Comment[ia]=Configura le modos de vista del gerente de file -Comment[id]=Konfigurasi mode tampilan manajer berkas +Comment[id]=Konfigurasi mode tampilan pengelola berkas Comment[it]=Configura le viste del gestore dei file Comment[ja]=ファイルマネージャの表示モードを設定します Comment[ko]=파일 관리자 보기 모드 설정 @@ -194,7 +194,7 @@ X-KDE-Keywords[gl]=xestor de ficheiros X-KDE-Keywords[he]=מנהל קבצים X-KDE-Keywords[hu]=fájlkezelő X-KDE-Keywords[ia]=gerente de file -X-KDE-Keywords[id]=manajer berkas +X-KDE-Keywords[id]=pengelola berkas X-KDE-Keywords[it]=gestore dei file X-KDE-Keywords[ja]=ファイルマネージャ X-KDE-Keywords[ko]=파일 관리자 From 09dd74348ed16d90577fd7dcf13ed59bc9116cf7 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Thu, 28 Dec 2017 06:01:08 +0100 Subject: [PATCH 2/9] SVN_SILENT made messages (.desktop file) - always resolve ours In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop" --- src/views/versioncontrol/fileviewversioncontrolplugin.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/versioncontrol/fileviewversioncontrolplugin.desktop b/src/views/versioncontrol/fileviewversioncontrolplugin.desktop index 889c1232aa..05b4a6e908 100644 --- a/src/views/versioncontrol/fileviewversioncontrolplugin.desktop +++ b/src/views/versioncontrol/fileviewversioncontrolplugin.desktop @@ -17,7 +17,7 @@ Comment[fr]=Module externe pour le contrôle de version applicable aux vues de f Comment[gl]=Complemento de control de versión para vistas de ficheiros. Comment[hu]=Verziókezelő bővítmény a fájlnézetekhez Comment[ia]=Plugin de controlo de version pro vistas de file -Comment[id]=Plugin Kontrol Versi untuk Tampilan Berkas +Comment[id]=Plugin Kendali Versi untuk Tampilan Berkas Comment[it]=Estensione di controllo delle versioni per le viste dei file Comment[ja]=ファイルビューのためのバージョン管理プラグイン Comment[ko]=파일 보기를 위한 버전 관리 플러그인 From 9d01f723aa67f107bf96c8f2fbce5036422a54fe Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Sun, 31 Dec 2017 05:22:08 +0100 Subject: [PATCH 3/9] GIT_SILENT made messages (after extraction) --- src/org.kde.dolphin.appdata.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org.kde.dolphin.appdata.xml b/src/org.kde.dolphin.appdata.xml index 773e586195..b6e7aac9df 100644 --- a/src/org.kde.dolphin.appdata.xml +++ b/src/org.kde.dolphin.appdata.xml @@ -378,7 +378,7 @@
  • Informationsdialoger vises på en ikke-forstyrrende måde.
  • Informationen werden unaufdringlich angezeigt.
  • Ενημερωτικοί διάλογοι εμφανίζονται με μη παρεμβατικό τρόπο.
  • -
  • Informational dialogs are displayed in an unobtrusive way.
  • +
  • Informational dialogues are displayed in an unobtrusive way.
  • Los diálogos informativos se muestran de manera discreta.
  • Teavitavate dialoogide näitamine kasutajat liigselt ärritamata.
  • Informatiiviset valintaikkunat näytetään niin, että ne eivät keskeytä kaikkea muuta toimintaa.
  • From 9d3a019445d7a7fdf3177bca9eeef4c44599e706 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Fri, 15 Dec 2017 09:10:47 -0300 Subject: [PATCH 4/9] Ignore baloo urls created from new KIO model Summary: For now ignore baloo urls that was created by new KIO::KFilePlacesModel, until we make use of new KIO API. BUG: 387888 Test Plan: Open any KIO file dialog using the new API. Runs dolphin v17.12.0 Make sure that baloo urls does not appear duplicated Reviewers: ngraham, elvisangelaccio Reviewed By: ngraham, elvisangelaccio Subscribers: cfeck, elvisangelaccio, ervin, mlaurent, #dolphin Differential Revision: https://phabricator.kde.org/D9347 --- src/panels/places/placesitemmodel.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 680d513b5c..abdd4c20b6 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -65,6 +65,17 @@ namespace { // Hence a prefix to the application-name of the stored bookmarks is // added, which is only read by PlacesItemModel. const char AppNamePrefix[] = "-places-panel"; + + static QList balooURLs = { + QUrl(QStringLiteral("timeline:/today")), + QUrl(QStringLiteral("timeline:/yesterday")), + QUrl(QStringLiteral("timeline:/thismonth")), + QUrl(QStringLiteral("timeline:/lastmonth")), + QUrl(QStringLiteral("search:/documents")), + QUrl(QStringLiteral("search:/images")), + QUrl(QStringLiteral("search:/audio")), + QUrl(QStringLiteral("search:/videos")) + }; } PlacesItemModel::PlacesItemModel(QObject* parent) : @@ -832,6 +843,12 @@ bool PlacesItemModel::acceptBookmark(const KBookmark& bookmark, const QString appName = bookmark.metaDataItem(QStringLiteral("OnlyInApp")); const bool deviceAvailable = availableDevices.contains(udi); + if (balooURLs.contains(url) && appName.isEmpty()) { + // Does not accept baloo URLS with empty appName, this came from new KIO model and will cause duplications + qCWarning(DolphinDebug) << "Ignore KIO url:" << url; + return false; + } + const bool allowedHere = (appName.isEmpty() || appName == KAboutData::applicationData().componentName() || appName == KAboutData::applicationData().componentName() + AppNamePrefix) From 7b595b3387cdb002c3e9a11e98a95d8801ca078d Mon Sep 17 00:00:00 2001 From: Michael Heidelbach Date: Wed, 3 Jan 2018 14:05:58 +0100 Subject: [PATCH 5/9] Revive folderpanel when outside $HOME Summary: Currently the folderpanel is inert when browsing outside of home because urls end up as 'file:////a/b/c' and since Qt 5.10 this is an invalid URL: http://code.qt.io/cgit/qt/qtbase.git/commit/?id=f62768d046528636789f901ac79e2cfa1843a7b7 Premptive bug fix. Test Plan: Open dolphin Leave home directory Reviewers: #dolphin, elvisangelaccio Subscribers: dfaure, elvisangelaccio, ngraham, anthonyfieroni Tags: #dolphin Differential Revision: https://phabricator.kde.org/D9610 --- src/kitemviews/kfileitemmodel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 8f89b89df6..5919e64274 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -629,20 +629,24 @@ void KFileItemModel::restoreExpandedDirectories(const QSet &urls) void KFileItemModel::expandParentDirectories(const QUrl &url) { - const int pos = m_dirLister->url().path().length(); // Assure that each sub-path of the URL that should be // expanded is added to m_urlsToExpand. KDirLister // does not care whether the parent-URL has already been // expanded. QUrl urlToExpand = m_dirLister->url(); + const int pos = urlToExpand.path().length(); // first subdir can be empty, if m_dirLister->url().path() does not end with '/' // this happens if baseUrl is not root but a home directory, see FoldersPanel, // so using QString::SkipEmptyParts const QStringList subDirs = url.path().mid(pos).split(QDir::separator(), QString::SkipEmptyParts); for (int i = 0; i < subDirs.count() - 1; ++i) { - urlToExpand.setPath(urlToExpand.path() + '/' + subDirs.at(i)); + QString path = urlToExpand.path(); + if (!path.endsWith(QLatin1Char('/'))) { + path.append(QLatin1Char('/')); + } + urlToExpand.setPath(path + subDirs.at(i)); m_urlsToExpand.insert(urlToExpand); } From 4fcc3403288e84b7f81b3adf03f6e500defb02d8 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 4 Jan 2018 18:44:27 +0100 Subject: [PATCH 6/9] GIT_SILENT Upgrade KDE Applications version to 17.12.1. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bade332b7..d45626ee69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0) # KDE Application Version, managed by release script set (KDE_APPLICATIONS_VERSION_MAJOR "17") set (KDE_APPLICATIONS_VERSION_MINOR "12") -set (KDE_APPLICATIONS_VERSION_MICRO "0") +set (KDE_APPLICATIONS_VERSION_MICRO "1") set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}") project(Dolphin VERSION ${KDE_APPLICATIONS_VERSION}) From 65c0997164bd6f770c4286f7be83bcd2d3d145bd Mon Sep 17 00:00:00 2001 From: Michael Heidelbach Date: Sat, 6 Jan 2018 16:55:32 -0700 Subject: [PATCH 7/9] infopanel fully resizable Summary: Currently Infopanel does wrap its title when trying to narrow it. Initially: {F5619283} Expanded: {F5619284} Resizing fails, watch cursor: {F5619286} Patch applied: {F5619287} Maybe this behaviour it intentional. Personally, I prefer the patch. Test Plan: compile & run Resize infopanel with long title Reviewers: #dolphin, ngraham, elvisangelaccio Reviewed By: #dolphin, ngraham, elvisangelaccio Subscribers: renatoo, vhanda, nicolasfella, elvisangelaccio, ngraham Tags: #dolphin, #kde_applications Differential Revision: https://phabricator.kde.org/D9664 --- src/panels/information/informationpanelcontent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index fa4868e52b..3c48a2296b 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -107,7 +107,7 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) : m_nameLabel->setFont(font); m_nameLabel->setTextFormat(Qt::PlainText); m_nameLabel->setAlignment(Qt::AlignHCenter); - m_nameLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + m_nameLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed); const bool previewsShown = InformationPanelSettings::previewsShown(); m_preview->setVisible(previewsShown); From 3cb3d58fbf0a5d3736579ad7a52a2a46ab9c1d29 Mon Sep 17 00:00:00 2001 From: Michael Heidelbach Date: Sun, 14 Jan 2018 10:53:11 -0700 Subject: [PATCH 8/9] folderspanel context-menu option "Limit to Home Directory" should be always visible Summary: Only by chance I discovered that this option is visible but only when inside home. Before that I always edited dolphinrc to reenable it. I think it's less confusing to always show it but toggle its enabled state Test Plan: compile and run show folderspanel context-menu in different places Reviewers: #dolphin, emmanuelp, ngraham Reviewed By: #dolphin, ngraham Subscribers: elvisangelaccio Tags: #dolphin, #kde_applications Differential Revision: https://phabricator.kde.org/D9662 --- src/panels/folders/folderspanel.cpp | 28 ++++++++++++++-------- src/panels/folders/folderspanel.h | 3 ++- src/panels/folders/treeviewcontextmenu.cpp | 15 ++++++------ 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp index eef27ce472..add7f692b9 100644 --- a/src/panels/folders/folderspanel.cpp +++ b/src/panels/folders/folderspanel.cpp @@ -137,7 +137,7 @@ bool FoldersPanel::urlChanged() void FoldersPanel::reloadTree() { if (m_controller) { - loadTree(url()); + loadTree(url(), true); } } @@ -316,34 +316,42 @@ void FoldersPanel::startFadeInAnimation() anim->setDuration(200); } -void FoldersPanel::loadTree(const QUrl& url) +void FoldersPanel::loadTree(const QUrl& url, bool allowJumpHome) { Q_ASSERT(m_controller); m_updateCurrentItem = false; + bool jumpHome = false; QUrl baseUrl; - if (url.isLocalFile()) { - const bool isInHomeFolder = Dolphin::homeUrl().isParentOf(url) || (Dolphin::homeUrl() == url); - if (FoldersPanelSettings::limitFoldersPanelToHome() && isInHomeFolder) { + if (!url.isLocalFile()) { + // Clear the path for non-local URLs and use it as base + baseUrl = url; + baseUrl.setPath(QString('/')); + } else if (Dolphin::homeUrl().isParentOf(url) || (Dolphin::homeUrl() == url)) { + if (FoldersPanelSettings::limitFoldersPanelToHome() ) { baseUrl = Dolphin::homeUrl(); } else { // Use the root directory as base for local URLs (#150941) baseUrl = QUrl::fromLocalFile(QDir::rootPath()); } + } else if (FoldersPanelSettings::limitFoldersPanelToHome() && allowJumpHome) { + baseUrl = Dolphin::homeUrl(); + jumpHome = true; } else { - // Clear the path for non-local URLs and use it as base - baseUrl = url; - baseUrl.setPath(QString('/')); + // Use the root directory as base for local URLs (#150941) + baseUrl = QUrl::fromLocalFile(QDir::rootPath()); } - if (m_model->directory() != baseUrl) { + if (m_model->directory() != baseUrl && !jumpHome) { m_updateCurrentItem = true; m_model->refreshDirectory(baseUrl); } const int index = m_model->index(url); - if (index >= 0) { + if (jumpHome == true) { + emit folderActivated(baseUrl); + } else if (index >= 0) { updateCurrentItem(index); } else if (url == baseUrl) { // clear the selection when visiting the base url diff --git a/src/panels/folders/folderspanel.h b/src/panels/folders/folderspanel.h index ab6c41b345..a653b45840 100644 --- a/src/panels/folders/folderspanel.h +++ b/src/panels/folders/folderspanel.h @@ -89,8 +89,9 @@ private: * Initializes the base URL of the tree and expands all * directories until \a url. * @param url URL of the leaf directory that should get expanded. + * @param allowJumpHome indicate context menu got checked. */ - void loadTree(const QUrl& url); + void loadTree(const QUrl& url, bool allowJumpHome = false); void reloadTree(); diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp index 6381a88ff1..132637f15a 100644 --- a/src/panels/folders/treeviewcontextmenu.cpp +++ b/src/panels/folders/treeviewcontextmenu.cpp @@ -127,14 +127,13 @@ void TreeViewContextMenu::open() // insert 'Limit to Home Directory' const QUrl url = m_fileItem.url(); - const bool showLimitToHomeDirectory = url.isLocalFile() && (Dolphin::homeUrl().isParentOf(url) || (Dolphin::homeUrl() == url)); - if (showLimitToHomeDirectory) { - QAction* limitFoldersPanelToHomeAction = new QAction(i18nc("@action:inmenu", "Limit to Home Directory"), this); - limitFoldersPanelToHomeAction->setCheckable(true); - limitFoldersPanelToHomeAction->setChecked(m_parent->limitFoldersPanelToHome()); - popup->addAction(limitFoldersPanelToHomeAction); - connect(limitFoldersPanelToHomeAction, &QAction::toggled, this, &TreeViewContextMenu::setLimitFoldersPanelToHome); - } + const bool enableLimitToHomeDirectory = url.isLocalFile(); + QAction* limitFoldersPanelToHomeAction = new QAction(i18nc("@action:inmenu", "Limit to Home Directory"), this); + limitFoldersPanelToHomeAction->setCheckable(true); + limitFoldersPanelToHomeAction->setEnabled(enableLimitToHomeDirectory); + limitFoldersPanelToHomeAction->setChecked(m_parent->limitFoldersPanelToHome()); + popup->addAction(limitFoldersPanelToHomeAction); + connect(limitFoldersPanelToHomeAction, &QAction::toggled, this, &TreeViewContextMenu::setLimitFoldersPanelToHome); // insert 'Automatic Scrolling' QAction* autoScrollingAction = new QAction(i18nc("@action:inmenu", "Automatic Scrolling"), this); From 64d2fd29819fa46c293e8c726c7df2ff00b332b3 Mon Sep 17 00:00:00 2001 From: Michael Heidelbach Date: Tue, 16 Jan 2018 10:23:50 +0100 Subject: [PATCH 9/9] Folderspanel's context-menu option "Limit to Home Directory" is always visible Summary: Applied suggested changes to [[ https://phabricator.kde.org/D9662 | D9662 ]] - Enum instead of bool - Use QStringLiteral Test Plan: Visual inspection Reviewers: ngraham, elvisangelaccio, #dolphin Reviewed By: ngraham, #dolphin Subscribers: #dolphin Tags: #dolphin, #kde_applications Differential Revision: https://phabricator.kde.org/D9911 --- src/panels/folders/folderspanel.cpp | 10 +++++----- src/panels/folders/folderspanel.h | 11 +++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp index add7f692b9..4a476ad76a 100644 --- a/src/panels/folders/folderspanel.cpp +++ b/src/panels/folders/folderspanel.cpp @@ -137,7 +137,7 @@ bool FoldersPanel::urlChanged() void FoldersPanel::reloadTree() { if (m_controller) { - loadTree(url(), true); + loadTree(url(), AllowJumpHome); } } @@ -316,7 +316,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 +327,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 +335,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 +349,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); diff --git a/src/panels/folders/folderspanel.h b/src/panels/folders/folderspanel.h index a653b45840..3b27dd3dda 100644 --- a/src/panels/folders/folderspanel.h +++ b/src/panels/folders/folderspanel.h @@ -85,13 +85,20 @@ private slots: private: + /** + * Indicate if it is allowed to leave current location. + */ + enum NavigationBehaviour { + StayWhereYouAre, ///< Don't leave current location. + AllowJumpHome ///< Go Home only when context menu option got checked. + }; /** * Initializes the base URL of the tree and expands all * directories until \a url. * @param url URL of the leaf directory that should get expanded. - * @param allowJumpHome indicate context menu got checked. + * @param navigationBehaviour Navigation behaviour \see NavigationBehaviour */ - void loadTree(const QUrl& url, bool allowJumpHome = false); + void loadTree(const QUrl& url, NavigationBehaviour navigationBehaviour = StayWhereYouAre); void reloadTree();