From 345e3e7a8276c12b481c3b6e91fb2e7ca6b6ab2b Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 21 Sep 2016 23:41:55 +0200 Subject: Follow changes in konqpopupmenu: no longer back/forward/up in part's contextmenu. --- src/dolphinpart.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 332f8e9b9..aa9ab2986 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -397,7 +397,6 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos, KFileItem item(_item); if (item.isNull()) { // viewport context menu - popupFlags |= KParts::BrowserExtension::ShowNavigationItems | KParts::BrowserExtension::ShowUp; item = m_view->rootItem(); if (item.isNull()) item = KFileItem(url()); -- cgit v1.3 From f54174f9f6b99aac433e81cad9965a7f31786ce7 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 2 Oct 2016 21:03:01 +0200 Subject: Popupmenu: use KIO 5.27's new addPluginActionsTo method REVIEW: 129085 --- src/dolphincontextmenu.cpp | 12 +++++++++--- src/dolphincontextmenu.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 971ef1e35..ed3f64379 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -283,7 +284,7 @@ void DolphinContextMenu::openItemContextMenu() fileItemActions.setItemListProperties(selectedItemsProps); addServiceActions(fileItemActions); - addFileItemPluginActions(); + addFileItemPluginActions(fileItemActions); addVersionControlPluginActions(); @@ -355,7 +356,7 @@ void DolphinContextMenu::openViewportContextMenu() fileItemActions.setItemListProperties(baseUrlProperties); addServiceActions(fileItemActions); - addFileItemPluginActions(); + addFileItemPluginActions(fileItemActions); addVersionControlPluginActions(); @@ -483,8 +484,12 @@ void DolphinContextMenu::addServiceActions(KFileItemActions& fileItemActions) fileItemActions.addServiceActionsTo(this); } -void DolphinContextMenu::addFileItemPluginActions() +void DolphinContextMenu::addFileItemPluginActions(KFileItemActions& fileItemActions) { +#if KIO_VERSION >= QT_VERSION_CHECK(5, 27, 0) + fileItemActions.addPluginActionsTo(this); +#else + Q_UNUSED(fileItemActions); KFileItemListProperties props; if (m_selectedItems.isEmpty()) { props.setItems(KFileItemList() << baseFileItem()); @@ -550,6 +555,7 @@ void DolphinContextMenu::addFileItemPluginActions() addedPlugins << jsonMetadata.pluginId(); } } +#endif } void DolphinContextMenu::addVersionControlPluginActions() diff --git a/src/dolphincontextmenu.h b/src/dolphincontextmenu.h index 419d3f9bd..f67300dc1 100644 --- a/src/dolphincontextmenu.h +++ b/src/dolphincontextmenu.h @@ -126,7 +126,7 @@ private: /** * Adds actions that are provided by a KFileItemActionPlugin. */ - void addFileItemPluginActions(); + void addFileItemPluginActions(KFileItemActions& fileItemActions); /** * Adds actions that are provided by a KVersionControlPlugin. -- cgit v1.3 From 0309bb18185f77c425cf7c69508f049c439eedb0 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 3 Oct 2016 01:05:42 +0200 Subject: Pass current dir explicitly to QUrl::fromUserInput It works with QString() but that's a bug, I didn't expect it to work with my fromUserInput code and wrote otherwise in its documentation... --- src/global.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/global.cpp b/src/global.cpp index d87a29c7a..3d6d7dd5e 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -24,9 +24,10 @@ QList Dolphin::validateUris(const QStringList& uriList) { + const QString currentDir = QDir::currentPath(); QList urls; foreach (const QString& str, uriList) { - const QUrl url = QUrl::fromUserInput(str, QString(), QUrl::AssumeLocalFile); + const QUrl url = QUrl::fromUserInput(str, currentDir, QUrl::AssumeLocalFile); if (url.isValid()) { urls.append(url); } else { -- cgit v1.3 From 0e5e43aa9d84b2a38db99c469de91e4de8017fc7 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Tue, 4 Oct 2016 17:30:51 +0200 Subject: Hide message widgets only when reloading the view Otherwise an error message might be hidden before it's even shown. BUG: 357651 FIXED-IN: 16.08.2 REVIEW: 129061 --- src/dolphinmainwindow.cpp | 2 +- src/dolphinviewcontainer.cpp | 8 ++++++-- src/dolphinviewcontainer.h | 5 +++++ 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 34008b5eb..e729ce972 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -526,7 +526,7 @@ void DolphinMainWindow::toggleSplitView() void DolphinMainWindow::reloadView() { clearStatusBar(); - m_activeViewContainer->view()->reload(); + m_activeViewContainer->reload(); } void DolphinMainWindow::stopLoading() diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 1c43fc977..4e625c7d8 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -98,8 +98,6 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) : m_urlNavigator, &KUrlNavigator::setLocationUrl); connect(m_view, &DolphinView::urlChanged, m_messageWidget, &KMessageWidget::hide); - connect(m_view, &DolphinView::directoryLoadingCompleted, - m_messageWidget, &KMessageWidget::hide); connect(m_view, &DolphinView::writeStateChanged, this, &DolphinViewContainer::writeStateChanged); connect(m_view, &DolphinView::requestItemInfo, @@ -368,6 +366,12 @@ QString DolphinViewContainer::placesText() const return text; } +void DolphinViewContainer::reload() +{ + view()->reload(); + m_messageWidget->hide(); +} + void DolphinViewContainer::setUrl(const QUrl& newUrl) { if (newUrl != m_urlNavigator->locationUrl()) { diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h index 62f91100e..0b6a76d5e 100644 --- a/src/dolphinviewcontainer.h +++ b/src/dolphinviewcontainer.h @@ -129,6 +129,11 @@ public: */ QString placesText() const; + /** + * Reload the view of this container. This will also hide messages in a messagewidget. + */ + void reload(); + public slots: /** * Sets the current active URL, where all actions are applied. The -- cgit v1.3 From 82cfc125f4fd37083e3adf3c5d2b999124262807 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Mon, 10 Oct 2016 09:41:54 +0000 Subject: 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 | 1 + src/settings/kcm/kcmdolphingeneral.desktop | 1 + src/settings/kcm/kcmdolphinnavigation.desktop | 1 + src/settings/kcm/kcmdolphinservices.desktop | 1 + src/settings/kcm/kcmdolphinviewmodes.desktop | 1 + 5 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/dolphinpart.desktop b/src/dolphinpart.desktop index a4bac816f..6b9398da8 100644 --- a/src/dolphinpart.desktop +++ b/src/dolphinpart.desktop @@ -124,6 +124,7 @@ Name[hu]=Kompakt Name[ia]=Compacte Name[id]=Sederhana Name[it]=Compatta +Name[ja]=コンパクト Name[ko]=축소됨 Name[lt]=Kompaktiškas Name[nb]=Kompakt diff --git a/src/settings/kcm/kcmdolphingeneral.desktop b/src/settings/kcm/kcmdolphingeneral.desktop index a6e3b6345..962fb7778 100644 --- a/src/settings/kcm/kcmdolphingeneral.desktop +++ b/src/settings/kcm/kcmdolphingeneral.desktop @@ -198,6 +198,7 @@ X-KDE-Keywords[hu]=fájlkezelő X-KDE-Keywords[ia]=gerente de file X-KDE-Keywords[id]=manajer berkas X-KDE-Keywords[it]=gestore dei file +X-KDE-Keywords[ja]=ファイルマネージャ X-KDE-Keywords[ko]=파일 관리자 X-KDE-Keywords[lt]=Failų tvarkyklė X-KDE-Keywords[nb]=filbehandler diff --git a/src/settings/kcm/kcmdolphinnavigation.desktop b/src/settings/kcm/kcmdolphinnavigation.desktop index b49d6a266..eaca4f141 100644 --- a/src/settings/kcm/kcmdolphinnavigation.desktop +++ b/src/settings/kcm/kcmdolphinnavigation.desktop @@ -199,6 +199,7 @@ X-KDE-Keywords[hu]=fájlkezelő X-KDE-Keywords[ia]=gerente de file X-KDE-Keywords[id]=manajer berkas X-KDE-Keywords[it]=gestore dei file +X-KDE-Keywords[ja]=ファイルマネージャ X-KDE-Keywords[ko]=파일 관리자 X-KDE-Keywords[lt]=Failų tvarkyklė X-KDE-Keywords[nb]=filbehandler diff --git a/src/settings/kcm/kcmdolphinservices.desktop b/src/settings/kcm/kcmdolphinservices.desktop index 3b27f9540..1775f7eff 100644 --- a/src/settings/kcm/kcmdolphinservices.desktop +++ b/src/settings/kcm/kcmdolphinservices.desktop @@ -154,6 +154,7 @@ X-KDE-Keywords[hu]=fájlkezelő X-KDE-Keywords[ia]=gerente de file X-KDE-Keywords[id]=manajer berkas X-KDE-Keywords[it]=gestore dei file +X-KDE-Keywords[ja]=ファイルマネージャ X-KDE-Keywords[ko]=파일 관리자 X-KDE-Keywords[lt]=Failų tvarkyklė X-KDE-Keywords[nb]=filbehandler diff --git a/src/settings/kcm/kcmdolphinviewmodes.desktop b/src/settings/kcm/kcmdolphinviewmodes.desktop index 568df4148..d1b5abe49 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.desktop +++ b/src/settings/kcm/kcmdolphinviewmodes.desktop @@ -199,6 +199,7 @@ X-KDE-Keywords[hu]=fájlkezelő X-KDE-Keywords[ia]=gerente de file X-KDE-Keywords[id]=manajer berkas X-KDE-Keywords[it]=gestore dei file +X-KDE-Keywords[ja]=ファイルマネージャ X-KDE-Keywords[ko]=파일 관리자 X-KDE-Keywords[lt]=Failų tvarkyklė X-KDE-Keywords[nb]=filbehandler -- cgit v1.3 From 8828e686e94056af17e0c13b7550451c881af060 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Mon, 10 Oct 2016 12:24:39 +0000 Subject: 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 | 1 + src/settings/kcm/kcmdolphingeneral.desktop | 1 + src/settings/kcm/kcmdolphinnavigation.desktop | 1 + src/settings/kcm/kcmdolphinservices.desktop | 1 + src/settings/kcm/kcmdolphinviewmodes.desktop | 1 + 5 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/dolphinpart.desktop b/src/dolphinpart.desktop index a4bac816f..6b9398da8 100644 --- a/src/dolphinpart.desktop +++ b/src/dolphinpart.desktop @@ -124,6 +124,7 @@ Name[hu]=Kompakt Name[ia]=Compacte Name[id]=Sederhana Name[it]=Compatta +Name[ja]=コンパクト Name[ko]=축소됨 Name[lt]=Kompaktiškas Name[nb]=Kompakt diff --git a/src/settings/kcm/kcmdolphingeneral.desktop b/src/settings/kcm/kcmdolphingeneral.desktop index a6e3b6345..962fb7778 100644 --- a/src/settings/kcm/kcmdolphingeneral.desktop +++ b/src/settings/kcm/kcmdolphingeneral.desktop @@ -198,6 +198,7 @@ X-KDE-Keywords[hu]=fájlkezelő X-KDE-Keywords[ia]=gerente de file X-KDE-Keywords[id]=manajer berkas X-KDE-Keywords[it]=gestore dei file +X-KDE-Keywords[ja]=ファイルマネージャ X-KDE-Keywords[ko]=파일 관리자 X-KDE-Keywords[lt]=Failų tvarkyklė X-KDE-Keywords[nb]=filbehandler diff --git a/src/settings/kcm/kcmdolphinnavigation.desktop b/src/settings/kcm/kcmdolphinnavigation.desktop index b49d6a266..eaca4f141 100644 --- a/src/settings/kcm/kcmdolphinnavigation.desktop +++ b/src/settings/kcm/kcmdolphinnavigation.desktop @@ -199,6 +199,7 @@ X-KDE-Keywords[hu]=fájlkezelő X-KDE-Keywords[ia]=gerente de file X-KDE-Keywords[id]=manajer berkas X-KDE-Keywords[it]=gestore dei file +X-KDE-Keywords[ja]=ファイルマネージャ X-KDE-Keywords[ko]=파일 관리자 X-KDE-Keywords[lt]=Failų tvarkyklė X-KDE-Keywords[nb]=filbehandler diff --git a/src/settings/kcm/kcmdolphinservices.desktop b/src/settings/kcm/kcmdolphinservices.desktop index 3b27f9540..1775f7eff 100644 --- a/src/settings/kcm/kcmdolphinservices.desktop +++ b/src/settings/kcm/kcmdolphinservices.desktop @@ -154,6 +154,7 @@ X-KDE-Keywords[hu]=fájlkezelő X-KDE-Keywords[ia]=gerente de file X-KDE-Keywords[id]=manajer berkas X-KDE-Keywords[it]=gestore dei file +X-KDE-Keywords[ja]=ファイルマネージャ X-KDE-Keywords[ko]=파일 관리자 X-KDE-Keywords[lt]=Failų tvarkyklė X-KDE-Keywords[nb]=filbehandler diff --git a/src/settings/kcm/kcmdolphinviewmodes.desktop b/src/settings/kcm/kcmdolphinviewmodes.desktop index 568df4148..d1b5abe49 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.desktop +++ b/src/settings/kcm/kcmdolphinviewmodes.desktop @@ -199,6 +199,7 @@ X-KDE-Keywords[hu]=fájlkezelő X-KDE-Keywords[ia]=gerente de file X-KDE-Keywords[id]=manajer berkas X-KDE-Keywords[it]=gestore dei file +X-KDE-Keywords[ja]=ファイルマネージャ X-KDE-Keywords[ko]=파일 관리자 X-KDE-Keywords[lt]=Failų tvarkyklė X-KDE-Keywords[nb]=filbehandler -- cgit v1.3 From 57a19efe93dd1e899c3e2e061ebca84d1e90ce46 Mon Sep 17 00:00:00 2001 From: Safa AlFulaij Date: Wed, 12 Oct 2016 14:31:35 +0300 Subject: The tab navigation shortcut workaround for RTL layouts is not needed anymore, as Qt supports that by default. Before this, pressing Ctrl+Tab makes the previous tab (in RTL layout) the activated one, and vice versa. REVIEW: 128853 --- src/dolphinmainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 4d97fc1b1..3a23bfa3c 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1130,14 +1130,14 @@ void DolphinMainWindow::setupActions() activateNextTab->setText(i18nc("@action:inmenu", "Activate Next Tab")); activateNextTab->setEnabled(false); connect(activateNextTab, &QAction::triggered, m_tabWidget, &DolphinTabWidget::activateNextTab); - actionCollection()->setDefaultShortcuts(activateNextTab, QApplication::isRightToLeft() ? prevTabKeys : nextTabKeys); + actionCollection()->setDefaultShortcuts(activateNextTab, nextTabKeys); QAction* activatePrevTab = actionCollection()->addAction(QStringLiteral("activate_prev_tab")); activatePrevTab->setIconText(i18nc("@action:inmenu", "Previous Tab")); activatePrevTab->setText(i18nc("@action:inmenu", "Activate Previous Tab")); activatePrevTab->setEnabled(false); connect(activatePrevTab, &QAction::triggered, m_tabWidget, &DolphinTabWidget::activatePrevTab); - actionCollection()->setDefaultShortcuts(activatePrevTab, QApplication::isRightToLeft() ? nextTabKeys : prevTabKeys); + actionCollection()->setDefaultShortcuts(activatePrevTab, prevTabKeys); // for context menu QAction* openInNewTab = actionCollection()->addAction(QStringLiteral("open_in_new_tab")); -- cgit v1.3 From 95e1505c9f01bdae2c1157be1bb6fa5b991c8fd4 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Fri, 28 Oct 2016 13:40:50 +0200 Subject: [Places Item Edit Dialog] Fix accepting dialog with Return By setting a parent for the QDialogButtonBox we let QDialog handle everything by itself. Also, store the dialog button box as a member rather than just the OK button. This removes the need to set the OK button as default manually (which didn't work anyway) and fixes pressing Return while the input is focused erroneously opening the folder browser rather than accepting the dialog. REVIEW: 129213 --- src/panels/places/placesitemeditdialog.cpp | 17 +++++++---------- src/panels/places/placesitemeditdialog.h | 4 ++-- 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/panels/places/placesitemeditdialog.cpp b/src/panels/places/placesitemeditdialog.cpp index 7d365310f..ffcac4c8f 100644 --- a/src/panels/places/placesitemeditdialog.cpp +++ b/src/panels/places/placesitemeditdialog.cpp @@ -47,7 +47,8 @@ PlacesItemEditDialog::PlacesItemEditDialog(QWidget* parent) : m_urlEdit(0), m_textEdit(0), m_iconButton(0), - m_appLocal(0) + m_appLocal(0), + m_buttonBox(nullptr) { } @@ -106,7 +107,7 @@ bool PlacesItemEditDialog::event(QEvent* event) void PlacesItemEditDialog::slotUrlChanged(const QString& text) { - m_okButton->setEnabled(!text.isEmpty()); + m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!text.isEmpty()); } PlacesItemEditDialog::~PlacesItemEditDialog() @@ -115,20 +116,16 @@ PlacesItemEditDialog::~PlacesItemEditDialog() void PlacesItemEditDialog::initialize() { - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); - m_okButton = buttonBox->button(QDialogButtonBox::Ok); - m_okButton->setDefault(true); - m_okButton->setShortcut(Qt::CTRL | Qt::Key_Return); - connect(buttonBox, &QDialogButtonBox::accepted, this, &PlacesItemEditDialog::accept); - connect(buttonBox, &QDialogButtonBox::rejected, this, &PlacesItemEditDialog::reject); + m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this); + connect(m_buttonBox, &QDialogButtonBox::accepted, this, &PlacesItemEditDialog::accept); + connect(m_buttonBox, &QDialogButtonBox::rejected, this, &PlacesItemEditDialog::reject); setModal(true); - m_okButton->setDefault(true); QVBoxLayout *mainLayout = new QVBoxLayout; setLayout(mainLayout); QWidget* mainWidget = new QWidget(this); mainLayout->addWidget(mainWidget); - mainLayout->addWidget(buttonBox); + mainLayout->addWidget(m_buttonBox); QVBoxLayout* vBox = new QVBoxLayout(mainWidget); diff --git a/src/panels/places/placesitemeditdialog.h b/src/panels/places/placesitemeditdialog.h index 8a0dc0471..f2d69781a 100644 --- a/src/panels/places/placesitemeditdialog.h +++ b/src/panels/places/placesitemeditdialog.h @@ -31,7 +31,7 @@ class KIconButton; class KUrlRequester; class QLineEdit; class QCheckBox; -class QPushButton; +class QDialogButtonBox; class PlacesItemEditDialog: public QDialog { @@ -72,7 +72,7 @@ private: QLineEdit* m_textEdit; KIconButton* m_iconButton; QCheckBox* m_appLocal; - QPushButton *m_okButton; + QDialogButtonBox *m_buttonBox; }; #endif -- cgit v1.3 From 90beb4a5e37b887caad1e767046a42dad0af1ab3 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sun, 20 Nov 2016 12:21:29 +0100 Subject: Fix slow scrolling in dock panels Commit f688bcd1f1 fixed slow scrolling with xf86-input-libinput on DolphinView. However the commit also exposed a bug in the Dolphin scrolling algorithm, which was previously hidden. This resulted in slow scrolling in dock panels (Places and Folders), with both xf86-input-evdev and xf86-input-libinput drivers, as well as libinput on Wayland. KItemListContainer::updateScrollOffsetScrollBar() relied on the view's itemSize() method to compute the scrollbar's singleStep, but this QSize was invalid for the dock panels' views. We use a new itemSizeHint() method instead, which is always valid and also adapts to the current icon size set in the view. BUG: 365968 FIXED-IN: 16.12.0 REVIEW: 129409 --- src/kitemviews/kitemlistcontainer.cpp | 2 +- src/kitemviews/kitemlistview.cpp | 5 +++++ src/kitemviews/kitemlistview.h | 7 ++++++- src/kitemviews/private/kitemlistsizehintresolver.cpp | 13 +++++++++++++ src/kitemviews/private/kitemlistsizehintresolver.h | 2 ++ 5 files changed, 27 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/kitemviews/kitemlistcontainer.cpp b/src/kitemviews/kitemlistcontainer.cpp index 6974ebb48..6a0c5756c 100644 --- a/src/kitemviews/kitemlistcontainer.cpp +++ b/src/kitemviews/kitemlistcontainer.cpp @@ -265,7 +265,7 @@ void KItemListContainer::updateScrollOffsetScrollBar() if (view->scrollOrientation() == Qt::Vertical) { smoothScroller = m_verticalSmoothScroller; scrollOffsetScrollBar = verticalScrollBar(); - singleStep = view->itemSize().height(); + singleStep = view->itemSizeHint().height(); // We cannot use view->size().height() because this height might // include the header widget, which is not part of the scrolled area. pageStep = view->verticalPageStep(); diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index df6539929..d840509da 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -344,6 +344,11 @@ QSizeF KItemListView::itemSize() const return m_itemSize; } +QSizeF KItemListView::itemSizeHint() const +{ + return m_sizeHintResolver->maxSizeHint(); +} + const KItemListStyleOption& KItemListView::styleOption() const { return m_styleOption; diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h index 9adf9f86f..c93297c47 100644 --- a/src/kitemviews/kitemlistview.h +++ b/src/kitemviews/kitemlistview.h @@ -154,10 +154,15 @@ public: /** * @return The basic size of all items. The size of an item may be larger than - * the basic size (see KItemListView::itemSizeHint() and KItemListView::itemRect()). + * the basic size (see KItemListView::itemRect()). */ QSizeF itemSize() const; + /** + * @return The size hint of all items. It is provided by the KItemListSizeHintResolver. + */ + QSizeF itemSizeHint() const; + const KItemListStyleOption& styleOption() const; virtual void setGeometry(const QRectF& rect) Q_DECL_OVERRIDE; diff --git a/src/kitemviews/private/kitemlistsizehintresolver.cpp b/src/kitemviews/private/kitemlistsizehintresolver.cpp index 1d8067026..02f1865b3 100644 --- a/src/kitemviews/private/kitemlistsizehintresolver.cpp +++ b/src/kitemviews/private/kitemlistsizehintresolver.cpp @@ -25,6 +25,7 @@ KItemListSizeHintResolver::KItemListSizeHintResolver(const KItemListView* itemLi m_itemListView(itemListView), m_logicalHeightHintCache(), m_logicalWidthHint(0.0), + m_logicalHeightHint(0.0), m_needsResolving(false) { } @@ -33,6 +34,12 @@ KItemListSizeHintResolver::~KItemListSizeHintResolver() { } +QSizeF KItemListSizeHintResolver::maxSizeHint() +{ + updateCache(); + return QSizeF(m_logicalWidthHint, m_logicalHeightHint); +} + QSizeF KItemListSizeHintResolver::sizeHint(int index) { updateCache(); @@ -149,6 +156,12 @@ void KItemListSizeHintResolver::updateCache() { if (m_needsResolving) { m_itemListView->calculateItemSizeHints(m_logicalHeightHintCache, m_logicalWidthHint); + // Set logical height as the max cached height (if the cache is not empty). + if (m_logicalHeightHintCache.isEmpty()) { + m_logicalHeightHint = 0.0; + } else { + m_logicalHeightHint = *std::max_element(m_logicalHeightHintCache.begin(), m_logicalHeightHintCache.end()); + } m_needsResolving = false; } } diff --git a/src/kitemviews/private/kitemlistsizehintresolver.h b/src/kitemviews/private/kitemlistsizehintresolver.h index ff17f2de2..841e9ca10 100644 --- a/src/kitemviews/private/kitemlistsizehintresolver.h +++ b/src/kitemviews/private/kitemlistsizehintresolver.h @@ -36,6 +36,7 @@ class DOLPHIN_EXPORT KItemListSizeHintResolver public: KItemListSizeHintResolver(const KItemListView* itemListView); virtual ~KItemListSizeHintResolver(); + QSizeF maxSizeHint(); QSizeF sizeHint(int index); void itemsInserted(const KItemRangeList& itemRanges); @@ -50,6 +51,7 @@ private: const KItemListView* m_itemListView; mutable QVector m_logicalHeightHintCache; mutable qreal m_logicalWidthHint; + mutable qreal m_logicalHeightHint; bool m_needsResolving; }; -- cgit v1.3 From 88805f7fad91b8d082f962462d1f8030a9c070c1 Mon Sep 17 00:00:00 2001 From: Don Nguyen Date: Mon, 21 Nov 2016 17:41:01 +0100 Subject: Call columnWidthChanged with actual previous width REVIEW: 129334 --- src/kitemviews/kitemlistwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/kitemviews/kitemlistwidget.cpp b/src/kitemviews/kitemlistwidget.cpp index 9c31155b3..65fc911bd 100644 --- a/src/kitemviews/kitemlistwidget.cpp +++ b/src/kitemviews/kitemlistwidget.cpp @@ -179,8 +179,8 @@ QList KItemListWidget::visibleRoles() const void KItemListWidget::setColumnWidth(const QByteArray& role, qreal width) { - if (m_columnWidths.value(role) != width) { - const qreal previousWidth = width; + const qreal previousWidth = m_columnWidths.value(role); + if (previousWidth != width) { m_columnWidths.insert(role, width); columnWidthChanged(role, width, previousWidth); update(); -- cgit v1.3 From ded92cc32ada1fd3fc8bcc90d8dc07f6d3ab291c Mon Sep 17 00:00:00 2001 From: "R.J.V. Bertin" Date: Tue, 22 Nov 2016 17:55:34 +0100 Subject: Use the current window icon in QIcon::fromTheme() This prevents removing the application icon when icon lookup fails, on Mac or MS Windows. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 8987d351f..acba8daed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,7 +39,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) { QApplication app(argc, argv); app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); - app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"))); + app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon())); KCrash::initialize(); -- cgit v1.3 From b6e76f006d0d40e8475e8129fc56a509f963a7c1 Mon Sep 17 00:00:00 2001 From: "R.J.V. Bertin" Date: Tue, 22 Nov 2016 18:15:42 +0100 Subject: Add application icon for Mac and MS Windows. Uses the Oxygen theme because it fits in better with prevailent icons on those platforms. --- src/CMakeLists.txt | 6 ++++-- src/icons/128-system-file-manager.png | Bin 0 -> 11652 bytes src/icons/16-system-file-manager.png | Bin 0 -> 566 bytes src/icons/22-system-file-manager.png | Bin 0 -> 802 bytes src/icons/32-system-file-manager.png | Bin 0 -> 1273 bytes src/icons/48-system-file-manager.png | Bin 0 -> 3145 bytes src/icons/64-system-file-manager.png | Bin 0 -> 4522 bytes 7 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 src/icons/128-system-file-manager.png create mode 100644 src/icons/16-system-file-manager.png create mode 100644 src/icons/22-system-file-manager.png create mode 100644 src/icons/32-system-file-manager.png create mode 100644 src/icons/48-system-file-manager.png create mode 100644 src/icons/64-system-file-manager.png (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 069096814..62d11584e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,4 @@ +include(ECMAddAppIcon) configure_file(config-baloo.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-baloo.h) @@ -268,8 +269,9 @@ if(NOT WIN32) set(dolphin_SRCS ${dolphin_SRCS} panels/terminal/terminalpanel.cpp) endif() -# TODO Does anything replace kde4_add_app_icon ? -#kde4_add_app_icon(dolphin_SRCS "${KDE4_ICON_INSTALL_DIR}/oxygen/*/apps/system-file-manager.png") +# Sets the icon on Windows and OSX +file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png") +ecm_add_app_icon(dolphin_SRCS ICONS ${ICONS_SRCS}) kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS}) diff --git a/src/icons/128-system-file-manager.png b/src/icons/128-system-file-manager.png new file mode 100644 index 000000000..a199a712f Binary files /dev/null and b/src/icons/128-system-file-manager.png differ diff --git a/src/icons/16-system-file-manager.png b/src/icons/16-system-file-manager.png new file mode 100644 index 000000000..2771c8543 Binary files /dev/null and b/src/icons/16-system-file-manager.png differ diff --git a/src/icons/22-system-file-manager.png b/src/icons/22-system-file-manager.png new file mode 100644 index 000000000..ac0c54aca Binary files /dev/null and b/src/icons/22-system-file-manager.png differ diff --git a/src/icons/32-system-file-manager.png b/src/icons/32-system-file-manager.png new file mode 100644 index 000000000..c095d42d5 Binary files /dev/null and b/src/icons/32-system-file-manager.png differ diff --git a/src/icons/48-system-file-manager.png b/src/icons/48-system-file-manager.png new file mode 100644 index 000000000..a742a7344 Binary files /dev/null and b/src/icons/48-system-file-manager.png differ diff --git a/src/icons/64-system-file-manager.png b/src/icons/64-system-file-manager.png new file mode 100644 index 000000000..9a7ebdec4 Binary files /dev/null and b/src/icons/64-system-file-manager.png differ -- cgit v1.3 From 73a6bf4e10dc5d49b5752a9bd23fc332075da244 Mon Sep 17 00:00:00 2001 From: Spencer Brown Date: Sat, 3 Dec 2016 15:58:39 +0100 Subject: Fix 5 clazy warnings This bumps the minimum Qt version to 5.5 (because of Q_ENUM usage). REVIEW: 129604 --- CMakeLists.txt | 2 +- src/kitemviews/kitemlistcontroller.h | 2 +- src/tests/kfileitemmodeltest.cpp | 6 +++--- src/tests/kitemsettest.cpp | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d5c1c045..814c00ff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set (KDE_APPLICATIONS_VERSION_MINOR "03") set (KDE_APPLICATIONS_VERSION_MICRO "70") set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}") -set(QT_MIN_VERSION "5.4.0") +set(QT_MIN_VERSION "5.5.0") set(KF5_MIN_VERSION "5.21.0") set(ECM_MIN_VERSION "1.6.0") diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h index b8a93edac..5e5e6b7c3 100644 --- a/src/kitemviews/kitemlistcontroller.h +++ b/src/kitemviews/kitemlistcontroller.h @@ -59,7 +59,6 @@ class QTransform; class DOLPHIN_EXPORT KItemListController : public QObject { Q_OBJECT - Q_ENUMS(SelectionBehavior) Q_PROPERTY(KItemModelBase* model READ model WRITE setModel) Q_PROPERTY(KItemListView *view READ view WRITE setView) Q_PROPERTY(SelectionBehavior selectionBehavior READ selectionBehavior WRITE setSelectionBehavior) @@ -72,6 +71,7 @@ public: SingleSelection, MultiSelection }; + Q_ENUM(SelectionBehavior) enum AutoActivationBehavior { ActivationAndExpansion, diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp index 6c45e114b..ac15693b6 100644 --- a/src/tests/kfileitemmodeltest.cpp +++ b/src/tests/kfileitemmodeltest.cpp @@ -154,9 +154,9 @@ void KFileItemModelTest::testDefaultSortRole() QVERIFY(itemsInsertedSpy.wait()); QCOMPARE(m_model->count(), 3); - QCOMPARE(m_model->data(0)["text"].toString(), QString("a.txt")); - QCOMPARE(m_model->data(1)["text"].toString(), QString("b.txt")); - QCOMPARE(m_model->data(2)["text"].toString(), QString("c.txt")); + QCOMPARE(m_model->data(0).value("text").toString(), QString("a.txt")); + QCOMPARE(m_model->data(1).value("text").toString(), QString("b.txt")); + QCOMPARE(m_model->data(2).value("text").toString(), QString("c.txt")); } void KFileItemModelTest::testDefaultGroupedSorting() diff --git a/src/tests/kitemsettest.cpp b/src/tests/kitemsettest.cpp index 0d14e20fa..f559475a6 100644 --- a/src/tests/kitemsettest.cpp +++ b/src/tests/kitemsettest.cpp @@ -72,14 +72,14 @@ QVector KItemRangeList2QVector(const KItemRangeList& itemRanges) static QSet KItemSet2QSet(const KItemSet& itemSet) { QSet result; - foreach (int i, itemSet) { + for (int i : itemSet) { result.insert(i); } // Check that the conversion was successful. Q_ASSERT(itemSet.count() == result.count()); - foreach (int i, itemSet) { + for (int i : itemSet) { Q_ASSERT(result.contains(i)); } @@ -239,7 +239,7 @@ void KItemSetTest::testIterators() QCOMPARE(testQVector, itemsQVector); testQVector.clear(); - foreach (int i, itemSet) { + for (int i : itemSet) { testQVector.append(i); } QCOMPARE(testQVector, itemsQVector); -- cgit v1.3 From abb7799f7e007601a5f75ea85d9081bdb4d06a0a Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sat, 3 Dec 2016 18:04:24 +0100 Subject: Fix viewpropertiestest when GlobalViewProps is true The test was not saving its changes to the global settings, so it was passing on the CI only because the default value of GlobalViewProps is already false. If GlobalViewProps was set to true instead, testAutoSave() would fail because save() was not called and GlobalViewProps was not --- src/tests/viewpropertiestest.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/tests/viewpropertiestest.cpp b/src/tests/viewpropertiestest.cpp index 482e4127d..114afdc33 100644 --- a/src/tests/viewpropertiestest.cpp +++ b/src/tests/viewpropertiestest.cpp @@ -44,6 +44,7 @@ void ViewPropertiesTest::init() { m_globalViewProps = GeneralSettings::self()->globalViewProps(); GeneralSettings::self()->setGlobalViewProps(false); + GeneralSettings::self()->save(); // It is mandatory to create the test-directory inside the home-directory // of the user: ViewProperties does not write inside directories @@ -58,6 +59,7 @@ void ViewPropertiesTest::cleanup() m_testDir = 0; GeneralSettings::self()->setGlobalViewProps(m_globalViewProps); + GeneralSettings::self()->save(); } /** -- cgit v1.3 From 16db90c7938d09bfa8916afef8cce8dd258fa00d Mon Sep 17 00:00:00 2001 From: Jonathan Marten Date: Tue, 6 Dec 2016 06:57:00 +0000 Subject: Dolphin Part: Update the paste action at the end of the listing Fixes a problem with the paste action not being enabled, only seen in Konqueror. BUG:369523 REVIEW:129448 --- src/dolphinpart.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index aa9ab2986..b55bcabb2 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -78,6 +78,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL this, &DolphinPart::slotErrorMessage); connect(m_view, &DolphinView::directoryLoadingCompleted, this, static_cast(&DolphinPart::completed)); + connect(m_view, &DolphinView::directoryLoadingCompleted, this, &DolphinPart::updatePasteAction); connect(m_view, &DolphinView::directoryLoadingProgress, this, &DolphinPart::updateProgress); connect(m_view, &DolphinView::errorMessage, this, &DolphinPart::slotErrorMessage); -- cgit v1.3 From d690b0719f3c48f65763df790e1f5c19dcc327a5 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Tue, 20 Dec 2016 08:11:02 +0100 Subject: GIT_SILENT made messages (after extraction) --- src/org.kde.dolphin.appdata.xml | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src') diff --git a/src/org.kde.dolphin.appdata.xml b/src/org.kde.dolphin.appdata.xml index d0cec5030..7bbe42a96 100644 --- a/src/org.kde.dolphin.appdata.xml +++ b/src/org.kde.dolphin.appdata.xml @@ -48,7 +48,6 @@ Dolphin File Manager مدير ملفات - Xestor de ficheros Upravitelj datoteka Gestor de fitxers Gestor de fitxers @@ -93,7 +92,6 @@

Dolphin is a lightweight file manager. It has been designed with ease of use and simplicity in mind, while still allowing flexibility and customisation. This means that you can do your file management exactly the way you want to do it.

دولفين هو مدير ملفات خفيف. صُمِّم دولفين مع أخذ سهولة الاستخدام والبساطة بعين الاعتبار، مع السماح بالمرونة والتخصيص. يعني هذا أنه يمكنك إدارة ملفاتك كما تريد تمامًا.

-

Dolphin ye un xestor de ficheros llixeru. Diseñóse cola facilidá d'usu y cenciellez na miente entrín entá permite la flexibilidá y personalización. Esto quier dicir que pues facer la to xestión de ficheros exautamente como tu quies facela.

Dolphinje lagan file manager. On je bio dizajniran sa lakoćom korišćenja i jednostavnosti u vidu, još omogućavajući fleksibilnost i prilagođavanje. To znači da možete da radite svoje upravljanje datotekama onako kako želite da to uradi.

El Dolphin és un gestor de fitxers lleuger. S'ha dissenyat pensant a facilitar el seu ús i que sigui simple, permetent la flexibilitat i la personalització. Això vol dir que podeu fer la gestió dels vostres fitxers de la manera exacta com ho vulgueu fer.

El Dolphin és un gestor de fitxers lleuger. S'ha dissenyat pensant a facilitar el seu ús i que siga simple, permetent la flexibilitat i la personalització. Això vol dir que podeu fer la gestió dels vostres fitxers de la manera exacta com ho vulgueu fer.

@@ -133,7 +131,6 @@

Dolphin 是一套輕量級的檔案管理員。它設計的理念是易用與簡單,但仍然保持足夠的彈性。這表示您可以用您想要使用的方式來管理您的檔案。

Features:

المزايا:

-

Carauterístiques

Svojstva:

Característiques:

Característiques:

@@ -177,7 +174,6 @@

功能:

  • Navigation (or breadcrumb) bar for URLs, allowing you to quickly navigate through the hierarchy of files and folders.
  • -
  • Barra de navegación
  • Navigacijska (ili mrvična) traka za URL, dopušta vam da se brzo krećete kroz hijerarhiju datoteka i direktorija.
  • Barra de navegació (o fil d'Ariadna) pels URL, permetent una navegació ràpida per la jerarquia dels fitxers i carpetes.
  • Barra de navegació (o fil d'Ariadna) pels URL, permetent una navegació ràpida per la jerarquia dels fitxers i carpetes.
  • @@ -215,7 +211,6 @@
  • 網址導覽列讓您可以快速瀏覽檔案與資料夾。
  • Supports several different kinds of view styles and properties and allows you to configure the view exactly how you want it.
  • يدعم العديد من الأنواع المختلفة من الخصائص وأنماط العرض ويسمح لك بضبط العرض كما تريد تمامًا.
  • -
  • Sofitalla delles tribes de vista y propiedaes diferentes y permítete configurar la vista exautamente como tu quies.
  • Dopušta vište vrsta stilova pogleda i svojstava i dopšta vam da konfigurišete pogled baš kako želite.
  • Accepta diferents classes diverses d'estils de visualització i propietats i us permet configurar la visualització exactament com la vulgueu.
  • Accepta diferents classes diverses d'estils de visualització i propietats i vos permet configurar la visualització exactament com la vulgueu.
  • @@ -254,7 +249,6 @@
  • 網址導覽列讓您可以快速瀏覽檔案與資料夾。
  • Split view, allowing you to easily copy or move files between locations.
  • العرض المقسوم، يسمح لك بنسخ ونقل الملفات بين مكانين بسهولة.
  • -
  • Vista dixebrada, permítete copiar y mover ficheros d'un mou cenciellu ente allugamientos.
  • Razdvaja pogled, dopuštajući lako kopiranje ili pomijeranje datoteka između lokacija
  • Divisió de visualització, permetent copiar o moure fitxers fàcilment entre les ubicacions.
  • Divisió de visualització, permetent copiar o moure fitxers fàcilment entre les ubicacions.
  • @@ -293,7 +287,6 @@
  • 支援數個檢視模式,您也可以調整檢視模式的屬性。
  • Additional information and shortcuts are available as dock-able panels, allowing you to move them around freely and display exactly what you want.
  • تتوفر معلومات واختصارات إضافية كلوحات قابلة للرصف، مما يسمح لك بنقلها بحريّة وعرضها بالضبط كما تريد.
  • -
  • Tán disponibles atayos ya información adicional como paneles anclables, permitiéndote movelos pehí d'un mou llibre y amosar exautamente lo tu quies.
  • Dodatne informacije i kratice su dostupne kao usidreni paneli, dopuštajući vam da se krećete slobodno i prikažete šta želite.
  • Hi ha informació addicional i dreceres disponibles com a plafons que es poden acoblar, permetent moure'ls lliurement i mostrar exactament el què vulgueu.
  • Hi ha informació addicional i dreceres disponibles com a plafons que es poden acoblar, permetent moure'ls lliurement i mostrar exactament el què vulgueu.
  • @@ -331,7 +324,6 @@
  • 分割檢視讓您可以輕鬆複製或移動檔案。
  • Multiple tab support
  • دعم تعدّد الألسنة
  • -
  • Sofitu de múltiples llingüetes
  • Podrška za više kartica
  • Admet pestanyes múltiples
  • Admet pestanyes múltiples
  • @@ -374,7 +366,6 @@
  • 額外資訊與嵌入式面板捷徑讓您可以輕易顯示您常用的項目。
  • Informational dialogues are displayed in an unobtrusive way.
  • حواريات المعلومات تُعرَض بطريقة غير مُزعجة.
  • -
  • Los diálogos d'información amuésense d'un mou discretu.
  • Informativni dijalozi su prikazani na nenametljiv način.
  • Els diàlegs informatius es mostren d'una manera no molesta.
  • Els diàlegs informatius es mostren d'una manera no molesta.
  • @@ -412,7 +403,6 @@
  • 支援多分頁
  • Undo/redo support
  • دعم التراجع والإعادة
  • -
  • Sofitu de desfechura/refechura
  • Podrška za poništavanje/ponavljanje akcija
  • Admet desfer/refer
  • Admet desfer/refer
  • @@ -454,7 +444,6 @@
  • 以不唐突的方式顯示資訊對話框。
  • Transparent network access through the KIO system.
  • اتصال شبكيّ مباشر باستخدام نظام KIO.
  • -
  • Accesu tresparente a la rede pente'l sistema KIO.
  • Transparentni mrežni pristup kroz KIO sistem.
  • Accés transparent a la xarxa a través del sistema KIO.
  • Accés transparent a la xarxa a través del sistema KIO.
  • -- cgit v1.3 From ae935d36b1565dd9a763f022caac5863071711fa Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Tue, 20 Dec 2016 12:38:21 +0100 Subject: 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 | 3 --- src/org.kde.dolphin.desktop | 2 -- src/settings/kcm/kcmdolphingeneral.desktop | 5 ----- src/settings/kcm/kcmdolphinnavigation.desktop | 5 ----- src/settings/kcm/kcmdolphinservices.desktop | 4 ---- src/settings/kcm/kcmdolphinviewmodes.desktop | 5 ----- src/views/versioncontrol/fileviewversioncontrolplugin.desktop | 1 - 7 files changed, 25 deletions(-) (limited to 'src') diff --git a/src/dolphinpart.desktop b/src/dolphinpart.desktop index 6b9398da8..9b3089542 100644 --- a/src/dolphinpart.desktop +++ b/src/dolphinpart.desktop @@ -2,7 +2,6 @@ Type=Service Name=Dolphin View Name[ar]=منظور دولفين -Name[ast]=Vista de Dolphin Name[ca]=Vista del Dolphin Name[ca@valencia]=Vista del Dolphin Name[cs]=Pohled Dolphin @@ -107,7 +106,6 @@ Exec=dolphin [Desktop Action compact] Name=Compact Name[ar]=متراصّ -Name[ast]=Compautu Name[ca]=Compacta Name[ca@valencia]=Compacta Name[cs]=Kompaktní @@ -154,7 +152,6 @@ Exec=dolphin [Desktop Action details] Name=Details Name[ar]=التّفاصيل -Name[ast]=Detalles Name[ca]=Detalls Name[ca@valencia]=Detalls Name[cs]=Podrobnosti diff --git a/src/org.kde.dolphin.desktop b/src/org.kde.dolphin.desktop index 63b72d966..f50ef2b6c 100755 --- a/src/org.kde.dolphin.desktop +++ b/src/org.kde.dolphin.desktop @@ -1,7 +1,6 @@ [Desktop Entry] Name=Dolphin Name[ar]=دولفين -Name[ast]=Dolphin Name[ca]=Dolphin Name[ca@valencia]=Dolphin Name[cs]=Dolphin @@ -49,7 +48,6 @@ X-DocPath=dolphin/index.html Categories=Qt;KDE;System;FileTools;FileManager; GenericName=File Manager GenericName[ar]=مدير ملفّات -GenericName[ast]=Xestor de ficheros GenericName[ca]=Gestor de fitxers GenericName[ca@valencia]=Gestor de fitxers GenericName[cs]=Správce souborů diff --git a/src/settings/kcm/kcmdolphingeneral.desktop b/src/settings/kcm/kcmdolphingeneral.desktop index 962fb7778..499fe7391 100644 --- a/src/settings/kcm/kcmdolphingeneral.desktop +++ b/src/settings/kcm/kcmdolphingeneral.desktop @@ -1,6 +1,5 @@ Name=Dolphin General Name[ar]=دولفين العامّ -Name[ast]=Xeneral de Dolphin Name[ca]=General del Dolphin Name[ca@valencia]=General del Dolphin Name[cs]=Obecný Dolphin @@ -43,7 +42,6 @@ Name[zh_CN]=Dolphin 常规 Name[zh_TW]=Dolphin 一般 Comment=This service allows configuration of general Dolphin settings. Comment[ar]=تسمح هذه الخدمة بضبط إعدادات دولفين العامّة. -Comment[ast]=Esti serviciu permite la configuración de los axustes xenerales de Dolphin. Comment[ca]=Aquest servei permet la configuració de l'arranjament general del Dolphin. Comment[ca@valencia]=Este servei permet la configuració de l'arranjament general del Dolphin. Comment[cs]=Tato služba umožňuje obecné nastavení Dolphinu. @@ -97,7 +95,6 @@ X-DocPath=dolphin/index.html#preferences-dialog-general # ctxt: Random file browsing settings. Name=General Name[ar]=عامّ -Name[ast]=Xeneral Name[ca]=General Name[ca@valencia]=General Name[cs]=Obecné @@ -139,7 +136,6 @@ Name[zh_CN]=常规 Name[zh_TW]=一般 Comment=Configure general file manager settings Comment[ar]=اضبط إعدادات مدير الملفّات العامّة -Comment[ast]=Configura los axustes xenerales del xestor de ficheros Comment[ca]=Configura les opcions generals del gestor de fitxers Comment[ca@valencia]=Configura les opcions generals del gestor de fitxers Comment[cs]=Obecné nastavení správce souborů @@ -181,7 +177,6 @@ Comment[zh_CN]=配置常规文件管理器设置 Comment[zh_TW]=設定一般檔案管理員 X-KDE-Keywords=file manager X-KDE-Keywords[ar]=مدير ملفّات ملفات الملفّات الملفات -X-KDE-Keywords[ast]=xestor de ficheros X-KDE-Keywords[ca]=gestor de fitxers X-KDE-Keywords[ca@valencia]=gestor de fitxers X-KDE-Keywords[cs]=správce souborů diff --git a/src/settings/kcm/kcmdolphinnavigation.desktop b/src/settings/kcm/kcmdolphinnavigation.desktop index eaca4f141..e03a336de 100644 --- a/src/settings/kcm/kcmdolphinnavigation.desktop +++ b/src/settings/kcm/kcmdolphinnavigation.desktop @@ -1,6 +1,5 @@ Name=Dolphin Navigation Name[ar]=التّنقّل في دولفين -Name[ast]=Navegación de Dolphin Name[ca]=Navegació del Dolphin Name[ca@valencia]=Navegació del Dolphin Name[cs]=Navigace Dolphinu @@ -43,7 +42,6 @@ Name[zh_CN]=Dolphin 导航 Name[zh_TW]=Dolphin 導覽 Comment=This service allows configuration of the Dolphin navigation. Comment[ar]=تسمح هذه الخدمة بضبط التّنقّل في دولفين. -Comment[ast]=Esti serviciu permite la configuración de la navegación de Dolphin. Comment[ca]=Aquest servei permet la configuració de la navegació del Dolphin. Comment[ca@valencia]=Este servei permet la configuració de la navegació del Dolphin. Comment[cs]=Tato služba umožňuje nastavení navigace v Dolphinu. @@ -96,7 +94,6 @@ X-KDE-ParentApp=kcontrol X-DocPath=dolphin/index.html#preferences-dialog-navigation Name=Navigation Name[ar]=التّنقّل -Name[ast]=Navegación Name[ca]=Navegació Name[ca@valencia]=Navegació Name[cs]=Navigace @@ -139,7 +136,6 @@ Name[zh_CN]=导航 Name[zh_TW]=導覽 Comment=Configure file manager navigation Comment[ar]=اضبط التّنقّل في مدير الملفّات -Comment[ast]=Configura la navegación del xestor de ficheros Comment[ca]=Configura la navegació del gestor de fitxers Comment[ca@valencia]=Configura la navegació del gestor de fitxers Comment[cs]=Nastavení navigace správce souborů @@ -182,7 +178,6 @@ Comment[zh_CN]=配置文件管理器导航 Comment[zh_TW]=設定檔案管理員導覽 X-KDE-Keywords=file manager X-KDE-Keywords[ar]=مدير ملفّات ملفات الملفّات الملفات -X-KDE-Keywords[ast]=xestor de ficheros X-KDE-Keywords[ca]=gestor de fitxers X-KDE-Keywords[ca@valencia]=gestor de fitxers X-KDE-Keywords[cs]=správce souborů diff --git a/src/settings/kcm/kcmdolphinservices.desktop b/src/settings/kcm/kcmdolphinservices.desktop index 1775f7eff..2905db14b 100644 --- a/src/settings/kcm/kcmdolphinservices.desktop +++ b/src/settings/kcm/kcmdolphinservices.desktop @@ -1,6 +1,5 @@ Name=Dolphin Services Name[ar]=خدمات دولفين -Name[ast]=Servicios de Dolphin Name[ca]=Serveis del Dolphin Name[ca@valencia]=Serveis del Dolphin Name[cs]=Služby Dolphinu @@ -53,7 +52,6 @@ X-KDE-ParentApp=kcontrol X-DocPath=dolphin/index.html#preferences-dialog-services Name=Services Name[ar]=الخدمات -Name[ast]=Servicios Name[ca]=Serveis Name[ca@valencia]=Serveis Name[cs]=Služby @@ -95,7 +93,6 @@ Name[zh_CN]=服务 Name[zh_TW]=服務 Comment=Configure file manager services Comment[ar]=اضبط خدمات مدير الملفّات -Comment[ast]=Configura los servicios del xestor de ficheros Comment[ca]=Configura els serveis del gestor de fitxers Comment[ca@valencia]=Configura els serveis del gestor de fitxers Comment[cs]=Nastavení služeb správce souborů @@ -137,7 +134,6 @@ Comment[zh_CN]=配置文件管理器服务 Comment[zh_TW]=設定檔案管理員服務 X-KDE-Keywords=file manager X-KDE-Keywords[ar]=مدير ملفّات ملفات الملفّات الملفات -X-KDE-Keywords[ast]=xestor de ficheros X-KDE-Keywords[ca]=gestor de fitxers X-KDE-Keywords[ca@valencia]=gestor de fitxers X-KDE-Keywords[cs]=správce souborů diff --git a/src/settings/kcm/kcmdolphinviewmodes.desktop b/src/settings/kcm/kcmdolphinviewmodes.desktop index d1b5abe49..21ee6cf75 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.desktop +++ b/src/settings/kcm/kcmdolphinviewmodes.desktop @@ -1,6 +1,5 @@ Name=Dolphin View Modes Name[ar]=أوضاع المنظور في دولفين -Name[ast]=Moos de vista de Dolphin Name[ca]=Modes de vista del Dolphin Name[ca@valencia]=Modes de vista del Dolphin Name[cs]=Režimy pohledů Dolphinu @@ -43,7 +42,6 @@ Name[zh_CN]=Dolphin 视图模式 Name[zh_TW]=設定檔案管理員服務 Comment=This service allows configuration of the Dolphin view modes. Comment[ar]=تسمح هذه الخدمة بضبط أوضاع المنظور في دولفين. -Comment[ast]=Esti serviciu permite la configuración de los moos de vista de Dolphin. Comment[ca]=Aquest servei permet la configuració dels modes de vista del Dolphin. Comment[ca@valencia]=Este servei permet la configuració dels modes de vista del Dolphin. Comment[cs]=Tato služba umožňuje nastavení režimů pohledu Dolphinu. @@ -96,7 +94,6 @@ X-KDE-ParentApp=kcontrol X-DocPath=dolphin/index.html#preferences-dialog-viewmodes Name=View Modes Name[ar]=أوضاع المنظور -Name[ast]=Moos de vista Name[ca]=Modes de vista Name[ca@valencia]=Modes de vista Name[cs]=Režimy pohledu @@ -139,7 +136,6 @@ Name[zh_CN]=视图模式 Name[zh_TW]=檢視模式 Comment=Configure file manager view modes Comment[ar]=اضبط أوضاع المنظور في مدير الملفّات -Comment[ast]=Configura los moos de vista del xestor de ficheros Comment[ca]=Configura els modes de vista del gestor de fitxers Comment[ca@valencia]=Configura els modes de vista del gestor de fitxers Comment[cs]=Nastavení režimů pohledu správce souborů @@ -182,7 +178,6 @@ Comment[zh_CN]=配置文件管理器视图模式 Comment[zh_TW]=設定檔案管理員檢視模式 X-KDE-Keywords=file manager X-KDE-Keywords[ar]=مدير ملفّات ملفات الملفّات الملفات -X-KDE-Keywords[ast]=xestor de ficheros X-KDE-Keywords[ca]=gestor de fitxers X-KDE-Keywords[ca@valencia]=gestor de fitxers X-KDE-Keywords[cs]=správce souborů diff --git a/src/views/versioncontrol/fileviewversioncontrolplugin.desktop b/src/views/versioncontrol/fileviewversioncontrolplugin.desktop index cdec01b9d..67951cfe7 100644 --- a/src/views/versioncontrol/fileviewversioncontrolplugin.desktop +++ b/src/views/versioncontrol/fileviewversioncontrolplugin.desktop @@ -2,7 +2,6 @@ Type=ServiceType X-KDE-ServiceType=FileViewVersionControlPlugin Comment=Version Control Plugin for File Views -Comment[ast]=Complementu de control de versiones pa vistes de ficheros Comment[ca]=Connector de control de versions per a les vistes de fitxers Comment[ca@valencia]=Connector de control de versions per a les vistes de fitxers Comment[cs]=Modul pro správu verzí pro pohledy na soubory -- cgit v1.3 From 6af0dad2eeba82929c2299f66ea81e5d0140a251 Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Sat, 17 Dec 2016 14:23:20 +0100 Subject: Fix updating of new item menu when changing tabs Correctly set the active status of views when changing tabs. Before: Right click in home folder, see create new enabled, open tab, go to /usr, right click and see it is disabled, switch back to first tab and right click, and it is still disabled. After: It is enabled and disabled as appropriate when switching tab. REVIEW: 129664 --- src/dolphintabwidget.cpp | 9 ++++++++- src/dolphintabwidget.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index 22674d1bd..bcd4a49fd 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -32,7 +32,8 @@ DolphinTabWidget::DolphinTabWidget(QWidget* parent) : QTabWidget(parent), - m_placesSelectorVisible(true) + m_placesSelectorVisible(true), + m_previousTab(-1) { connect(this, &DolphinTabWidget::tabCloseRequested, this, static_cast(&DolphinTabWidget::closeTab)); @@ -304,9 +305,15 @@ void DolphinTabWidget::tabUrlChanged(const QUrl& url) void DolphinTabWidget::currentTabChanged(int index) { DolphinViewContainer* viewContainer = tabPageAt(index)->activeViewContainer(); + viewContainer->setActive(true); emit activeViewChanged(viewContainer); emit currentUrlChanged(viewContainer->url()); viewContainer->view()->setFocus(); + + if (tabPageAt(m_previousTab)) { + tabPageAt(m_previousTab)->activeViewContainer()->setActive(false); + } + m_previousTab = index; } void DolphinTabWidget::tabInserted(int index) diff --git a/src/dolphintabwidget.h b/src/dolphintabwidget.h index 7b3a18814..50ebd602a 100644 --- a/src/dolphintabwidget.h +++ b/src/dolphintabwidget.h @@ -186,6 +186,8 @@ private: private: /** Caches the (negated) places panel visibility */ bool m_placesSelectorVisible; + + int m_previousTab; }; #endif -- cgit v1.3 From c456c5d528f470ce782a90646eae52951c0f31b9 Mon Sep 17 00:00:00 2001 From: Anthony Fieroni Date: Sun, 1 Jan 2017 21:47:10 +0200 Subject: [DolphinSearchBox] Stop search timer on hide REVIEW: 129705 Signed-off-by: Anthony Fieroni --- src/search/dolphinsearchbox.cpp | 7 +++++++ src/search/dolphinsearchbox.h | 1 + 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 26ddd27f8..60a4a7567 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -206,6 +206,13 @@ void DolphinSearchBox::showEvent(QShowEvent* event) } } +void DolphinSearchBox::hideEvent(QHideEvent* event) +{ + Q_UNUSED(event); + m_startedSearching = false; + m_startSearchTimer->stop(); +} + void DolphinSearchBox::keyReleaseEvent(QKeyEvent* event) { QWidget::keyReleaseEvent(event); diff --git a/src/search/dolphinsearchbox.h b/src/search/dolphinsearchbox.h index a80617476..b747679ec 100644 --- a/src/search/dolphinsearchbox.h +++ b/src/search/dolphinsearchbox.h @@ -100,6 +100,7 @@ public: protected: virtual bool event(QEvent* event) Q_DECL_OVERRIDE; virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE; + virtual void hideEvent(QHideEvent* event) Q_DECL_OVERRIDE; virtual void keyReleaseEvent(QKeyEvent* event) Q_DECL_OVERRIDE; virtual bool eventFilter(QObject* obj, QEvent* event) Q_DECL_OVERRIDE; -- cgit v1.3 From 24ed38d77f4bc6db71ba2608452fa0cd401bddac Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Mon, 2 Jan 2017 14:52:37 +0100 Subject: Properly disable create_dir action in Trash `isFolderWritable` is set in DolphinView::updateWritableState() according to KFileItemListProperties::supportsWriting(). However, `writing=true` does not imply `makedir=true`, in an ioslave's .protocol file. An example is the trash protocol. So we need to enable the `create_dir` action only if the protocol is actually able to create folders. CCBUG: 332463 REVIEW: 129712 --- src/views/dolphinviewactionhandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index 858f9299b..5c0b49cd2 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include "dolphindebug.h" @@ -486,7 +487,8 @@ void DolphinViewActionHandler::slotHiddenFilesShownChanged(bool shown) void DolphinViewActionHandler::slotWriteStateChanged(bool isFolderWritable) { - m_actionCollection->action(QStringLiteral("create_dir"))->setEnabled(isFolderWritable); + m_actionCollection->action(QStringLiteral("create_dir"))->setEnabled(isFolderWritable && + KProtocolManager::supportsMakeDir(currentView()->url())); } KToggleAction* DolphinViewActionHandler::iconsModeAction() -- cgit v1.3 From 2a7090728b8ef897a523712f89c917302f2c6532 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Tue, 3 Jan 2017 09:45:33 +0100 Subject: [DolphinView] Update view palette on palette change Everything was handling palette change already but for the visual distinction between active and non-active view (in case of split view), a custom palette was set which was then never updated. This could be seen by the label text color changing but not the view background. Differential Revision: https://phabricator.kde.org/D3909 --- src/views/dolphinview.cpp | 35 ++++++++++++++++++++++------------- src/views/dolphinview.h | 2 ++ 2 files changed, 24 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 4105628ee..7d85fa240 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -211,19 +211,7 @@ void DolphinView::setActive(bool active) m_active = active; - QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color(); - if (!active) { - color.setAlpha(150); - } - - QWidget* viewport = m_container->viewport(); - if (viewport) { - QPalette palette; - palette.setColor(viewport->backgroundRole(), color); - viewport->setPalette(palette); - } - - update(); + updatePalette(); if (active) { m_container->setFocus(); @@ -721,9 +709,30 @@ void DolphinView::stopLoading() m_model->cancelDirectoryLoading(); } +void DolphinView::updatePalette() +{ + QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color(); + if (!m_active) { + color.setAlpha(150); + } + + QWidget* viewport = m_container->viewport(); + if (viewport) { + QPalette palette; + palette.setColor(viewport->backgroundRole(), color); + viewport->setPalette(palette); + } + + update(); +} + bool DolphinView::eventFilter(QObject* watched, QEvent* event) { switch (event->type()) { + case QEvent::PaletteChange: + updatePalette(); + break; + case QEvent::KeyPress: if (GeneralSettings::useTabForSwitchingSplitView()) { QKeyEvent* keyEvent = static_cast(event); diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index 0b0d8196d..fbe3a6376 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -762,6 +762,8 @@ private: QUrl viewPropertiesUrl() const; private: + void updatePalette(); + bool m_active; bool m_tabsForFiles; bool m_assureVisibleCurrentIndex; -- cgit v1.3 From 996f8520e7003326ade6ea96929dd41958ba308d Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Tue, 3 Jan 2017 09:46:43 +0100 Subject: Explicitly pass iconNameForUrl when creating new places entry Once KIO::iconNameForUrl returns special icons for standard paths (e.g. Video folder) this will ensure when adding such a folder to places it will automatically get the proper icon. Since KIO already depends on KBookmarks it can't depend the other way round, otherwise this would have been fixed in KBookmarks directly. Differential Revision: https://phabricator.kde.org/D3896 --- src/dolphincontextmenu.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index ed3f64379..666b81c8d 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -307,7 +307,7 @@ void DolphinContextMenu::openItemContextMenu() if (selectedUrl.isValid()) { PlacesItemModel model; const QString text = selectedUrl.fileName(); - PlacesItem* item = model.createPlacesItem(text, selectedUrl); + PlacesItem* item = model.createPlacesItem(text, selectedUrl, KIO::iconNameForUrl(selectedUrl)); model.appendItemToGroup(item); model.saveBookmarks(); } @@ -373,7 +373,8 @@ void DolphinContextMenu::openViewportContextMenu() if (container->url().isValid()) { PlacesItemModel model; PlacesItem* item = model.createPlacesItem(container->placesText(), - container->url()); + container->url(), + KIO::iconNameForUrl(container->url())); model.appendItemToGroup(item); model.saveBookmarks(); } -- cgit v1.3 From 67c007889ecc4eada434cbe390110b2e7566aa41 Mon Sep 17 00:00:00 2001 From: Ilya Bizyaev Date: Tue, 3 Jan 2017 11:23:03 +0100 Subject: Add missing Q_OBJECT macros REVIEW: 129738 --- src/tests/kitemlistcontrollertest.cpp | 1 + src/tests/kitemlistselectionmanagertest.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/tests/kitemlistcontrollertest.cpp b/src/tests/kitemlistcontrollertest.cpp index e170e7b5b..92d05c4d4 100644 --- a/src/tests/kitemlistcontrollertest.cpp +++ b/src/tests/kitemlistcontrollertest.cpp @@ -37,6 +37,7 @@ */ class KItemListControllerTestStyle : public QProxyStyle { + Q_OBJECT public: KItemListControllerTestStyle(QStyle* style) : QProxyStyle(style), diff --git a/src/tests/kitemlistselectionmanagertest.cpp b/src/tests/kitemlistselectionmanagertest.cpp index b183de302..5dce57f3c 100644 --- a/src/tests/kitemlistselectionmanagertest.cpp +++ b/src/tests/kitemlistselectionmanagertest.cpp @@ -26,6 +26,7 @@ class DummyModel : public KItemModelBase { + Q_OBJECT public: DummyModel(); void setCount(int count); -- cgit v1.3 From 962f6d7160e3de69c67964296d5e412f36037131 Mon Sep 17 00:00:00 2001 From: Ilya Bizyaev Date: Tue, 3 Jan 2017 11:28:20 +0100 Subject: Fix 2 container-anti-pattern clazy warnings REVIEW: 129752 --- src/kitemviews/kfileitemmodel.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 05f85a633..7b252a346 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -416,12 +416,15 @@ int KFileItemModel::index(const QUrl& url) const foreach (const QUrl& url, indexesForUrl.uniqueKeys()) { if (indexesForUrl.count(url) > 1) { qCWarning(DolphinDebug) << "Multiple items found with the URL" << url; - foreach (int index, indexesForUrl.values(url)) { - const ItemData* data = m_itemData.at(index); - qCWarning(DolphinDebug) << "index" << index << ":" << data->item; + + auto it = indexesForUrl.find(url); + while (it != indexesForUrl.end() && it.key() == url) { + const ItemData* data = m_itemData.at(it.value()); + qCWarning(DolphinDebug) << "index" << it.value() << ":" << data->item; if (data->parent) { qCWarning(DolphinDebug) << "parent" << data->parent->item; } + ++it; } } } @@ -590,7 +593,12 @@ int KFileItemModel::expandedParentsCount(int index) const QSet KFileItemModel::expandedDirectories() const { - return m_expandedDirs.values().toSet(); + QSet result; + const auto dirs = m_expandedDirs; + for (const auto &dir : dirs) { + result.insert(dir); + } + return result; } void KFileItemModel::restoreExpandedDirectories(const QSet &urls) -- cgit v1.3 From 726515cfd43e3a1af61ab624d08f509e8e5f0a9f Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Tue, 3 Jan 2017 13:17:54 +0100 Subject: Add missing Q_DECL_OVERRIDE --- src/dolphindockwidget.cpp | 4 ++-- src/kitemviews/kitemlistcontainer.cpp | 2 +- src/kitemviews/private/kfileitemmodeldirlister.h | 2 +- src/kitemviews/private/kitemlistheaderwidget.h | 16 ++++++++-------- src/kitemviews/private/kitemlistroleeditor.h | 6 +++--- src/kitemviews/private/kitemlistselectiontoggle.h | 4 ++-- src/kitemviews/private/kitemlistsmoothscroller.h | 2 +- src/panels/information/phononwidget.cpp | 2 +- src/tests/kitemlistselectionmanagertest.cpp | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/dolphindockwidget.cpp b/src/dolphindockwidget.cpp index 82cf91186..ccbecb0d6 100644 --- a/src/dolphindockwidget.cpp +++ b/src/dolphindockwidget.cpp @@ -38,13 +38,13 @@ public: DolphinDockTitleBar(QWidget* parent = 0) : QWidget(parent) {} virtual ~DolphinDockTitleBar() {} - virtual QSize minimumSizeHint() const + QSize minimumSizeHint() const Q_DECL_OVERRIDE { const int border = style()->pixelMetric(QStyle::PM_DockWidgetTitleBarButtonMargin); return QSize(border, border); } - virtual QSize sizeHint() const + QSize sizeHint() const Q_DECL_OVERRIDE { return minimumSizeHint(); } diff --git a/src/kitemviews/kitemlistcontainer.cpp b/src/kitemviews/kitemlistcontainer.cpp index 6a0c5756c..b4ea62fac 100644 --- a/src/kitemviews/kitemlistcontainer.cpp +++ b/src/kitemviews/kitemlistcontainer.cpp @@ -48,7 +48,7 @@ class KItemListContainerViewport : public QGraphicsView public: KItemListContainerViewport(QGraphicsScene* scene, QWidget* parent); protected: - virtual void wheelEvent(QWheelEvent* event); + void wheelEvent(QWheelEvent* event) Q_DECL_OVERRIDE; }; KItemListContainerViewport::KItemListContainerViewport(QGraphicsScene* scene, QWidget* parent) : diff --git a/src/kitemviews/private/kfileitemmodeldirlister.h b/src/kitemviews/private/kfileitemmodeldirlister.h index c2c621aed..5aa2b6303 100644 --- a/src/kitemviews/private/kfileitemmodeldirlister.h +++ b/src/kitemviews/private/kfileitemmodeldirlister.h @@ -48,7 +48,7 @@ signals: void urlIsFileError(const QUrl& url); protected: - virtual void handleError(KIO::Job* job); + void handleError(KIO::Job* job) Q_DECL_OVERRIDE; }; #endif diff --git a/src/kitemviews/private/kitemlistheaderwidget.h b/src/kitemviews/private/kitemlistheaderwidget.h index 2a80c205d..2342b4907 100644 --- a/src/kitemviews/private/kitemlistheaderwidget.h +++ b/src/kitemviews/private/kitemlistheaderwidget.h @@ -64,7 +64,7 @@ public: qreal minimumColumnWidth() const; - virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0); + void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) Q_DECL_OVERRIDE; signals: /** @@ -104,13 +104,13 @@ signals: void sortRoleChanged(const QByteArray& current, const QByteArray& previous); protected: - virtual void mousePressEvent(QGraphicsSceneMouseEvent* event); - virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); - virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* event); - virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event); - virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* event); - virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* event); - virtual void hoverMoveEvent(QGraphicsSceneHoverEvent* event); + void mousePressEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE; + void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE; + void hoverEnterEvent(QGraphicsSceneHoverEvent* event) Q_DECL_OVERRIDE; + void hoverLeaveEvent(QGraphicsSceneHoverEvent* event) Q_DECL_OVERRIDE; + void hoverMoveEvent(QGraphicsSceneHoverEvent* event) Q_DECL_OVERRIDE; private slots: void slotSortRoleChanged(const QByteArray& current, const QByteArray& previous); diff --git a/src/kitemviews/private/kitemlistroleeditor.h b/src/kitemviews/private/kitemlistroleeditor.h index 3b8f96865..f889ea4f4 100644 --- a/src/kitemviews/private/kitemlistroleeditor.h +++ b/src/kitemviews/private/kitemlistroleeditor.h @@ -44,15 +44,15 @@ public: void setRole(const QByteArray& role); QByteArray role() const; - virtual bool eventFilter(QObject* watched, QEvent* event); + bool eventFilter(QObject* watched, QEvent* event) Q_DECL_OVERRIDE; signals: void roleEditingFinished(const QByteArray& role, const QVariant& value); void roleEditingCanceled(const QByteArray& role, const QVariant& value); protected: - virtual bool event(QEvent* event); - virtual void keyPressEvent(QKeyEvent* event); + bool event(QEvent* event) Q_DECL_OVERRIDE; + void keyPressEvent(QKeyEvent* event) Q_DECL_OVERRIDE; private slots: /** diff --git a/src/kitemviews/private/kitemlistselectiontoggle.h b/src/kitemviews/private/kitemlistselectiontoggle.h index d058ee988..e3f5bb63c 100644 --- a/src/kitemviews/private/kitemlistselectiontoggle.h +++ b/src/kitemviews/private/kitemlistselectiontoggle.h @@ -42,10 +42,10 @@ public: void setHovered(bool hovered); - virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0); + void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) Q_DECL_OVERRIDE; protected: - virtual void resizeEvent(QGraphicsSceneResizeEvent* event); + void resizeEvent(QGraphicsSceneResizeEvent* event) Q_DECL_OVERRIDE; private: void updatePixmap(); diff --git a/src/kitemviews/private/kitemlistsmoothscroller.h b/src/kitemviews/private/kitemlistsmoothscroller.h index a3576a3fd..7d01a6b62 100644 --- a/src/kitemviews/private/kitemlistsmoothscroller.h +++ b/src/kitemviews/private/kitemlistsmoothscroller.h @@ -83,7 +83,7 @@ public: void handleWheelEvent(QWheelEvent* event); protected: - virtual bool eventFilter(QObject* obj, QEvent* event); + bool eventFilter(QObject* obj, QEvent* event) Q_DECL_OVERRIDE; private slots: void slotAnimationStateChanged(QAbstractAnimation::State newState, diff --git a/src/panels/information/phononwidget.cpp b/src/panels/information/phononwidget.cpp index e4885ab76..ac4a32506 100644 --- a/src/panels/information/phononwidget.cpp +++ b/src/panels/information/phononwidget.cpp @@ -52,7 +52,7 @@ class EmbeddedVideoPlayer : public Phonon::VideoWidget updateGeometry(); } - virtual QSize sizeHint() const + QSize sizeHint() const Q_DECL_OVERRIDE { return m_sizeHint.isValid() ? m_sizeHint : Phonon::VideoWidget::sizeHint(); } diff --git a/src/tests/kitemlistselectionmanagertest.cpp b/src/tests/kitemlistselectionmanagertest.cpp index 5dce57f3c..18a79bd3f 100644 --- a/src/tests/kitemlistselectionmanagertest.cpp +++ b/src/tests/kitemlistselectionmanagertest.cpp @@ -30,8 +30,8 @@ class DummyModel : public KItemModelBase public: DummyModel(); void setCount(int count); - virtual int count() const; - virtual QHash data(int index) const; + int count() const Q_DECL_OVERRIDE; + QHash data(int index) const Q_DECL_OVERRIDE; private: int m_count; -- cgit v1.3 From 0cad00c39aec4508688c87e520acc782b1001d1f Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Thu, 12 Jan 2017 14:23:01 +0100 Subject: Add document title to additional information Allows showing the document title of e.g. a PDF alongside the file name BUG: 321356 Differential Revision: https://phabricator.kde.org/D3972 --- src/kitemviews/kfileitemmodel.cpp | 1 + src/kitemviews/kfileitemmodel.h | 2 +- src/kitemviews/private/kbaloorolesprovider.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 7b252a346..c35d164e1 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -2225,6 +2225,7 @@ const KFileItemModel::RoleInfoMap* KFileItemModel::rolesInfoMap(int& count) { "rating", RatingRole, I18N_NOOP2_NOSTRIP("@label", "Rating"), 0, 0, true, false }, { "tags", TagsRole, I18N_NOOP2_NOSTRIP("@label", "Tags"), 0, 0, true, false }, { "comment", CommentRole, I18N_NOOP2_NOSTRIP("@label", "Comment"), 0, 0, true, false }, + { "title", TitleRole, I18N_NOOP2_NOSTRIP("@label", "Title"), I18N_NOOP2_NOSTRIP("@label", "Document"), true, true }, { "wordCount", WordCountRole, I18N_NOOP2_NOSTRIP("@label", "Word Count"), I18N_NOOP2_NOSTRIP("@label", "Document"), true, true }, { "lineCount", LineCountRole, I18N_NOOP2_NOSTRIP("@label", "Line Count"), I18N_NOOP2_NOSTRIP("@label", "Document"), true, true }, { "imageSize", ImageSizeRole, I18N_NOOP2_NOSTRIP("@label", "Image Size"), I18N_NOOP2_NOSTRIP("@label", "Image"), true, true }, diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h index 8a0df72b9..717afb9a7 100644 --- a/src/kitemviews/kfileitemmodel.h +++ b/src/kitemviews/kfileitemmodel.h @@ -284,7 +284,7 @@ private: GroupRole, TypeRole, DestinationRole, PathRole, // User visible roles available with Baloo: CommentRole, TagsRole, RatingRole, ImageSizeRole, OrientationRole, - WordCountRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole, + WordCountRole, TitleRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole, OriginUrlRole, // Non-visible roles: IsDirRole, IsLinkRole, IsExpandedRole, IsExpandableRole, ExpandedParentsCountRole, diff --git a/src/kitemviews/private/kbaloorolesprovider.cpp b/src/kitemviews/private/kbaloorolesprovider.cpp index e0b889e6c..9f151df92 100644 --- a/src/kitemviews/private/kbaloorolesprovider.cpp +++ b/src/kitemviews/private/kbaloorolesprovider.cpp @@ -138,6 +138,7 @@ KBalooRolesProvider::KBalooRolesProvider() : { "rating", "rating" }, { "tag", "tags" }, { "comment", "comment" }, + { "title", "title" }, { "wordCount", "wordCount" }, { "lineCount", "lineCount" }, { "width", "imageSize" }, -- cgit v1.3 From 82c944f63f2994848f870053987388aa537e6fd8 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Fri, 13 Jan 2017 03:38:21 +0100 Subject: GIT_SILENT made messages (after extraction) --- src/org.kde.dolphin.appdata.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/org.kde.dolphin.appdata.xml b/src/org.kde.dolphin.appdata.xml index 7bbe42a96..233819559 100644 --- a/src/org.kde.dolphin.appdata.xml +++ b/src/org.kde.dolphin.appdata.xml @@ -48,6 +48,7 @@ Dolphin File Manager مدير ملفات + Xestor de ficheros Upravitelj datoteka Gestor de fitxers Gestor de fitxers @@ -92,6 +93,7 @@

    Dolphin is a lightweight file manager. It has been designed with ease of use and simplicity in mind, while still allowing flexibility and customisation. This means that you can do your file management exactly the way you want to do it.

    دولفين هو مدير ملفات خفيف. صُمِّم دولفين مع أخذ سهولة الاستخدام والبساطة بعين الاعتبار، مع السماح بالمرونة والتخصيص. يعني هذا أنه يمكنك إدارة ملفاتك كما تريد تمامًا.

    +

    Dolphin ye un xestor de ficheros llixeru. Diseñóse cola facilidá y cenciellez d'usu en mente, el mesmu tiempu qu'entá permite la flixibilidá y personalización. Quier dicir que pues facer la to xestión de ficheros exautamente como quieras facelo.

    Dolphinje lagan file manager. On je bio dizajniran sa lakoćom korišćenja i jednostavnosti u vidu, još omogućavajući fleksibilnost i prilagođavanje. To znači da možete da radite svoje upravljanje datotekama onako kako želite da to uradi.

    El Dolphin és un gestor de fitxers lleuger. S'ha dissenyat pensant a facilitar el seu ús i que sigui simple, permetent la flexibilitat i la personalització. Això vol dir que podeu fer la gestió dels vostres fitxers de la manera exacta com ho vulgueu fer.

    El Dolphin és un gestor de fitxers lleuger. S'ha dissenyat pensant a facilitar el seu ús i que siga simple, permetent la flexibilitat i la personalització. Això vol dir que podeu fer la gestió dels vostres fitxers de la manera exacta com ho vulgueu fer.

    @@ -131,6 +133,7 @@

    Dolphin 是一套輕量級的檔案管理員。它設計的理念是易用與簡單,但仍然保持足夠的彈性。這表示您可以用您想要使用的方式來管理您的檔案。

    Features:

    المزايا:

    +

    Carauterístiques:

    Svojstva:

    Característiques:

    Característiques:

    -- cgit v1.3 From c1eeb0e115b6074e296892c95192cf464c0c83c9 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Fri, 13 Jan 2017 05:50:46 +0100 Subject: 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 | 1 + src/org.kde.dolphin.desktop | 2 ++ src/settings/kcm/kcmdolphingeneral.desktop | 2 ++ src/settings/kcm/kcmdolphinnavigation.desktop | 2 ++ src/settings/kcm/kcmdolphinservices.desktop | 3 +++ src/settings/kcm/kcmdolphinviewmodes.desktop | 1 + 6 files changed, 11 insertions(+) (limited to 'src') diff --git a/src/dolphinpart.desktop b/src/dolphinpart.desktop index 9b3089542..da0a659d3 100644 --- a/src/dolphinpart.desktop +++ b/src/dolphinpart.desktop @@ -152,6 +152,7 @@ Exec=dolphin [Desktop Action details] Name=Details Name[ar]=التّفاصيل +Name[ast]=Detalles Name[ca]=Detalls Name[ca@valencia]=Detalls Name[cs]=Podrobnosti diff --git a/src/org.kde.dolphin.desktop b/src/org.kde.dolphin.desktop index f50ef2b6c..63b72d966 100755 --- a/src/org.kde.dolphin.desktop +++ b/src/org.kde.dolphin.desktop @@ -1,6 +1,7 @@ [Desktop Entry] Name=Dolphin Name[ar]=دولفين +Name[ast]=Dolphin Name[ca]=Dolphin Name[ca@valencia]=Dolphin Name[cs]=Dolphin @@ -48,6 +49,7 @@ X-DocPath=dolphin/index.html Categories=Qt;KDE;System;FileTools;FileManager; GenericName=File Manager GenericName[ar]=مدير ملفّات +GenericName[ast]=Xestor de ficheros GenericName[ca]=Gestor de fitxers GenericName[ca@valencia]=Gestor de fitxers GenericName[cs]=Správce souborů diff --git a/src/settings/kcm/kcmdolphingeneral.desktop b/src/settings/kcm/kcmdolphingeneral.desktop index 499fe7391..556231e44 100644 --- a/src/settings/kcm/kcmdolphingeneral.desktop +++ b/src/settings/kcm/kcmdolphingeneral.desktop @@ -95,6 +95,7 @@ X-DocPath=dolphin/index.html#preferences-dialog-general # ctxt: Random file browsing settings. Name=General Name[ar]=عامّ +Name[ast]=Xeneral Name[ca]=General Name[ca@valencia]=General Name[cs]=Obecné @@ -177,6 +178,7 @@ Comment[zh_CN]=配置常规文件管理器设置 Comment[zh_TW]=設定一般檔案管理員 X-KDE-Keywords=file manager X-KDE-Keywords[ar]=مدير ملفّات ملفات الملفّات الملفات +X-KDE-Keywords[ast]=xestor de ficheros X-KDE-Keywords[ca]=gestor de fitxers X-KDE-Keywords[ca@valencia]=gestor de fitxers X-KDE-Keywords[cs]=správce souborů diff --git a/src/settings/kcm/kcmdolphinnavigation.desktop b/src/settings/kcm/kcmdolphinnavigation.desktop index e03a336de..9280624d6 100644 --- a/src/settings/kcm/kcmdolphinnavigation.desktop +++ b/src/settings/kcm/kcmdolphinnavigation.desktop @@ -94,6 +94,7 @@ X-KDE-ParentApp=kcontrol X-DocPath=dolphin/index.html#preferences-dialog-navigation Name=Navigation Name[ar]=التّنقّل +Name[ast]=Navegación Name[ca]=Navegació Name[ca@valencia]=Navegació Name[cs]=Navigace @@ -178,6 +179,7 @@ Comment[zh_CN]=配置文件管理器导航 Comment[zh_TW]=設定檔案管理員導覽 X-KDE-Keywords=file manager X-KDE-Keywords[ar]=مدير ملفّات ملفات الملفّات الملفات +X-KDE-Keywords[ast]=xestor de ficheros X-KDE-Keywords[ca]=gestor de fitxers X-KDE-Keywords[ca@valencia]=gestor de fitxers X-KDE-Keywords[cs]=správce souborů diff --git a/src/settings/kcm/kcmdolphinservices.desktop b/src/settings/kcm/kcmdolphinservices.desktop index 2905db14b..42e0538fa 100644 --- a/src/settings/kcm/kcmdolphinservices.desktop +++ b/src/settings/kcm/kcmdolphinservices.desktop @@ -1,5 +1,6 @@ Name=Dolphin Services Name[ar]=خدمات دولفين +Name[ast]=Servicios de Dolphin Name[ca]=Serveis del Dolphin Name[ca@valencia]=Serveis del Dolphin Name[cs]=Služby Dolphinu @@ -52,6 +53,7 @@ X-KDE-ParentApp=kcontrol X-DocPath=dolphin/index.html#preferences-dialog-services Name=Services Name[ar]=الخدمات +Name[ast]=Servicios Name[ca]=Serveis Name[ca@valencia]=Serveis Name[cs]=Služby @@ -134,6 +136,7 @@ Comment[zh_CN]=配置文件管理器服务 Comment[zh_TW]=設定檔案管理員服務 X-KDE-Keywords=file manager X-KDE-Keywords[ar]=مدير ملفّات ملفات الملفّات الملفات +X-KDE-Keywords[ast]=xestor de ficheros X-KDE-Keywords[ca]=gestor de fitxers X-KDE-Keywords[ca@valencia]=gestor de fitxers X-KDE-Keywords[cs]=správce souborů diff --git a/src/settings/kcm/kcmdolphinviewmodes.desktop b/src/settings/kcm/kcmdolphinviewmodes.desktop index 21ee6cf75..0be2656a0 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.desktop +++ b/src/settings/kcm/kcmdolphinviewmodes.desktop @@ -178,6 +178,7 @@ Comment[zh_CN]=配置文件管理器视图模式 Comment[zh_TW]=設定檔案管理員檢視模式 X-KDE-Keywords=file manager X-KDE-Keywords[ar]=مدير ملفّات ملفات الملفّات الملفات +X-KDE-Keywords[ast]=xestor de ficheros X-KDE-Keywords[ca]=gestor de fitxers X-KDE-Keywords[ca@valencia]=gestor de fitxers X-KDE-Keywords[cs]=správce souborů -- cgit v1.3 From 85121a8115c5a8b6b7c0a01073663d51bd64e6ae Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sat, 14 Jan 2017 12:52:58 +0100 Subject: Don't overwrite custom icons for the show_hidden_files action BUG: 374508 FIXED-IN: 16.12.2 REVIEW: 129789 --- src/views/dolphinviewactionhandler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index 5c0b49cd2..273bcdd76 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -482,6 +482,12 @@ void DolphinViewActionHandler::slotHiddenFilesShownChanged(bool shown) QAction* showHiddenFilesAction = m_actionCollection->action(QStringLiteral("show_hidden_files")); showHiddenFilesAction->setChecked(shown); + // #374508: don't overwrite custom icons. + const QString iconName = showHiddenFilesAction->icon().name(); + if (!iconName.isEmpty() && iconName != QLatin1String("visibility") && iconName != QLatin1String("hint")) { + return; + } + showHiddenFilesAction->setIcon(QIcon::fromTheme(shown ? QStringLiteral("visibility") : QStringLiteral("hint"))); } -- cgit v1.3 From 63a591f32a56cb4caac9a616d21fab0f37c8d827 Mon Sep 17 00:00:00 2001 From: John Salatas Date: Sat, 14 Jan 2017 04:26:14 -0800 Subject: Show full path in title bar BUG: 229810 Differential Revision: https://phabricator.kde.org/D4078 --- src/dolphinmainwindow.cpp | 15 ++++++++++----- src/settings/dolphin_generalsettings.kcfg | 4 ++++ src/settings/startup/startupsettingspage.cpp | 8 +++++++- src/settings/startup/startupsettingspage.h | 1 + 4 files changed, 22 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index e5103fd42..deb5d5e57 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -961,13 +961,17 @@ void DolphinMainWindow::setUrlAsCaption(const QUrl& url) } } - QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName(); - if (fileName.isEmpty()) { - fileName = '/'; + if (GeneralSettings::showFullPathInTitlebar()) { + const QString path = url.adjusted(QUrl::StripTrailingSlash).path(); + caption.append(path); + } else { + QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName(); + if (fileName.isEmpty()) { + fileName = '/'; + } + caption.append(fileName); } - caption.append(fileName); - setWindowTitle(caption); } @@ -1404,6 +1408,7 @@ void DolphinMainWindow::refreshViews() const bool splitView = GeneralSettings::splitView(); m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView); updateSplitAction(); + setUrlAsCaption(activeViewContainer()->url()); } emit settingsChanged(); diff --git a/src/settings/dolphin_generalsettings.kcfg b/src/settings/dolphin_generalsettings.kcfg index c724afcd1..5878abcbe 100644 --- a/src/settings/dolphin_generalsettings.kcfg +++ b/src/settings/dolphin_generalsettings.kcfg @@ -22,6 +22,10 @@ false + + + false + 0 diff --git a/src/settings/startup/startupsettingspage.cpp b/src/settings/startup/startupsettingspage.cpp index 6554493d8..f076f16c7 100644 --- a/src/settings/startup/startupsettingspage.cpp +++ b/src/settings/startup/startupsettingspage.cpp @@ -46,7 +46,8 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) : m_splitView(0), m_editableUrl(0), m_showFullPath(0), - m_filterBar(0) + m_filterBar(0), + m_showFullPathInTitlebar(0) { QVBoxLayout* topLayout = new QVBoxLayout(this); QWidget* vBox = new QWidget(this); @@ -104,6 +105,8 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) : vBoxLayout->addWidget(m_showFullPath); m_filterBar = new QCheckBox(i18nc("@option:check Startup Settings", "Show filter bar"), vBox); vBoxLayout->addWidget(m_filterBar); + m_showFullPathInTitlebar = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path in title bar"), vBox); + vBoxLayout->addWidget(m_showFullPathInTitlebar); // Add a dummy widget with no restriction regarding // a vertical resizing. This assures that the dialog layout @@ -119,6 +122,7 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) : connect(m_editableUrl, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); connect(m_showFullPath, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); connect(m_filterBar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); + connect(m_showFullPathInTitlebar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); } StartupSettingsPage::~StartupSettingsPage() @@ -141,6 +145,7 @@ void StartupSettingsPage::applySettings() settings->setEditableUrl(m_editableUrl->isChecked()); settings->setShowFullPath(m_showFullPath->isChecked()); settings->setFilterBar(m_filterBar->isChecked()); + settings->setShowFullPathInTitlebar(m_showFullPathInTitlebar->isChecked()); settings->save(); } @@ -190,4 +195,5 @@ void StartupSettingsPage::loadSettings() m_editableUrl->setChecked(GeneralSettings::editableUrl()); m_showFullPath->setChecked(GeneralSettings::showFullPath()); m_filterBar->setChecked(GeneralSettings::filterBar()); + m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar()); } diff --git a/src/settings/startup/startupsettingspage.h b/src/settings/startup/startupsettingspage.h index 9bcc31131..7a69cd3d6 100644 --- a/src/settings/startup/startupsettingspage.h +++ b/src/settings/startup/startupsettingspage.h @@ -62,6 +62,7 @@ private: QCheckBox* m_editableUrl; QCheckBox* m_showFullPath; QCheckBox* m_filterBar; + QCheckBox* m_showFullPathInTitlebar; }; #endif -- cgit v1.3 From 215bed085b99274cb3cc57670f4a76d0d43c4603 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 16 Jan 2017 15:45:09 +0100 Subject: In doubt use URL scheme for place If we neither have a filename nor a host, we might be in a foo:/ URL, use the scheme then. Differential Revision: https://phabricator.kde.org/D3935 --- src/dolphinviewcontainer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 4e625c7d8..2ea5b7e00 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -361,6 +361,9 @@ QString DolphinViewContainer::placesText() const if (text.isEmpty()) { text = url().host(); } + if (text.isEmpty()) { + text = url().scheme(); + } } return text; -- cgit v1.3 From 1be2704214a9685fe85fdf65f30e4921eba0f2c9 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Wed, 18 Jan 2017 23:45:39 +0100 Subject: Port away from deprecated KIO::Job::ui() It's equivalent to KJob::uiDelegate() from kcoreaddons. --- src/dolphincontextmenu.cpp | 2 +- src/dolphinmainwindow.cpp | 2 +- src/kitemviews/kfileitemmodelrolesupdater.cpp | 2 +- src/panels/folders/folderspanel.cpp | 2 +- src/panels/folders/treeviewcontextmenu.cpp | 4 ++-- src/panels/information/informationpanel.cpp | 2 +- src/panels/information/informationpanelcontent.cpp | 2 +- src/panels/terminal/terminalpanel.cpp | 2 +- src/views/dolphinview.cpp | 2 +- src/views/renamedialog.cpp | 2 +- src/views/tooltips/tooltipmanager.cpp | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 666b81c8d..bedb4cb80 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -160,7 +160,7 @@ void DolphinContextMenu::openTrashContextMenu() if (uiDelegate.askDeleteConfirmation(QList(), KIO::JobUiDelegate::EmptyTrash, KIO::JobUiDelegate::DefaultConfirmation)) { KIO::Job* job = KIO::emptyTrash(); KJobWidgets::setWindow(job, m_mainWindow); - job->ui()->setAutoErrorHandlingEnabled(true); + job->uiDelegate()->setAutoErrorHandlingEnabled(true); } } } diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index deb5d5e57..1dcae7ec4 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -723,7 +723,7 @@ void DolphinMainWindow::handleUrl(const QUrl& url) } else if (KProtocolManager::supportsListing(url)) { // stat the URL to see if it is a dir or not m_lastHandleUrlStatJob = KIO::stat(url, KIO::HideProgressInfo); - if (m_lastHandleUrlStatJob->ui()) { + if (m_lastHandleUrlStatJob->uiDelegate()) { KJobWidgets::setWindow(m_lastHandleUrlStatJob, this); } connect(m_lastHandleUrlStatJob, &KIO::Job::result, diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index 92a020003..6e1c3d3dd 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -907,7 +907,7 @@ void KFileItemModelRolesUpdater::startPreviewJob() KIO::PreviewJob* job = new KIO::PreviewJob(itemSubSet, cacheSize, &m_enabledPlugins); job->setIgnoreMaximumSize(itemSubSet.first().isLocalFile()); - if (job->ui()) { + if (job->uiDelegate()) { KJobWidgets::setWindow(job, qApp->activeWindow()); } diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp index 276cf5672..8b759d813 100644 --- a/src/panels/folders/folderspanel.cpp +++ b/src/panels/folders/folderspanel.cpp @@ -260,7 +260,7 @@ void FoldersPanel::slotRoleEditingFinished(int index, const QByteArray& role, co KIO::Job* job = KIO::moveAs(oldUrl, newUrl); KJobWidgets::setWindow(job, this); KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job); - job->ui()->setAutoErrorHandlingEnabled(true); + job->uiDelegate()->setAutoErrorHandlingEnabled(true); } } } diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp index ec4186db2..51fc229c1 100644 --- a/src/panels/folders/treeviewcontextmenu.cpp +++ b/src/panels/folders/treeviewcontextmenu.cpp @@ -201,7 +201,7 @@ void TreeViewContextMenu::moveToTrash() KIO::Job* job = KIO::trash(list); KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, QUrl(QStringLiteral("trash:/")), job); KJobWidgets::setWindow(job, m_parent); - job->ui()->setAutoErrorHandlingEnabled(true); + job->uiDelegate()->setAutoErrorHandlingEnabled(true); } } @@ -213,7 +213,7 @@ void TreeViewContextMenu::deleteItem() if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::DefaultConfirmation)) { KIO::Job* job = KIO::del(list); KJobWidgets::setWindow(job, m_parent); - job->ui()->setAutoErrorHandlingEnabled(true); + job->uiDelegate()->setAutoErrorHandlingEnabled(true); } } diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp index 3f778b07a..16dc721b2 100644 --- a/src/panels/information/informationpanel.cpp +++ b/src/panels/information/informationpanel.cpp @@ -185,7 +185,7 @@ void InformationPanel::showItemInfo() // No item is hovered and no selection has been done: provide // an item for the currently shown directory. m_folderStatJob = KIO::stat(url(), KIO::HideProgressInfo); - if (m_folderStatJob->ui()) { + if (m_folderStatJob->uiDelegate()) { KJobWidgets::setWindow(m_folderStatJob, this); } connect(m_folderStatJob, &KIO::Job::result, diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index d519ff121..9478aaf45 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -195,7 +195,7 @@ void InformationPanelContent::showItem(const KFileItem& item) m_previewJob = new KIO::PreviewJob(KFileItemList() << item, QSize(m_preview->width(), m_preview->height())); m_previewJob->setScaleType(KIO::PreviewJob::Unscaled); m_previewJob->setIgnoreMaximumSize(item.isLocalFile()); - if (m_previewJob->ui()) { + if (m_previewJob->uiDelegate()) { KJobWidgets::setWindow(m_previewJob, this); } diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index da68210c1..e952f23a0 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -137,7 +137,7 @@ void TerminalPanel::changeDir(const QUrl& url) sendCdToTerminal(url.toLocalFile()); } else { m_mostLocalUrlJob = KIO::mostLocalUrl(url, KIO::HideProgressInfo); - if (m_mostLocalUrlJob->ui()) { + if (m_mostLocalUrlJob->uiDelegate()) { KJobWidgets::setWindow(m_mostLocalUrlJob, this); } connect(m_mostLocalUrlJob, &KIO::StatJob::result, this, &TerminalPanel::slotMostLocalUrlResult); diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 7d85fa240..f5ba63d1e 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1534,7 +1534,7 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con KIO::Job * job = KIO::moveAs(oldUrl, newUrl); KJobWidgets::setWindow(job, this); KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job); - job->ui()->setAutoErrorHandlingEnabled(true); + job->uiDelegate()->setAutoErrorHandlingEnabled(true); if (!newNameExistsAlready) { // Only connect the result signal if there is no item with the new name diff --git a/src/views/renamedialog.cpp b/src/views/renamedialog.cpp index a514ede1e..c73f003a8 100644 --- a/src/views/renamedialog.cpp +++ b/src/views/renamedialog.cpp @@ -162,7 +162,7 @@ void RenameDialog::renameItem(const KFileItem &item, const QString& newName) KIO::Job * job = KIO::moveAs(oldUrl, newUrl); KJobWidgets::setWindow(job, widget); KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job); - job->ui()->setAutoErrorHandlingEnabled(true); + job->uiDelegate()->setAutoErrorHandlingEnabled(true); } void RenameDialog::slotAccepted() diff --git a/src/views/tooltips/tooltipmanager.cpp b/src/views/tooltips/tooltipmanager.cpp index 0636df795..404d6801c 100644 --- a/src/views/tooltips/tooltipmanager.cpp +++ b/src/views/tooltips/tooltipmanager.cpp @@ -130,7 +130,7 @@ void ToolTipManager::startContentRetrieval() KIO::PreviewJob* job = new KIO::PreviewJob(KFileItemList() << m_item, QSize(256, 256)); job->setIgnoreMaximumSize(m_item.isLocalFile()); - if (job->ui()) { + if (job->uiDelegate()) { KJobWidgets::setWindow(job, qApp->activeWindow()); } -- cgit v1.3 From 97b5435b6b3debc443f8fa815d0f2adcef61f492 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Wed, 18 Jan 2017 23:49:41 +0100 Subject: Remove extra semicolon GIT_SILENT --- src/tests/kitemsettest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tests/kitemsettest.cpp b/src/tests/kitemsettest.cpp index f559475a6..d31993947 100644 --- a/src/tests/kitemsettest.cpp +++ b/src/tests/kitemsettest.cpp @@ -22,7 +22,7 @@ #include #include -Q_DECLARE_METATYPE(KItemRangeList); +Q_DECLARE_METATYPE(KItemRangeList) /** * Converts a KItemRangeList to a KItemSet. -- cgit v1.3 From d8ffea247626842ac0f9e5048c8be05c250ff719 Mon Sep 17 00:00:00 2001 From: Don Nguyen Date: Sat, 21 Jan 2017 00:00:34 +0100 Subject: Dolphin: directory loading progress Everything is already set up to show the directory loading progress in the status bar, but the signal KFileItemModel::directoryLoadingProgress is never emmited anywhere. I connected it to KFileItemModelDirLister::percent. This was difficult to test because I had a hard time finding a directory that didn't load almost immediately. I was able to verify the fix by listing a remote directory of 20,000 files (see screenshot) REVIEW: 129619 --- src/kitemviews/kfileitemmodel.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index c35d164e1..aaa628102 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -80,6 +80,7 @@ KFileItemModel::KFileItemModel(QObject* parent) : connect(m_dirLister, static_cast(&KFileItemModelDirLister::clear), this, &KFileItemModel::slotClear); connect(m_dirLister, &KFileItemModelDirLister::infoMessage, this, &KFileItemModel::infoMessage); connect(m_dirLister, &KFileItemModelDirLister::errorMessage, this, &KFileItemModel::errorMessage); + connect(m_dirLister, &KFileItemModelDirLister::percent, this, &KFileItemModel::directoryLoadingProgress); connect(m_dirLister, static_cast(&KFileItemModelDirLister::redirection), this, &KFileItemModel::directoryRedirection); connect(m_dirLister, &KFileItemModelDirLister::urlIsFileError, this, &KFileItemModel::urlIsFileError); -- cgit v1.3 From 0aed243bebae72d85aa06032bdf2d6ba2b58141d Mon Sep 17 00:00:00 2001 From: Don Nguyen Date: Sat, 21 Jan 2017 00:04:38 +0100 Subject: Change "Date" to "Modified" and allow access to new "Accessed" time field This is merge of #128964 and #128942. This will impelement changing the "Date" field to "Modified" and allow a new "Accessed" time field to be available. This also includes changes to update configuration files. REVIEW: 129077 --- src/kitemviews/kfileitemlistwidget.cpp | 2 +- src/kitemviews/kfileitemmodel.cpp | 58 ++++++++++++++++++++-------------- src/kitemviews/kfileitemmodel.h | 4 +-- src/panels/places/placesitemmodel.cpp | 2 +- src/settings/viewpropertiesdialog.cpp | 2 +- src/tests/kfileitemmodeltest.cpp | 8 ++--- src/views/viewproperties.cpp | 31 ++++++++++++++++-- src/views/viewproperties.h | 6 ++++ 8 files changed, 78 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/kitemviews/kfileitemlistwidget.cpp b/src/kitemviews/kfileitemlistwidget.cpp index 7e5b4bb13..e0548ab2a 100644 --- a/src/kitemviews/kfileitemlistwidget.cpp +++ b/src/kitemviews/kfileitemlistwidget.cpp @@ -80,7 +80,7 @@ QString KFileItemListWidgetInformant::roleText(const QByteArray& role, const KIO::filesize_t size = roleValue.value(); text = KFormat().formatByteSize(size); } - } else if (role == "date") { + } else if (role == "modificationtime" || role == "accesstime") { const QDateTime dateTime = roleValue.toDateTime(); text = QLocale().toString(dateTime, QLocale::ShortFormat); } else { diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index aaa628102..7e14baff0 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -328,7 +328,8 @@ QList > KFileItemModel::groups() const switch (typeForRole(sortRole())) { case NameRole: m_groups = nameRoleGroups(); break; case SizeRole: m_groups = sizeRoleGroups(); break; - case DateRole: m_groups = dateRoleGroups(); break; + case ModificationTimeRole: m_groups = timeRoleGroups(KFileItem::ModificationTime); break; + case AccessTimeRole: m_groups = timeRoleGroups(KFileItem::AccessTime); break; case PermissionsRole: m_groups = permissionRoleGroups(); break; case RatingRole: m_groups = ratingRoleGroups(); break; default: m_groups = genericStringRoleGroups(sortRole()); break; @@ -1532,12 +1533,20 @@ QHash KFileItemModel::retrieveData(const KFileItem& item, data.insert(sharedValue("size"), item.size()); } - if (m_requestRole[DateRole]) { + if (m_requestRole[ModificationTimeRole]) { // Don't use KFileItem::timeString() as this is too expensive when // having several thousands of items. Instead the formatting of the // date-time will be done on-demand by the view when the date will be shown. const QDateTime dateTime = item.time(KFileItem::ModificationTime); - data.insert(sharedValue("date"), dateTime); + data.insert(sharedValue("modificationtime"), dateTime); + } + + if (m_requestRole[AccessTimeRole]) { + // Don't use KFileItem::timeString() as this is too expensive when + // having several thousands of items. Instead the formatting of the + // date-time will be done on-demand by the view when the date will be shown. + const QDateTime dateTime = item.time(KFileItem::AccessTime); + data.insert(sharedValue("accesstime"), dateTime); } if (m_requestRole[PermissionsRole]) { @@ -1762,7 +1771,7 @@ int KFileItemModel::sortRoleCompare(const ItemData* a, const ItemData* b, const break; } - case DateRole: { + case ModificationTimeRole: { const QDateTime dateTimeA = itemA.time(KFileItem::ModificationTime); const QDateTime dateTimeB = itemB.time(KFileItem::ModificationTime); if (dateTimeA < dateTimeB) { @@ -1942,7 +1951,7 @@ QList > KFileItemModel::sizeRoleGroups() const return groups; } -QList > KFileItemModel::dateRoleGroups() const +QList > KFileItemModel::timeRoleGroups(KFileItem::FileTimes which) const { Q_ASSERT(!m_itemData.isEmpty()); @@ -1951,26 +1960,26 @@ QList > KFileItemModel::dateRoleGroups() const const QDate currentDate = QDate::currentDate(); - QDate previousModifiedDate; + QDate previousFileDate; QString groupValue; for (int i = 0; i <= maxIndex; ++i) { if (isChildItem(i)) { continue; } - const QDateTime modifiedTime = m_itemData.at(i)->item.time(KFileItem::ModificationTime); - const QDate modifiedDate = modifiedTime.date(); - if (modifiedDate == previousModifiedDate) { + const QDateTime fileTime = m_itemData.at(i)->item.time(which); + const QDate fileDate = fileTime.date(); + if (fileDate == previousFileDate) { // The current item is in the same group as the previous item continue; } - previousModifiedDate = modifiedDate; + previousFileDate = fileDate; - const int daysDistance = modifiedDate.daysTo(currentDate); + const int daysDistance = fileDate.daysTo(currentDate); QString newGroupValue; - if (currentDate.year() == modifiedDate.year() && - currentDate.month() == modifiedDate.month()) { + if (currentDate.year() == fileDate.year() && + currentDate.month() == fileDate.month()) { switch (daysDistance / 7) { case 0: @@ -1978,7 +1987,7 @@ QList > KFileItemModel::dateRoleGroups() const case 0: newGroupValue = i18nc("@title:group Date", "Today"); break; case 1: newGroupValue = i18nc("@title:group Date", "Yesterday"); break; default: - newGroupValue = modifiedTime.toString( + newGroupValue = fileTime.toString( i18nc("@title:group Date: The week day name: dddd", "dddd")); newGroupValue = i18nc("Can be used to script translation of \"dddd\"" "with context @title:group Date", "%1", newGroupValue); @@ -2002,18 +2011,18 @@ QList > KFileItemModel::dateRoleGroups() const } } else { const QDate lastMonthDate = currentDate.addMonths(-1); - if (lastMonthDate.year() == modifiedDate.year() && - lastMonthDate.month() == modifiedDate.month()) { + if (lastMonthDate.year() == fileDate.year() && + lastMonthDate.month() == fileDate.month()) { if (daysDistance == 1) { - newGroupValue = modifiedTime.toString(i18nc("@title:group Date: " + newGroupValue = fileTime.toString(i18nc("@title:group Date: " "MMMM is full month name in current locale, and yyyy is " "full year number", "'Yesterday' (MMMM, yyyy)")); newGroupValue = i18nc("Can be used to script translation of " "\"'Yesterday' (MMMM, yyyy)\" with context @title:group Date", "%1", newGroupValue); } else if (daysDistance <= 7) { - newGroupValue = modifiedTime.toString(i18nc("@title:group Date: " + newGroupValue = fileTime.toString(i18nc("@title:group Date: " "The week day name: dddd, MMMM is full month name " "in current locale, and yyyy is full year number", "dddd (MMMM, yyyy)")); @@ -2021,28 +2030,28 @@ QList > KFileItemModel::dateRoleGroups() const "\"dddd (MMMM, yyyy)\" with context @title:group Date", "%1", newGroupValue); } else if (daysDistance <= 7 * 2) { - newGroupValue = modifiedTime.toString(i18nc("@title:group Date: " + newGroupValue = fileTime.toString(i18nc("@title:group Date: " "MMMM is full month name in current locale, and yyyy is " "full year number", "'One Week Ago' (MMMM, yyyy)")); newGroupValue = i18nc("Can be used to script translation of " "\"'One Week Ago' (MMMM, yyyy)\" with context @title:group Date", "%1", newGroupValue); } else if (daysDistance <= 7 * 3) { - newGroupValue = modifiedTime.toString(i18nc("@title:group Date: " + newGroupValue = fileTime.toString(i18nc("@title:group Date: " "MMMM is full month name in current locale, and yyyy is " "full year number", "'Two Weeks Ago' (MMMM, yyyy)")); newGroupValue = i18nc("Can be used to script translation of " "\"'Two Weeks Ago' (MMMM, yyyy)\" with context @title:group Date", "%1", newGroupValue); } else if (daysDistance <= 7 * 4) { - newGroupValue = modifiedTime.toString(i18nc("@title:group Date: " + newGroupValue = fileTime.toString(i18nc("@title:group Date: " "MMMM is full month name in current locale, and yyyy is " "full year number", "'Three Weeks Ago' (MMMM, yyyy)")); newGroupValue = i18nc("Can be used to script translation of " "\"'Three Weeks Ago' (MMMM, yyyy)\" with context @title:group Date", "%1", newGroupValue); } else { - newGroupValue = modifiedTime.toString(i18nc("@title:group Date: " + newGroupValue = fileTime.toString(i18nc("@title:group Date: " "MMMM is full month name in current locale, and yyyy is " "full year number", "'Earlier on' MMMM, yyyy")); newGroupValue = i18nc("Can be used to script translation of " @@ -2050,7 +2059,7 @@ QList > KFileItemModel::dateRoleGroups() const "%1", newGroupValue); } } else { - newGroupValue = modifiedTime.toString(i18nc("@title:group " + newGroupValue = fileTime.toString(i18nc("@title:group " "The month and year: MMMM is full month name in current locale, " "and yyyy is full year number", "MMMM, yyyy")); newGroupValue = i18nc("Can be used to script translation of " @@ -2221,7 +2230,8 @@ const KFileItemModel::RoleInfoMap* KFileItemModel::rolesInfoMap(int& count) { 0, NoRole, 0, 0, 0, 0, false, false }, { "text", NameRole, I18N_NOOP2_NOSTRIP("@label", "Name"), 0, 0, false, false }, { "size", SizeRole, I18N_NOOP2_NOSTRIP("@label", "Size"), 0, 0, false, false }, - { "date", DateRole, I18N_NOOP2_NOSTRIP("@label", "Date"), 0, 0, false, false }, + { "modificationtime", ModificationTimeRole, I18N_NOOP2_NOSTRIP("@label", "Modified"), 0, 0, false, false }, + { "accesstime", AccessTimeRole, I18N_NOOP2_NOSTRIP("@label", "Accessed"), 0, 0, false, false }, { "type", TypeRole, I18N_NOOP2_NOSTRIP("@label", "Type"), 0, 0, false, false }, { "rating", RatingRole, I18N_NOOP2_NOSTRIP("@label", "Rating"), 0, 0, true, false }, { "tags", TagsRole, I18N_NOOP2_NOSTRIP("@label", "Tags"), 0, 0, true, false }, diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h index 717afb9a7..dc5746a89 100644 --- a/src/kitemviews/kfileitemmodel.h +++ b/src/kitemviews/kfileitemmodel.h @@ -280,7 +280,7 @@ private slots: private: enum RoleType { // User visible roles: - NoRole, NameRole, SizeRole, DateRole, PermissionsRole, OwnerRole, + NoRole, NameRole, SizeRole, ModificationTimeRole, AccessTimeRole, PermissionsRole, OwnerRole, GroupRole, TypeRole, DestinationRole, PathRole, // User visible roles available with Baloo: CommentRole, TagsRole, RatingRole, ImageSizeRole, OrientationRole, @@ -383,7 +383,7 @@ private: QList > nameRoleGroups() const; QList > sizeRoleGroups() const; - QList > dateRoleGroups() const; + QList > timeRoleGroups(KFileItem::FileTimes which) const; QList > permissionRoleGroups() const; QList > ratingRoleGroups() const; QList > genericStringRoleGroups(const QByteArray& typeForRole) const; diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 25c4d51f6..8a02ead01 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -872,7 +872,7 @@ PlacesItem* PlacesItemModel::createSystemPlacesItem(const SystemBookmarkData& da props.setVisibleRoles({"text"}); } else if (data.url.scheme() == QLatin1String("timeline")) { props.setViewMode(DolphinView::DetailsView); - props.setVisibleRoles({"text", "date"}); + props.setVisibleRoles({"text", "modificationtime"}); } } } diff --git a/src/settings/viewpropertiesdialog.cpp b/src/settings/viewpropertiesdialog.cpp index 7407042d7..c317ed052 100644 --- a/src/settings/viewpropertiesdialog.cpp +++ b/src/settings/viewpropertiesdialog.cpp @@ -303,7 +303,7 @@ void ViewPropertiesDialog::configureAdditionalInfo() visibleRoles.clear(); visibleRoles.append("text"); visibleRoles.append("size"); - visibleRoles.append("date"); + visibleRoles.append("modificationtime"); m_viewProps->setVisibleRoles(visibleRoles); } diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp index ac15693b6..59ff63069 100644 --- a/src/tests/kfileitemmodeltest.cpp +++ b/src/tests/kfileitemmodeltest.cpp @@ -882,8 +882,8 @@ void KFileItemModelTest::testSorting() // Sort by Date, descending m_model->setSortDirectoriesFirst(true); - m_model->setSortRole("date"); - QCOMPARE(m_model->sortRole(), QByteArray("date")); + m_model->setSortRole("modificationtime"); + QCOMPARE(m_model->sortRole(), QByteArray("modificationtime")); QCOMPARE(m_model->sortOrder(), Qt::DescendingOrder); QCOMPARE(itemsInModel(), QStringList() << "c" << "c-2" << "c-3" << "c-1" << "b" << "d" << "a" << "e"); QCOMPARE(itemsMovedSpy.count(), 1); @@ -892,7 +892,7 @@ void KFileItemModelTest::testSorting() // Sort by Date, ascending m_model->setSortOrder(Qt::AscendingOrder); - QCOMPARE(m_model->sortRole(), QByteArray("date")); + QCOMPARE(m_model->sortRole(), QByteArray("modificationtime")); QCOMPARE(m_model->sortOrder(), Qt::AscendingOrder); QCOMPARE(itemsInModel(), QStringList() << "c" << "c-2" << "c-3" << "c-1" << "e" << "a" << "d" << "b"); QCOMPARE(itemsMovedSpy.count(), 1); @@ -901,7 +901,7 @@ void KFileItemModelTest::testSorting() // Sort by Date, ascending, 'Sort Folders First' disabled m_model->setSortDirectoriesFirst(false); - QCOMPARE(m_model->sortRole(), QByteArray("date")); + QCOMPARE(m_model->sortRole(), QByteArray("modificationtime")); QCOMPARE(m_model->sortOrder(), Qt::AscendingOrder); QVERIFY(!m_model->sortDirectoriesFirst()); QCOMPARE(itemsInModel(), QStringList() << "e" << "a" << "c" << "c-1" << "c-2" << "c-3" << "d" << "b"); diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index 597baa293..ca52be890 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -35,7 +35,8 @@ namespace { const int AdditionalInfoViewPropertiesVersion = 1; const int NameRolePropertiesVersion = 2; - const int CurrentViewPropertiesVersion = 3; + const int DateRolePropertiesVersion = 4; + const int CurrentViewPropertiesVersion = 4; // String representation to mark the additional properties of // the details view as customized by the user. See @@ -123,6 +124,11 @@ ViewProperties::ViewProperties(const QUrl& url) : Q_ASSERT(m_node->version() == NameRolePropertiesVersion); } + if (m_node->version() < DateRolePropertiesVersion) { + convertDateRoleToModificationTimeRole(); + Q_ASSERT(m_node->version() == DateRolePropertiesVersion); + } + m_node->setVersion(CurrentViewPropertiesVersion); } } @@ -309,7 +315,7 @@ QList ViewProperties::visibleRoles() const && !visibleRoles.contains(CustomizedDetailsString); if (useDefaultValues) { roles.append("size"); - roles.append("date"); + roles.append("modificationtime"); } return roles; @@ -448,6 +454,27 @@ void ViewProperties::convertNameRoleToTextRole() update(); } +void ViewProperties::convertDateRoleToModificationTimeRole() +{ + QStringList visibleRoles = m_node->visibleRoles(); + for (int i = 0; i < visibleRoles.count(); ++i) { + if (visibleRoles[i].endsWith(QLatin1String("_date"))) { + const int leftLength = visibleRoles[i].length() - 5; + visibleRoles[i] = visibleRoles[i].left(leftLength) + "_modificationtime"; + } + } + + QString sortRole = m_node->sortRole(); + if (sortRole == QLatin1String("date")) { + sortRole = QStringLiteral("modificationtime"); + } + + m_node->setVisibleRoles(visibleRoles); + m_node->setSortRole(sortRole); + m_node->setVersion(DateRolePropertiesVersion); + update(); +} + bool ViewProperties::isPartOfHome(const QString& filePath) { // For performance reasons cache the path in a static QString diff --git a/src/views/viewproperties.h b/src/views/viewproperties.h index dc118e2d7..05b80f455 100644 --- a/src/views/viewproperties.h +++ b/src/views/viewproperties.h @@ -153,6 +153,12 @@ private: */ void convertNameRoleToTextRole(); + /** + * Provides backward compatibility with .directory files created with + * Dolphin < 16.11.70: Converts the old name-role "date" to "modificationtime" + */ + + void convertDateRoleToModificationTimeRole(); /** * Returns true, if \a filePath is part of the home-path (see QDir::homePath()). */ -- cgit v1.3 From 728e6712b8833538117faec81ad6324b385c5765 Mon Sep 17 00:00:00 2001 From: Gregor Mi Date: Sat, 21 Jan 2017 00:07:49 +0100 Subject: DolphinSearchBox: Add a "More search tools..." menu button Additionally, moves the "More/Fewer options" button from right to left to reduce the mouse travelling distance when the dolphin is maximized on a large screen (see screenshots) The current location url will be passed to the search tool to set the initial search root directory. REVIEW: 123883 --- src/search/dolphinsearchbox.cpp | 19 ++++++++++++++++++- src/search/dolphinsearchbox.h | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 60a4a7567..5d5906b78 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -385,6 +386,20 @@ void DolphinSearchBox::init() searchLocationGroup->addButton(m_fromHereButton); searchLocationGroup->addButton(m_everywhereButton); + auto moreSearchToolsButton = new QToolButton(this); + moreSearchToolsButton->setAutoRaise(true); + moreSearchToolsButton->setPopupMode(QToolButton::InstantPopup); + moreSearchToolsButton->setIcon(QIcon::fromTheme("arrow-down-double")); + moreSearchToolsButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + moreSearchToolsButton->setText(i18n("More Search Tools")); + moreSearchToolsButton->setMenu(new QMenu(this)); + connect(moreSearchToolsButton->menu(), &QMenu::aboutToShow, moreSearchToolsButton->menu(), [this, moreSearchToolsButton]() + { + m_menuFactory.reset(new KMoreToolsMenuFactory("dolphin/search-tools")); + moreSearchToolsButton->menu()->clear(); + m_menuFactory->fillMenuFromGroupingNames(moreSearchToolsButton->menu(), { "files-find" }, this->m_searchPath); + } ); + // Create "Facets" widgets m_facetsToggleButton = new QToolButton(this); m_facetsToggleButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); @@ -404,8 +419,10 @@ void DolphinSearchBox::init() optionsLayout->addWidget(m_separator); optionsLayout->addWidget(m_fromHereButton); optionsLayout->addWidget(m_everywhereButton); - optionsLayout->addStretch(1); + optionsLayout->addWidget(new KSeparator(Qt::Vertical, this)); optionsLayout->addWidget(m_facetsToggleButton); + optionsLayout->addWidget(moreSearchToolsButton); + optionsLayout->addStretch(1); // Put the options into a QScrollArea. This prevents increasing the view width // in case that not enough width for the options is available. diff --git a/src/search/dolphinsearchbox.h b/src/search/dolphinsearchbox.h index b747679ec..5063c2bf5 100644 --- a/src/search/dolphinsearchbox.h +++ b/src/search/dolphinsearchbox.h @@ -30,6 +30,7 @@ class QToolButton; class QScrollArea; class QLabel; class QVBoxLayout; +class KMoreToolsMenuFactory; /** * @brief Input box for searching files with or without Baloo. @@ -176,6 +177,7 @@ private: DolphinFacetsWidget* m_facetsWidget; QUrl m_searchPath; + QScopedPointer m_menuFactory; QTimer* m_startSearchTimer; }; -- cgit v1.3 From 2e8e30026a207d380379fb2be0e4327bf4f455e8 Mon Sep 17 00:00:00 2001 From: Marc André Wittorf Date: Sat, 21 Jan 2017 01:37:35 +0100 Subject: Fix missing audio duration in details view Enabling the 'duration' column in a folder with audio files did only show empty information. Properly initializing the QTime object fixes this. Testing Done Find a folder with audio files Make sure that Baloo has indexed this folder Open this folder in Dolphin, detail view, enable the Audio/Duration column Unpatched Dolphin does not display audio duration, patched Dolphin does Tested on Gentoo x86_64 with Qt 5.5.1, KF 5.21.0 and Arch x86_64 with Qt 5.6.0 and KF 5.21.0. REVIEW: 127799 --- src/kitemviews/private/kbaloorolesprovider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/kitemviews/private/kbaloorolesprovider.cpp b/src/kitemviews/private/kbaloorolesprovider.cpp index e0b889e6c..2ce1f7bf6 100644 --- a/src/kitemviews/private/kbaloorolesprovider.cpp +++ b/src/kitemviews/private/kbaloorolesprovider.cpp @@ -181,7 +181,7 @@ QString KBalooRolesProvider::orientationFromValue(int value) const QString KBalooRolesProvider::durationFromValue(int value) const { - QTime duration; + QTime duration(0, 0, 0); duration = duration.addSecs(value); return duration.toString(QStringLiteral("hh:mm:ss")); } -- cgit v1.3 From c1d9becda259c0df58b1447b69f573b6ef13bfa1 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sat, 21 Jan 2017 23:36:40 +0100 Subject: informationpanel: don't change color of scrollarea's viewport This code was added a long time ago in b1c9b5126d, but the commit message doesn't explain why. If we remove it nothing seems to change and we fix the ugly background on the scrollbar when Breeze draws a frame around dockable panels. BUG: 366203 FIXED-IN: 16.12.2 REVIEW: 129861 --- src/panels/information/informationpanelcontent.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index d519ff121..f56f5eaf6 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -142,10 +142,6 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) : QWidget* viewport = m_metaDataArea->viewport(); viewport->installEventFilter(this); - QPalette palette = viewport->palette(); - palette.setColor(viewport->backgroundRole(), QColor(Qt::transparent)); - viewport->setPalette(palette); - layout->addWidget(m_preview); layout->addWidget(m_phononWidget); layout->addWidget(m_nameLabel); -- cgit v1.3 From e582b13f8485dc9c9fc4b23f72d007dc99deec9b Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Tue, 31 Jan 2017 20:50:47 +0100 Subject: Hide progress info for rename jobs in rename dialog When mass-renaming files, you could end up with a a gazillion notifications of a finished move job. This fixes this. Ideally we would have one job which had the rename jobs as subjobs to still get progress info for the overall task. Differential Revision: https://phabricator.kde.org/D4372 --- src/views/renamedialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/views/renamedialog.cpp b/src/views/renamedialog.cpp index a514ede1e..cf8f6885d 100644 --- a/src/views/renamedialog.cpp +++ b/src/views/renamedialog.cpp @@ -159,7 +159,7 @@ void RenameDialog::renameItem(const KFileItem &item, const QString& newName) widget = this; } - KIO::Job * job = KIO::moveAs(oldUrl, newUrl); + KIO::Job * job = KIO::moveAs(oldUrl, newUrl, KIO::HideProgressInfo); KJobWidgets::setWindow(job, widget); KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job); job->ui()->setAutoErrorHandlingEnabled(true); -- cgit v1.3 From 92cd75773389405f60c4672ff9c5887e1418d494 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Fri, 3 Feb 2017 03:56:59 +0100 Subject: GIT_SILENT made messages (after extraction) --- src/org.kde.dolphin.appdata.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/org.kde.dolphin.appdata.xml b/src/org.kde.dolphin.appdata.xml index 233819559..288eb8009 100644 --- a/src/org.kde.dolphin.appdata.xml +++ b/src/org.kde.dolphin.appdata.xml @@ -443,7 +443,7 @@
  • Geri alma/tekrarlama desteği
  • Підтримка скасовування та повторення дій.
  • xxUndo/redo supportxx
  • -
  • 撤消/重做支持
  • +
  • 撤销/重做支持
  • 以不唐突的方式顯示資訊對話框。
  • Transparent network access through the KIO system.
  • اتصال شبكيّ مباشر باستخدام نظام KIO.
  • -- cgit v1.3 From 01edd6480ca967fefe8dbbf61d9ca1fd9e3889ff Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Fri, 3 Feb 2017 07:02:22 +0100 Subject: GIT_SILENT made messages (after extraction) --- src/org.kde.dolphin.appdata.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/org.kde.dolphin.appdata.xml b/src/org.kde.dolphin.appdata.xml index d0cec5030..f7bd2ad63 100644 --- a/src/org.kde.dolphin.appdata.xml +++ b/src/org.kde.dolphin.appdata.xml @@ -450,7 +450,7 @@
  • Geri alma/tekrarlama desteği
  • Підтримка скасовування та повторення дій.
  • xxUndo/redo supportxx
  • -
  • 撤消/重做支持
  • +
  • 撤销/重做支持
  • 以不唐突的方式顯示資訊對話框。
  • Transparent network access through the KIO system.
  • اتصال شبكيّ مباشر باستخدام نظام KIO.
  • -- cgit v1.3 From 5c74fc0666aec1cf8432b0f58528d9f17c5568d3 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Sun, 5 Feb 2017 03:46:09 +0100 Subject: GIT_SILENT made messages (after extraction) --- src/org.kde.dolphin.appdata.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/org.kde.dolphin.appdata.xml b/src/org.kde.dolphin.appdata.xml index 288eb8009..24e3d5687 100644 --- a/src/org.kde.dolphin.appdata.xml +++ b/src/org.kde.dolphin.appdata.xml @@ -105,7 +105,7 @@

    Dolphin on vähest koormust tekitav failihaldur. Selle loomisel on peetud silmas kasutamise hõlpsust ja lihtsust, ometi pakub see suurt paindlikkust ja oma käe järgi kohandamise võimalusi. Sel moel saab faile hallata just, nagu ise soovid.

    Dolphin on kevyt tiedostonhallinta. Se on suunniteltu helppokäyttöiseksi ja yksinkertaiseksi, mutta silti joustavaksi ja mukautettavaksi. Voit siis hallita tiedostojasi juuri niin kuin haluat.

    Dolphin est un gestionnaire de fichier léger. Il a été conçu en gardant à l'esprit la simplicité et l'aisance à l'usage, tout en permettant flexibilité et personnalisation. Cela signifie que vous pouvez gérer vos fichiers de la manière exacte que vous voulez.

    -

    Dolphin é un xestor de ficheiros lixeiro. Deseñouse pensando na facilidade de uso e maila simplicidade, pero permitindo flexibilidade e personalización. Noutras palabras, permítelle xestionar os seus ficheiros do xeito que máis lle agrade.

    +

    Dolphin é un xestor de ficheiros lixeiro. Deseñouse pensando na facilidade de uso e a simplicidade, pero permitindo flexibilidade e personalización. Noutras palabras, permítelle xestionar os seus ficheiros do xeito que máis lle agrade.

    ‏Dolphin הוא מנהל קבצים קל־משקל. הוא עוצב לקלות שימוש ופשטות, תוך כדי אפשור גמישות והתאמה אישית. זה אומר שתוכל לנהל את קבציך איך שאתה רוצה לעשות זאת.

    A Dolphin egy pehelysúlyú fájlkezelő. Az egyszerű használatot és az egyszerűséget szem előtt tartva tervezték, miközben továbbra is lehetővé teszi a rugalmasságot és a testre szabhatóságot. Ez azt jelenti, hogy pontosan oly módon végezheti a fájlkezelést, ahogy csak akarja.

    Dolphin es un gerente de file legier. Il ha essite designate con facilitate de uso e simplicitate in le mente, mentre il permitte ancora flexibilitate e personalisation. Isto significa que tu pote facer le gerente de file exactemente como tu lo vole.

    -- cgit v1.3 From e3ea9b558e59b48e8b4a0abf779677093fbfde50 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Sun, 5 Feb 2017 05:58:09 +0100 Subject: 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 | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/views/versioncontrol/fileviewversioncontrolplugin.desktop b/src/views/versioncontrol/fileviewversioncontrolplugin.desktop index 67951cfe7..889c1232a 100644 --- a/src/views/versioncontrol/fileviewversioncontrolplugin.desktop +++ b/src/views/versioncontrol/fileviewversioncontrolplugin.desktop @@ -2,6 +2,7 @@ Type=ServiceType X-KDE-ServiceType=FileViewVersionControlPlugin Comment=Version Control Plugin for File Views +Comment[ar]=ملحقة تحكّم بالإصدارات لمناظير الملفّات Comment[ca]=Connector de control de versions per a les vistes de fitxers Comment[ca@valencia]=Connector de control de versions per a les vistes de fitxers Comment[cs]=Modul pro správu verzí pro pohledy na soubory -- cgit v1.3 From eb31ded156bca88b0301aa865f50fcbdf5cd7f97 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Sun, 5 Feb 2017 06:54:55 +0100 Subject: GIT_SILENT made messages (after extraction) --- src/org.kde.dolphin.appdata.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/org.kde.dolphin.appdata.xml b/src/org.kde.dolphin.appdata.xml index f7bd2ad63..0498689fa 100644 --- a/src/org.kde.dolphin.appdata.xml +++ b/src/org.kde.dolphin.appdata.xml @@ -105,7 +105,7 @@

    Dolphin on vähest koormust tekitav failihaldur. Selle loomisel on peetud silmas kasutamise hõlpsust ja lihtsust, ometi pakub see suurt paindlikkust ja oma käe järgi kohandamise võimalusi. Sel moel saab faile hallata just, nagu ise soovid.

    Dolphin on kevyt tiedostonhallinta. Se on suunniteltu helppokäyttöiseksi ja yksinkertaiseksi, mutta silti joustavaksi ja mukautettavaksi. Voit siis hallita tiedostojasi juuri niin kuin haluat.

    Dolphin est un gestionnaire de fichier léger. Il a été conçu en gardant à l'esprit la simplicité et l'aisance à l'usage, tout en permettant flexibilité et personnalisation. Cela signifie que vous pouvez gérer vos fichiers de la manière exacte que vous voulez.

    -

    Dolphin é un xestor de ficheiros lixeiro. Deseñouse pensando na facilidade de uso e maila simplicidade, pero permitindo flexibilidade e personalización. Noutras palabras, permítelle xestionar os seus ficheiros do xeito que máis lle agrade.

    +

    Dolphin é un xestor de ficheiros lixeiro. Deseñouse pensando na facilidade de uso e a simplicidade, pero permitindo flexibilidade e personalización. Noutras palabras, permítelle xestionar os seus ficheiros do xeito que máis lle agrade.

    ‏Dolphin הוא מנהל קבצים קל־משקל. הוא עוצב לקלות שימוש ופשטות, תוך כדי אפשור גמישות והתאמה אישית. זה אומר שתוכל לנהל את קבציך איך שאתה רוצה לעשות זאת.

    A Dolphin egy pehelysúlyú fájlkezelő. Az egyszerű használatot és az egyszerűséget szem előtt tartva tervezték, miközben továbbra is lehetővé teszi a rugalmasságot és a testre szabhatóságot. Ez azt jelenti, hogy pontosan oly módon végezheti a fájlkezelést, ahogy csak akarja.

    Dolphin es un gerente de file legier. Il ha essite designate con facilitate de uso e simplicitate in le mente, mentre il permitte ancora flexibilitate e personalisation. Isto significa que tu pote facer le gerente de file exactemente como tu lo vole.

    -- cgit v1.3 From 230fe13d1fccf8c2ab09c0873c1cc4c733cfc3b4 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sun, 5 Feb 2017 22:53:50 +0100 Subject: Port tooltips to KToolTipWidget Use the new KToolTipWidget class (introduced by kwidgetsaddons 5.30) as backend of ToolTipManager. FileMetaDataToolTip becomes a simple widget used as content of the tooltip. It is now possible to actually use the metadata widget shown inside the tooltips. Tooltips are now functional on Wayland as well. More information about KToolTipWidget in https://git.reviewboard.kde.org/r/129648/ BUG: 352276 BUG: 371223 FIXED-IN: 17.04.0 Closes T4980 Differential Revision: D4449 --- CMakeLists.txt | 2 +- src/views/dolphinview.cpp | 2 +- src/views/tooltips/filemetadatatooltip.cpp | 19 ------- src/views/tooltips/filemetadatatooltip.h | 8 +-- src/views/tooltips/tooltipmanager.cpp | 84 ++++-------------------------- src/views/tooltips/tooltipmanager.h | 10 +++- 6 files changed, 23 insertions(+), 102 deletions(-) (limited to 'src') diff --git a/CMakeLists.txt b/CMakeLists.txt index 814c00ff2..e3494f5a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ set (KDE_APPLICATIONS_VERSION_MICRO "70") set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}") set(QT_MIN_VERSION "5.5.0") -set(KF5_MIN_VERSION "5.21.0") +set(KF5_MIN_VERSION "5.30.0") set(ECM_MIN_VERSION "1.6.0") # ECM setup diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index f5ba63d1e..bfed3e847 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1021,7 +1021,7 @@ void DolphinView::slotItemHovered(int index) const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint()); itemRect.moveTo(pos); - m_toolTipManager->showToolTip(item, itemRect); + m_toolTipManager->showToolTip(item, itemRect, nativeParentWidget()->windowHandle()); } emit requestItemInfo(item); diff --git a/src/views/tooltips/filemetadatatooltip.cpp b/src/views/tooltips/filemetadatatooltip.cpp index 0d58717d4..2fbba8b9c 100644 --- a/src/views/tooltips/filemetadatatooltip.cpp +++ b/src/views/tooltips/filemetadatatooltip.cpp @@ -47,9 +47,6 @@ FileMetaDataToolTip::FileMetaDataToolTip(QWidget* parent) : m_name(0), m_fileMetaDataWidget(0) { - setAttribute(Qt::WA_TranslucentBackground); - setWindowFlags(Qt::ToolTip | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint); - // Create widget for file preview m_preview = new QLabel(this); m_preview->setAlignment(Qt::AlignTop); @@ -161,19 +158,3 @@ KFileItemList FileMetaDataToolTip::items() const return m_fileMetaDataWidget->items(); } -void FileMetaDataToolTip::paintEvent(QPaintEvent* event) -{ - QStylePainter painter(this); - QStyleOptionFrame option; - option.init(this); - painter.drawPrimitive(QStyle::PE_PanelTipLabel, option); - painter.end(); - - QWidget::paintEvent(event); -} - -void FileMetaDataToolTip::showEvent(QShowEvent *) -{ - KWindowEffects::enableBlurBehind(winId(), true, mask()); -} - diff --git a/src/views/tooltips/filemetadatatooltip.h b/src/views/tooltips/filemetadatatooltip.h index 379b025c8..1738e386c 100644 --- a/src/views/tooltips/filemetadatatooltip.h +++ b/src/views/tooltips/filemetadatatooltip.h @@ -37,8 +37,8 @@ namespace Baloo { #endif /** - * @brief Tooltip, that shows the meta information and a preview of one - * or more files. + * @brief Widget that shows the meta information and a preview of one + * or more files inside a KToolTipWidget. */ class FileMetaDataToolTip : public QWidget { @@ -69,10 +69,6 @@ signals: */ void metaDataRequestFinished(const KFileItemList& items); -protected: - virtual void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE; - virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE; - private: QLabel* m_preview; QLabel* m_name; diff --git a/src/views/tooltips/tooltipmanager.cpp b/src/views/tooltips/tooltipmanager.cpp index 404d6801c..d19e98c81 100644 --- a/src/views/tooltips/tooltipmanager.cpp +++ b/src/views/tooltips/tooltipmanager.cpp @@ -24,18 +24,22 @@ #include #include #include +#include #include #include #include #include #include +#include ToolTipManager::ToolTipManager(QWidget* parent) : QObject(parent), m_showToolTipTimer(0), m_contentRetrievalTimer(0), + m_transientParent(0), m_fileMetaDataToolTip(0), + m_tooltipWidget(new KToolTipWidget()), m_toolTipRequested(false), m_metaDataRequested(false), m_appliedWaitCursor(false), @@ -62,11 +66,9 @@ ToolTipManager::ToolTipManager(QWidget* parent) : ToolTipManager::~ToolTipManager() { - delete m_fileMetaDataToolTip; - m_fileMetaDataToolTip = 0; } -void ToolTipManager::showToolTip(const KFileItem& item, const QRectF& itemRect) +void ToolTipManager::showToolTip(const KFileItem& item, const QRectF& itemRect, QWindow *transientParent) { hideToolTip(); @@ -75,10 +77,12 @@ void ToolTipManager::showToolTip(const KFileItem& item, const QRectF& itemRect) m_itemRect.adjust(-m_margin, -m_margin, m_margin, m_margin); m_item = item; + m_transientParent = transientParent; + // Only start the retrieving of the content, when the mouse has been over this // item for 200 milliseconds. This prevents a lot of useless preview jobs and // meta data retrieval, when passing rapidly over a lot of items. - Q_ASSERT(!m_fileMetaDataToolTip); + delete m_fileMetaDataToolTip; m_fileMetaDataToolTip = new FileMetaDataToolTip(); connect(m_fileMetaDataToolTip, &FileMetaDataToolTip::metaDataRequestFinished, this, &ToolTipManager::slotMetaDataRequestFinished); @@ -100,14 +104,7 @@ void ToolTipManager::hideToolTip() m_metaDataRequested = false; m_showToolTipTimer->stop(); m_contentRetrievalTimer->stop(); - - if (m_fileMetaDataToolTip) { - m_fileMetaDataToolTip->hide(); - // Do not delete the tool tip immediately to prevent crashes when - // QCoreApplication tries to deliver an 'Enter' event to it, see bug 310579. - m_fileMetaDataToolTip->deleteLater(); - m_fileMetaDataToolTip = 0; - } + m_tooltipWidget->hideLater(); } void ToolTipManager::startContentRetrieval() @@ -200,68 +197,9 @@ void ToolTipManager::showToolTip() return; } - const QRect screen = QApplication::desktop()->screenGeometry(QCursor::pos()); - - // Restrict tooltip size to current screen size when needed. - // Because layout controlling widget doesn't respect widget's maximumSize property - // (correct me if I'm wrong), we need to let layout do its work, then manually change - // geometry if resulting widget doesn't fit the screen. - - // Step #1 - make sizeHint return calculated tooltip size - m_fileMetaDataToolTip->layout()->setSizeConstraint(QLayout::SetFixedSize); + // Adjust the size to get a proper sizeHint() m_fileMetaDataToolTip->adjustSize(); - QSize size = m_fileMetaDataToolTip->sizeHint(); - - // Step #2 - correct tooltip size when needed - if (size.width() > screen.width()) { - size.setWidth(screen.width()); - } - if (size.height() > screen.height()) { - size.setHeight(screen.height()); - } - - // m_itemRect defines the area of the item, where the tooltip should be - // shown. Per default the tooltip is shown centered at the bottom. - // It must be assured that: - // - the content is fully visible - // - the content is not drawn inside m_itemRect - const bool hasRoomToLeft = (m_itemRect.left() - size.width() - m_margin >= screen.left()); - const bool hasRoomToRight = (m_itemRect.right() + size.width() + m_margin <= screen.right()); - const bool hasRoomAbove = (m_itemRect.top() - size.height() - m_margin >= screen.top()); - const bool hasRoomBelow = (m_itemRect.bottom() + size.height() + m_margin <= screen.bottom()); - if (!hasRoomAbove && !hasRoomBelow && !hasRoomToLeft && !hasRoomToRight) { - return; - } - - int x, y; - if (hasRoomBelow || hasRoomAbove) { - x = qMax(screen.left(), m_itemRect.center().x() - size.width() / 2); - if (x + size.width() >= screen.right()) { - x = screen.right() - size.width() + 1; - } - if (hasRoomBelow) { - y = m_itemRect.bottom() + m_margin; - } else { - y = m_itemRect.top() - size.height() - m_margin; - } - } else { - Q_ASSERT(hasRoomToLeft || hasRoomToRight); - if (hasRoomToRight) { - x = m_itemRect.right() + m_margin; - } else { - x = m_itemRect.left() - size.width() - m_margin; - } - // Put the tooltip at the bottom of the screen. The x-coordinate has already - // been adjusted, so that no overlapping with m_itemRect occurs. - y = screen.bottom() - size.height() + 1; - } - - // Step #3 - Alter tooltip geometry - m_fileMetaDataToolTip->setFixedSize(size); - m_fileMetaDataToolTip->layout()->setSizeConstraint(QLayout::SetNoConstraint); - m_fileMetaDataToolTip->move(QPoint(x, y)); - m_fileMetaDataToolTip->show(); - + m_tooltipWidget->showBelow(m_itemRect, m_fileMetaDataToolTip, m_transientParent); m_toolTipRequested = false; } diff --git a/src/views/tooltips/tooltipmanager.h b/src/views/tooltips/tooltipmanager.h index f6d8b8f26..58fe68763 100644 --- a/src/views/tooltips/tooltipmanager.h +++ b/src/views/tooltips/tooltipmanager.h @@ -26,7 +26,9 @@ #include class FileMetaDataToolTip; +class KToolTipWidget; class QTimer; +class QWindow; /** * @brief Manages the tooltips for an item view. @@ -47,9 +49,9 @@ public: * Triggers the showing of the tooltip for the item \p item * where the item has the maximum boundaries of \p itemRect. * The tooltip manager takes care that the tooltip is shown - * slightly delayed. + * slightly delayed and with a proper \p transientParent. */ - void showToolTip(const KFileItem& item, const QRectF& itemRect); + void showToolTip(const KFileItem& item, const QRectF& itemRect, QWindow *transientParent); /** * Hides the currently shown tooltip. @@ -72,7 +74,11 @@ private: /// the tooltip content like preview and meta data gets started. QTimer* m_contentRetrievalTimer; + /// Transient parent of the tooltip, mandatory on Wayland. + QWindow* m_transientParent; + FileMetaDataToolTip* m_fileMetaDataToolTip; + QScopedPointer m_tooltipWidget; bool m_toolTipRequested; bool m_metaDataRequested; -- cgit v1.3 From 0b107078c3b54b96522ea8963876511e4157845c Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sun, 5 Feb 2017 22:58:36 +0100 Subject: Remove deprecated K_EXPORT_PLUGIN macros They do nothing, other than generate annoying compiler warnings. Differential Revision: https://phabricator.kde.org/D4438 --- src/settings/kcm/kcmdolphingeneral.cpp | 1 - src/settings/kcm/kcmdolphinnavigation.cpp | 1 - src/settings/kcm/kcmdolphinservices.cpp | 1 - src/settings/kcm/kcmdolphinviewmodes.cpp | 1 - 4 files changed, 4 deletions(-) (limited to 'src') diff --git a/src/settings/kcm/kcmdolphingeneral.cpp b/src/settings/kcm/kcmdolphingeneral.cpp index 3cf7e7652..f5ac4cd55 100644 --- a/src/settings/kcm/kcmdolphingeneral.cpp +++ b/src/settings/kcm/kcmdolphingeneral.cpp @@ -32,7 +32,6 @@ #include K_PLUGIN_FACTORY(KCMDolphinGeneralConfigFactory, registerPlugin(QStringLiteral("dolphingeneral"));) -K_EXPORT_PLUGIN(KCMDolphinGeneralConfigFactory("kcmdolphingeneral")) DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget* parent, const QVariantList& args) : KCModule(parent), diff --git a/src/settings/kcm/kcmdolphinnavigation.cpp b/src/settings/kcm/kcmdolphinnavigation.cpp index 7bdcfc534..9ec6ca166 100644 --- a/src/settings/kcm/kcmdolphinnavigation.cpp +++ b/src/settings/kcm/kcmdolphinnavigation.cpp @@ -27,7 +27,6 @@ #include K_PLUGIN_FACTORY(KCMDolphinNavigationConfigFactory, registerPlugin(QStringLiteral("dolphinnavigation"));) -K_EXPORT_PLUGIN(KCMDolphinNavigationConfigFactory("kcmdolphinnavigation")) DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget* parent, const QVariantList& args) : KCModule(parent), diff --git a/src/settings/kcm/kcmdolphinservices.cpp b/src/settings/kcm/kcmdolphinservices.cpp index 4885adf4f..39136724e 100644 --- a/src/settings/kcm/kcmdolphinservices.cpp +++ b/src/settings/kcm/kcmdolphinservices.cpp @@ -27,7 +27,6 @@ #include K_PLUGIN_FACTORY(KCMDolphinServicesConfigFactory, registerPlugin(QStringLiteral("dolphinservices"));) -K_EXPORT_PLUGIN(KCMDolphinServicesConfigFactory("kcmdolphinservices")) DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const QVariantList& args) : KCModule(parent), diff --git a/src/settings/kcm/kcmdolphinviewmodes.cpp b/src/settings/kcm/kcmdolphinviewmodes.cpp index 9b4aa0dc7..710ebc70b 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.cpp +++ b/src/settings/kcm/kcmdolphinviewmodes.cpp @@ -33,7 +33,6 @@ #include K_PLUGIN_FACTORY(KCMDolphinViewModesConfigFactory, registerPlugin(QStringLiteral("dolphinviewmodes"));) -K_EXPORT_PLUGIN(KCMDolphinViewModesConfigFactory("kcmdolphinviewmodes")) DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget* parent, const QVariantList& args) : KCModule(parent), -- cgit v1.3 From d0eae28f9f744aac20ee22756c7c125071d7fd84 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sun, 5 Feb 2017 23:02:38 +0100 Subject: Drop no longer needed version check Frameworks 5.30 is now the minimum version required. --- src/dolphinmainwindow.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 1dcae7ec4..5bca8d06f 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #include @@ -869,10 +868,8 @@ void DolphinMainWindow::updateControlMenu() helpMenu->addSeparator(); helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::ReportBug))); helpMenu->addSeparator(); -#if KCONFIGWIDGETS_VERSION >= QT_VERSION_CHECK(5, 26, 0) helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Donate))); helpMenu->addSeparator(); -#endif helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::SwitchApplicationLanguage))); helpMenu->addSeparator(); helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::AboutApp))); -- cgit v1.3 From 5f484d8ee865554f933dd22fd1a2e597b1ecb52a Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sun, 5 Feb 2017 23:38:32 +0100 Subject: Drop another obsolete version check We now require Frameworks >= 5.30 --- src/dolphincontextmenu.cpp | 70 ---------------------------------------------- 1 file changed, 70 deletions(-) (limited to 'src') diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index bedb4cb80..58e2f4de5 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -487,76 +486,7 @@ void DolphinContextMenu::addServiceActions(KFileItemActions& fileItemActions) void DolphinContextMenu::addFileItemPluginActions(KFileItemActions& fileItemActions) { -#if KIO_VERSION >= QT_VERSION_CHECK(5, 27, 0) fileItemActions.addPluginActionsTo(this); -#else - Q_UNUSED(fileItemActions); - KFileItemListProperties props; - if (m_selectedItems.isEmpty()) { - props.setItems(KFileItemList() << baseFileItem()); - } else { - props = selectedItemsProperties(); - } - - QString commonMimeType = props.mimeType(); - if (commonMimeType.isEmpty()) { - commonMimeType = QStringLiteral("application/octet-stream"); - } - - const KService::List pluginServices = KMimeTypeTrader::self()->query(commonMimeType, QStringLiteral("KFileItemAction/Plugin"), QStringLiteral("exist Library")); - const KConfig config(QStringLiteral("kservicemenurc"), KConfig::NoGlobals); - const KConfigGroup showGroup = config.group("Show"); - - QSet addedPlugins; - foreach (const KService::Ptr& service, pluginServices) { - if (!showGroup.readEntry(service->desktopEntryName(), true)) { - // The plugin has been disabled - continue; - } - - KAbstractFileItemActionPlugin* abstractPlugin = service->createInstance(); - if (abstractPlugin) { - abstractPlugin->setParent(this); - addActions(abstractPlugin->actions(props, m_mainWindow)); - addedPlugins << service->desktopEntryName(); - } - } - - const auto jsonPlugins = KPluginLoader::findPlugins(QStringLiteral("kf5/kfileitemaction"), [=](const KPluginMetaData& metaData) { - if (!metaData.serviceTypes().contains(QStringLiteral("KFileItemAction/Plugin"))) { - return false; - } - - auto mimeType = QMimeDatabase().mimeTypeForName(commonMimeType); - foreach (const auto& supportedMimeType, metaData.mimeTypes()) { - if (mimeType.inherits(supportedMimeType)) { - return true; - } - } - - return false; - }); - - foreach (const auto& jsonMetadata, jsonPlugins) { - // The plugin has been disabled - if (!showGroup.readEntry(jsonMetadata.pluginId(), true)) { - continue; - } - - // The plugin also has a .desktop file and has already been added. - if (addedPlugins.contains(jsonMetadata.pluginId())) { - continue; - } - - KPluginFactory *factory = KPluginLoader(jsonMetadata.fileName()).factory(); - KAbstractFileItemActionPlugin* abstractPlugin = factory->create(); - if (abstractPlugin) { - abstractPlugin->setParent(this); - addActions(abstractPlugin->actions(props, m_mainWindow)); - addedPlugins << jsonMetadata.pluginId(); - } - } -#endif } void DolphinContextMenu::addVersionControlPluginActions() -- cgit v1.3 From f785d95171173162388633d45ef559e78eed64f6 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sun, 5 Feb 2017 23:55:37 +0100 Subject: Drop unused include This is no longer needed since commit 230fe13d1f --- src/views/tooltips/filemetadatatooltip.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/views/tooltips/filemetadatatooltip.cpp b/src/views/tooltips/filemetadatatooltip.cpp index 2fbba8b9c..e466ff3ed 100644 --- a/src/views/tooltips/filemetadatatooltip.cpp +++ b/src/views/tooltips/filemetadatatooltip.cpp @@ -23,8 +23,6 @@ #include #include -// For the blurred tooltip background -#include #include #include -- cgit v1.3 From 62b7f9228a4dd06c6ece81df3dbfe07b077dcb7e Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Mon, 6 Feb 2017 00:07:58 +0100 Subject: Drop no longer used dependency KWindowSystem is no longer used since commit 230fe13d1f. It was only pulled for `KWindowEffects::enableBlurBehind()`, which is now in plasma-integration (triggered by KToolTipWidget). --- CMakeLists.txt | 1 - src/CMakeLists.txt | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/CMakeLists.txt b/CMakeLists.txt index e3494f5a8..ad75d9ebe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS IconThemes Completion TextWidgets - WindowSystem Notifications Crash ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 62d11584e..87300d60c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -145,7 +145,6 @@ target_link_libraries( KF5::KIOFileWidgets KF5::Completion KF5::TextWidgets - KF5::WindowSystem KF5::ConfigCore KF5::NewStuff KF5::Parts -- cgit v1.3 From 86d2aa321d54bf3ae6c95476d649634fd0ff68d5 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 6 Feb 2017 19:12:48 +0100 Subject: [KStandardItemListWidget] Update icon when palette changes We can colorize icons based on the user's palette, so clear the pixmap cache when it changes. Differential Revision: https://phabricator.kde.org/D3937 --- src/kitemviews/kstandarditemlistwidget.cpp | 3 ++- src/views/dolphinview.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index 8740cb73f..1c89edb6e 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -852,7 +852,8 @@ void KStandardItemListWidget::hideEvent(QHideEvent* event) bool KStandardItemListWidget::event(QEvent *event) { - if (event->type() == QEvent::WindowDeactivate || event->type() == QEvent::WindowActivate) { + if (event->type() == QEvent::WindowDeactivate || event->type() == QEvent::WindowActivate + || event->type() == QEvent::PaletteChange) { m_dirtyContent = true; } diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 7d85fa240..30298d2e1 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -731,6 +732,7 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event) switch (event->type()) { case QEvent::PaletteChange: updatePalette(); + QPixmapCache::clear(); break; case QEvent::KeyPress: -- cgit v1.3 From 333e2ae031fec6139a712f15283f0fffb23f2dc6 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Wed, 8 Feb 2017 16:07:19 +0100 Subject: [Settings Dialog] Show Trash settings only if authorized If this KCM is disabled through KIOSK restriction opening it would result in an error message. Hide the entry altogether in this case. Differential Revision: https://phabricator.kde.org/D4502 --- src/settings/dolphinsettingsdialog.cpp | 21 ++++++++++++++++----- src/settings/dolphinsettingsdialog.h | 2 ++ 2 files changed, 18 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp index 9eb57f10b..5314c24ed 100644 --- a/src/settings/dolphinsettingsdialog.cpp +++ b/src/settings/dolphinsettingsdialog.cpp @@ -29,6 +29,7 @@ #include "viewmodes/viewsettingspage.h" #include "trash/trashsettingspage.h" +#include #include #include #include @@ -85,11 +86,13 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl& url, QWidget* parent) : connect(servicesSettingsPage, &ServicesSettingsPage::changed, this, &DolphinSettingsDialog::enableApply); // Trash - TrashSettingsPage* trashSettingsPage = new TrashSettingsPage(this); - KPageWidgetItem* trashSettingsFrame = addPage(trashSettingsPage, - i18nc("@title:group", "Trash")); - trashSettingsFrame->setIcon(QIcon::fromTheme(QStringLiteral("trash-empty"))); - connect(trashSettingsPage, &TrashSettingsPage::changed, this, &DolphinSettingsDialog::enableApply); + auto* trashSettingsPage = createTrashSettingsPage(this); + if (trashSettingsPage) { + KPageWidgetItem* trashSettingsFrame = addPage(trashSettingsPage, + i18nc("@title:group", "Trash")); + trashSettingsFrame->setIcon(QIcon::fromTheme(QStringLiteral("trash-empty"))); + connect(trashSettingsPage, &TrashSettingsPage::changed, this, &DolphinSettingsDialog::enableApply); + } // General GeneralSettingsPage* generalSettingsPage = new GeneralSettingsPage(url, this); @@ -145,3 +148,11 @@ void DolphinSettingsDialog::restoreDefaults() } } +SettingsPageBase *DolphinSettingsDialog::createTrashSettingsPage(QWidget *parent) +{ + if (!KAuthorized::authorizeControlModule(QStringLiteral("kcmtrash.desktop"))) { + return nullptr; + } + + return new TrashSettingsPage(parent); +} diff --git a/src/settings/dolphinsettingsdialog.h b/src/settings/dolphinsettingsdialog.h index 93f714799..194af28fc 100644 --- a/src/settings/dolphinsettingsdialog.h +++ b/src/settings/dolphinsettingsdialog.h @@ -49,6 +49,8 @@ private slots: void restoreDefaults(); private: + static SettingsPageBase *createTrashSettingsPage(QWidget *parent); + QList m_pages; }; -- cgit v1.3 From d75b1de7bfeba76c540f6772e997aed4aacada88 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Thu, 9 Feb 2017 19:36:11 +0100 Subject: Rename FileMetaDataToolTip to DolphinFileMetaDataWidget Since commit 230fe13d1f this class is not a "tooltip" anymore, but just a simple widget. Rename it to avoid future confusion. Reviewers: emmanuelp Differential Revision: https://phabricator.kde.org/D4451 --- src/CMakeLists.txt | 2 +- src/views/tooltips/dolphinfilemetadatawidget.cpp | 158 +++++++++++++++++++++++ src/views/tooltips/dolphinfilemetadatawidget.h | 82 ++++++++++++ src/views/tooltips/filemetadatatooltip.cpp | 158 ----------------------- src/views/tooltips/filemetadatatooltip.h | 82 ------------ src/views/tooltips/tooltipmanager.cpp | 28 ++-- src/views/tooltips/tooltipmanager.h | 4 +- 7 files changed, 257 insertions(+), 257 deletions(-) create mode 100644 src/views/tooltips/dolphinfilemetadatawidget.cpp create mode 100644 src/views/tooltips/dolphinfilemetadatawidget.h delete mode 100644 src/views/tooltips/filemetadatatooltip.cpp delete mode 100644 src/views/tooltips/filemetadatatooltip.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 87300d60c..ce4cec80c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -102,7 +102,7 @@ set(dolphinprivate_LIB_SRCS views/dolphinviewactionhandler.cpp views/draganddrophelper.cpp views/renamedialog.cpp - views/tooltips/filemetadatatooltip.cpp + views/tooltips/dolphinfilemetadatawidget.cpp views/tooltips/tooltipmanager.cpp views/versioncontrol/updateitemstatesthread.cpp views/versioncontrol/versioncontrolobserver.cpp diff --git a/src/views/tooltips/dolphinfilemetadatawidget.cpp b/src/views/tooltips/dolphinfilemetadatawidget.cpp new file mode 100644 index 000000000..755636c6c --- /dev/null +++ b/src/views/tooltips/dolphinfilemetadatawidget.cpp @@ -0,0 +1,158 @@ +/*************************************************************************** + * Copyright (C) 2010 by Peter Penz * + * Copyright (C) 2008 by Fredrik Höglund * + * Copyright (C) 2012 by Mark Gaiser * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#include "dolphinfilemetadatawidget.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifndef HAVE_BALOO +#include +#else +#include +#endif + +DolphinFileMetaDataWidget::DolphinFileMetaDataWidget(QWidget* parent) : + QWidget(parent), + m_preview(0), + m_name(0), + m_fileMetaDataWidget(0) +{ + // Create widget for file preview + m_preview = new QLabel(this); + m_preview->setAlignment(Qt::AlignTop); + + // Create widget for file name + m_name = new QLabel(this); + m_name->setForegroundRole(QPalette::ToolTipText); + m_name->setTextFormat(Qt::PlainText); + m_name->setAlignment(Qt::AlignHCenter); + + QFont font = m_name->font(); + font.setBold(true); + m_name->setFont(font); + + QFontMetrics fontMetrics(font); + m_name->setMaximumWidth(fontMetrics.averageCharWidth() * 40); + + // Create widget for the meta data +#ifndef HAVE_BALOO + m_fileMetaDataWidget = new KFileMetaDataWidget(this); + connect(m_fileMetaDataWidget, &KFileMetaDataWidget::metaDataRequestFinished, + this, &DolphinFileMetaDataWidget::metaDataRequestFinished); +#else + m_fileMetaDataWidget = new Baloo::FileMetaDataWidget(this); + connect(m_fileMetaDataWidget, &Baloo::FileMetaDataWidget::metaDataRequestFinished, + this, &DolphinFileMetaDataWidget::metaDataRequestFinished); +#endif + m_fileMetaDataWidget->setForegroundRole(QPalette::ToolTipText); + m_fileMetaDataWidget->setReadOnly(true); + + QVBoxLayout* textLayout = new QVBoxLayout(); + textLayout->addWidget(m_name); + textLayout->addWidget(new KSeparator()); + textLayout->addWidget(m_fileMetaDataWidget); + textLayout->setAlignment(m_name, Qt::AlignCenter); + textLayout->setAlignment(m_fileMetaDataWidget, Qt::AlignLeft); + // Assure that the text-layout gets top-aligned by adding a stretch. + // Don't use textLayout->setAlignment(Qt::AlignTop) instead, as this does + // not work with the heightForWidth()-size-hint of m_fileMetaDataWidget + // (see bug #241608) + textLayout->addStretch(); + + QHBoxLayout* layout = new QHBoxLayout(this); + layout->addWidget(m_preview); + layout->addSpacing(layout->margin()); + layout->addLayout(textLayout); +} + +DolphinFileMetaDataWidget::~DolphinFileMetaDataWidget() +{ +} + +void DolphinFileMetaDataWidget::setPreview(const QPixmap& pixmap) +{ + m_preview->setPixmap(pixmap); +} + +QPixmap DolphinFileMetaDataWidget::preview() const +{ + if (m_preview->pixmap()) { + return *m_preview->pixmap(); + } + return QPixmap(); +} + +void DolphinFileMetaDataWidget::setName(const QString& name) +{ + QTextOption textOption; + textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); + + const QString processedName = Qt::mightBeRichText(name) ? name : KStringHandler::preProcessWrap(name); + + QTextLayout textLayout(processedName); + textLayout.setFont(m_name->font()); + textLayout.setTextOption(textOption); + + QString wrappedText; + wrappedText.reserve(processedName.length()); + + // wrap the text to fit into the maximum width of m_name + textLayout.beginLayout(); + QTextLine line = textLayout.createLine(); + while (line.isValid()) { + line.setLineWidth(m_name->maximumWidth()); + wrappedText += processedName.midRef(line.textStart(), line.textLength()); + + line = textLayout.createLine(); + if (line.isValid()) { + wrappedText += QChar::LineSeparator; + } + } + textLayout.endLayout(); + + m_name->setText(wrappedText); +} + +QString DolphinFileMetaDataWidget::name() const +{ + return m_name->text(); +} + +void DolphinFileMetaDataWidget::setItems(const KFileItemList& items) +{ + m_fileMetaDataWidget->setItems(items); +} + +KFileItemList DolphinFileMetaDataWidget::items() const +{ + return m_fileMetaDataWidget->items(); +} + diff --git a/src/views/tooltips/dolphinfilemetadatawidget.h b/src/views/tooltips/dolphinfilemetadatawidget.h new file mode 100644 index 000000000..cf796250d --- /dev/null +++ b/src/views/tooltips/dolphinfilemetadatawidget.h @@ -0,0 +1,82 @@ +/*************************************************************************** + * Copyright (C) 2010 by Peter Penz * + * Copyright (C) 2008 by Fredrik Höglund * + * Copyright (C) 2012 by Mark Gaiser * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef DOLPHINFILEMETADATAWIDGET_H +#define DOLPHINFILEMETADATAWIDGET_H + +#include +#include "config-baloo.h" + +class KFileItemList; +class QLabel; + +#ifndef HAVE_BALOO +class KFileMetaDataWidget; +#else +namespace Baloo { + class FileMetaDataWidget; +} +#endif + +/** + * @brief Widget that shows the meta information and a preview of one + * or more files inside a KToolTipWidget. + */ +class DolphinFileMetaDataWidget : public QWidget +{ + Q_OBJECT + +public: + DolphinFileMetaDataWidget(QWidget* parent = 0); + virtual ~DolphinFileMetaDataWidget(); + + void setPreview(const QPixmap& pixmap); + QPixmap preview() const; + + void setName(const QString& name); + QString name() const; + + /** + * Sets the items for which the meta data should be shown. + * The signal metaDataRequestFinished() will be emitted, + * as soon as the meta data for the items has been received. + */ + void setItems(const KFileItemList& items); + KFileItemList items() const; + +signals: + /** + * Is emitted after the meta data has been received for the items + * set by DolphinFileMetaDataWidget::setItems(). + */ + void metaDataRequestFinished(const KFileItemList& items); + +private: + QLabel* m_preview; + QLabel* m_name; +#ifndef HAVE_BALOO + KFileMetaDataWidget* m_fileMetaDataWidget; +#else + Baloo::FileMetaDataWidget* m_fileMetaDataWidget; +#endif +}; + +#endif diff --git a/src/views/tooltips/filemetadatatooltip.cpp b/src/views/tooltips/filemetadatatooltip.cpp deleted file mode 100644 index e466ff3ed..000000000 --- a/src/views/tooltips/filemetadatatooltip.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Peter Penz * - * Copyright (C) 2008 by Fredrik Höglund * - * Copyright (C) 2012 by Mark Gaiser * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ - -#include "filemetadatatooltip.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#ifndef HAVE_BALOO -#include -#else -#include -#endif - -FileMetaDataToolTip::FileMetaDataToolTip(QWidget* parent) : - QWidget(parent), - m_preview(0), - m_name(0), - m_fileMetaDataWidget(0) -{ - // Create widget for file preview - m_preview = new QLabel(this); - m_preview->setAlignment(Qt::AlignTop); - - // Create widget for file name - m_name = new QLabel(this); - m_name->setForegroundRole(QPalette::ToolTipText); - m_name->setTextFormat(Qt::PlainText); - m_name->setAlignment(Qt::AlignHCenter); - - QFont font = m_name->font(); - font.setBold(true); - m_name->setFont(font); - - QFontMetrics fontMetrics(font); - m_name->setMaximumWidth(fontMetrics.averageCharWidth() * 40); - - // Create widget for the meta data -#ifndef HAVE_BALOO - m_fileMetaDataWidget = new KFileMetaDataWidget(this); - connect(m_fileMetaDataWidget, &KFileMetaDataWidget::metaDataRequestFinished, - this, &FileMetaDataToolTip::metaDataRequestFinished); -#else - m_fileMetaDataWidget = new Baloo::FileMetaDataWidget(this); - connect(m_fileMetaDataWidget, &Baloo::FileMetaDataWidget::metaDataRequestFinished, - this, &FileMetaDataToolTip::metaDataRequestFinished); -#endif - m_fileMetaDataWidget->setForegroundRole(QPalette::ToolTipText); - m_fileMetaDataWidget->setReadOnly(true); - - QVBoxLayout* textLayout = new QVBoxLayout(); - textLayout->addWidget(m_name); - textLayout->addWidget(new KSeparator()); - textLayout->addWidget(m_fileMetaDataWidget); - textLayout->setAlignment(m_name, Qt::AlignCenter); - textLayout->setAlignment(m_fileMetaDataWidget, Qt::AlignLeft); - // Assure that the text-layout gets top-aligned by adding a stretch. - // Don't use textLayout->setAlignment(Qt::AlignTop) instead, as this does - // not work with the heightForWidth()-size-hint of m_fileMetaDataWidget - // (see bug #241608) - textLayout->addStretch(); - - QHBoxLayout* tipLayout = new QHBoxLayout(this); - tipLayout->addWidget(m_preview); - tipLayout->addSpacing(tipLayout->margin()); - tipLayout->addLayout(textLayout); -} - -FileMetaDataToolTip::~FileMetaDataToolTip() -{ -} - -void FileMetaDataToolTip::setPreview(const QPixmap& pixmap) -{ - m_preview->setPixmap(pixmap); -} - -QPixmap FileMetaDataToolTip::preview() const -{ - if (m_preview->pixmap()) { - return *m_preview->pixmap(); - } - return QPixmap(); -} - -void FileMetaDataToolTip::setName(const QString& name) -{ - QTextOption textOption; - textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); - - const QString processedName = Qt::mightBeRichText(name) ? name : KStringHandler::preProcessWrap(name); - - QTextLayout textLayout(processedName); - textLayout.setFont(m_name->font()); - textLayout.setTextOption(textOption); - - QString wrappedText; - wrappedText.reserve(processedName.length()); - - // wrap the text to fit into the maximum width of m_name - textLayout.beginLayout(); - QTextLine line = textLayout.createLine(); - while (line.isValid()) { - line.setLineWidth(m_name->maximumWidth()); - wrappedText += processedName.midRef(line.textStart(), line.textLength()); - - line = textLayout.createLine(); - if (line.isValid()) { - wrappedText += QChar::LineSeparator; - } - } - textLayout.endLayout(); - - m_name->setText(wrappedText); -} - -QString FileMetaDataToolTip::name() const -{ - return m_name->text(); -} - -void FileMetaDataToolTip::setItems(const KFileItemList& items) -{ - m_fileMetaDataWidget->setItems(items); -} - -KFileItemList FileMetaDataToolTip::items() const -{ - return m_fileMetaDataWidget->items(); -} - diff --git a/src/views/tooltips/filemetadatatooltip.h b/src/views/tooltips/filemetadatatooltip.h deleted file mode 100644 index 1738e386c..000000000 --- a/src/views/tooltips/filemetadatatooltip.h +++ /dev/null @@ -1,82 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Peter Penz * - * Copyright (C) 2008 by Fredrik Höglund * - * Copyright (C) 2012 by Mark Gaiser * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef FILEMETADATATOOLTIP_H -#define FILEMETADATATOOLTIP_H - -#include -#include "config-baloo.h" - -class KFileItemList; -class QLabel; - -#ifndef HAVE_BALOO -class KFileMetaDataWidget; -#else -namespace Baloo { - class FileMetaDataWidget; -} -#endif - -/** - * @brief Widget that shows the meta information and a preview of one - * or more files inside a KToolTipWidget. - */ -class FileMetaDataToolTip : public QWidget -{ - Q_OBJECT - -public: - FileMetaDataToolTip(QWidget* parent = 0); - virtual ~FileMetaDataToolTip(); - - void setPreview(const QPixmap& pixmap); - QPixmap preview() const; - - void setName(const QString& name); - QString name() const; - - /** - * Sets the items for which the meta data should be shown. - * The signal metaDataRequestFinished() will be emitted, - * as soon as the meta data for the items has been received. - */ - void setItems(const KFileItemList& items); - KFileItemList items() const; - -signals: - /** - * Is emitted after the meta data has been received for the items - * set by FileMetaDataToolTip::setItems(). - */ - void metaDataRequestFinished(const KFileItemList& items); - -private: - QLabel* m_preview; - QLabel* m_name; -#ifndef HAVE_BALOO - KFileMetaDataWidget* m_fileMetaDataWidget; -#else - Baloo::FileMetaDataWidget* m_fileMetaDataWidget; -#endif -}; - -#endif diff --git a/src/views/tooltips/tooltipmanager.cpp b/src/views/tooltips/tooltipmanager.cpp index d19e98c81..4a9f91359 100644 --- a/src/views/tooltips/tooltipmanager.cpp +++ b/src/views/tooltips/tooltipmanager.cpp @@ -19,7 +19,7 @@ #include "tooltipmanager.h" -#include "filemetadatatooltip.h" +#include "dolphinfilemetadatawidget.h" #include #include #include @@ -38,7 +38,7 @@ ToolTipManager::ToolTipManager(QWidget* parent) : m_showToolTipTimer(0), m_contentRetrievalTimer(0), m_transientParent(0), - m_fileMetaDataToolTip(0), + m_fileMetaDataWidget(0), m_tooltipWidget(new KToolTipWidget()), m_toolTipRequested(false), m_metaDataRequested(false), @@ -82,9 +82,9 @@ void ToolTipManager::showToolTip(const KFileItem& item, const QRectF& itemRect, // Only start the retrieving of the content, when the mouse has been over this // item for 200 milliseconds. This prevents a lot of useless preview jobs and // meta data retrieval, when passing rapidly over a lot of items. - delete m_fileMetaDataToolTip; - m_fileMetaDataToolTip = new FileMetaDataToolTip(); - connect(m_fileMetaDataToolTip, &FileMetaDataToolTip::metaDataRequestFinished, + delete m_fileMetaDataWidget; + m_fileMetaDataWidget = new DolphinFileMetaDataWidget(); + connect(m_fileMetaDataWidget, &DolphinFileMetaDataWidget::metaDataRequestFinished, this, &ToolTipManager::slotMetaDataRequestFinished); m_contentRetrievalTimer->start(); @@ -113,17 +113,17 @@ void ToolTipManager::startContentRetrieval() return; } - m_fileMetaDataToolTip->setName(m_item.text()); + m_fileMetaDataWidget->setName(m_item.text()); // Request the retrieval of meta-data. The slot // slotMetaDataRequestFinished() is invoked after the // meta-data have been received. m_metaDataRequested = true; - m_fileMetaDataToolTip->setItems(KFileItemList() << m_item); - m_fileMetaDataToolTip->adjustSize(); + m_fileMetaDataWidget->setItems(KFileItemList() << m_item); + m_fileMetaDataWidget->adjustSize(); // Request a preview of the item - m_fileMetaDataToolTip->setPreview(QPixmap()); + m_fileMetaDataWidget->setPreview(QPixmap()); KIO::PreviewJob* job = new KIO::PreviewJob(KFileItemList() << m_item, QSize(256, 256)); job->setIgnoreMaximumSize(m_item.isLocalFile()); @@ -149,7 +149,7 @@ void ToolTipManager::setPreviewPix(const KFileItem& item, if (pixmap.isNull()) { previewFailed(); } else { - m_fileMetaDataToolTip->setPreview(pixmap); + m_fileMetaDataWidget->setPreview(pixmap); if (!m_showToolTipTimer->isActive()) { showToolTip(); } @@ -163,7 +163,7 @@ void ToolTipManager::previewFailed() } const QPixmap pixmap = QIcon::fromTheme(m_item.iconName()).pixmap(128, 128); - m_fileMetaDataToolTip->setPreview(pixmap); + m_fileMetaDataWidget->setPreview(pixmap); if (!m_showToolTipTimer->isActive()) { showToolTip(); } @@ -190,7 +190,7 @@ void ToolTipManager::showToolTip() m_appliedWaitCursor = false; } - if (m_fileMetaDataToolTip->preview().isNull() || m_metaDataRequested) { + if (m_fileMetaDataWidget->preview().isNull() || m_metaDataRequested) { Q_ASSERT(!m_appliedWaitCursor); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); m_appliedWaitCursor = true; @@ -198,8 +198,8 @@ void ToolTipManager::showToolTip() } // Adjust the size to get a proper sizeHint() - m_fileMetaDataToolTip->adjustSize(); - m_tooltipWidget->showBelow(m_itemRect, m_fileMetaDataToolTip, m_transientParent); + m_fileMetaDataWidget->adjustSize(); + m_tooltipWidget->showBelow(m_itemRect, m_fileMetaDataWidget, m_transientParent); m_toolTipRequested = false; } diff --git a/src/views/tooltips/tooltipmanager.h b/src/views/tooltips/tooltipmanager.h index 58fe68763..9c504c898 100644 --- a/src/views/tooltips/tooltipmanager.h +++ b/src/views/tooltips/tooltipmanager.h @@ -25,7 +25,7 @@ #include -class FileMetaDataToolTip; +class DolphinFileMetaDataWidget; class KToolTipWidget; class QTimer; class QWindow; @@ -77,7 +77,7 @@ private: /// Transient parent of the tooltip, mandatory on Wayland. QWindow* m_transientParent; - FileMetaDataToolTip* m_fileMetaDataToolTip; + DolphinFileMetaDataWidget* m_fileMetaDataWidget; QScopedPointer m_tooltipWidget; bool m_toolTipRequested; -- cgit v1.3 From f7770c60b17108fde8d4b15006a4e8347e85de7b Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 13 Feb 2017 13:20:07 +0100 Subject: Close tab on mouse release rather than on mouse press Differential Revision: https://phabricator.kde.org/D4501 --- src/dolphintabbar.cpp | 18 ++++++++++++++++-- src/dolphintabbar.h | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dolphintabbar.cpp b/src/dolphintabbar.cpp index e909c36ae..484a9f3a0 100644 --- a/src/dolphintabbar.cpp +++ b/src/dolphintabbar.cpp @@ -29,7 +29,8 @@ DolphinTabBar::DolphinTabBar(QWidget* parent) : QTabBar(parent), - m_autoActivationIndex(-1) + m_autoActivationIndex(-1), + m_tabToBeClosedOnMiddleMouseButtonRelease(-1) { setAcceptDrops(true); setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab); @@ -95,12 +96,25 @@ void DolphinTabBar::mousePressEvent(QMouseEvent* event) const int index = tabAt(event->pos()); if (index >= 0 && event->button() == Qt::MiddleButton) { + m_tabToBeClosedOnMiddleMouseButtonRelease = index; + return; + } + + QTabBar::mousePressEvent(event); +} + +void DolphinTabBar::mouseReleaseEvent(QMouseEvent *event) +{ + const int index = tabAt(event->pos()); + + if (index >= 0 && index == m_tabToBeClosedOnMiddleMouseButtonRelease + && event->button() == Qt::MiddleButton) { // Mouse middle click on a tab closes this tab. emit tabCloseRequested(index); return; } - QTabBar::mousePressEvent(event); + QTabBar::mouseReleaseEvent(event); } void DolphinTabBar::mouseDoubleClickEvent(QMouseEvent* event) diff --git a/src/dolphintabbar.h b/src/dolphintabbar.h index 6daa9a1ad..0c08031a9 100644 --- a/src/dolphintabbar.h +++ b/src/dolphintabbar.h @@ -40,6 +40,7 @@ protected: virtual void dragMoveEvent(QDragMoveEvent* event) Q_DECL_OVERRIDE; virtual void dropEvent(QDropEvent* event) Q_DECL_OVERRIDE; virtual void mousePressEvent(QMouseEvent* event) Q_DECL_OVERRIDE; + virtual void mouseReleaseEvent(QMouseEvent* event) Q_DECL_OVERRIDE; virtual void mouseDoubleClickEvent(QMouseEvent* event) Q_DECL_OVERRIDE; /** @@ -60,6 +61,7 @@ private: private: QTimer* m_autoActivationTimer; int m_autoActivationIndex; + int m_tabToBeClosedOnMiddleMouseButtonRelease; }; #endif // DOLPHIN_TAB_BAR_H -- cgit v1.3 From 7fce8f0e9b1e0bb2deb6e32fe88d5411b9be2834 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 13 Feb 2017 13:51:05 +0100 Subject: Don't add trashSettingsPage to m_pages if null Otherwise we might crash in applySettings() or restoreDefaults() --- src/settings/dolphinsettingsdialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp index 5314c24ed..50fd41e4c 100644 --- a/src/settings/dolphinsettingsdialog.cpp +++ b/src/settings/dolphinsettingsdialog.cpp @@ -105,7 +105,9 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl& url, QWidget* parent) : m_pages.append(viewSettingsPage); m_pages.append(navigationSettingsPage); m_pages.append(servicesSettingsPage); - m_pages.append(trashSettingsPage); + if (trashSettingsPage) { + m_pages.append(trashSettingsPage); + } m_pages.append(generalSettingsPage); const KConfigGroup dialogConfig(KSharedConfig::openConfig(QStringLiteral("dolphinrc")), "SettingsDialog"); -- cgit v1.3