From fbde0901b7e9a174aa65751f95a5b97a084bb098 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Mon, 9 Jul 2012 11:10:38 +0200 Subject: SVN_SILENT made messages (.desktop file) --- src/settings/kcm/kcmdolphingeneral.desktop | 6 +++--- src/settings/kcm/kcmdolphinnavigation.desktop | 8 ++++---- src/settings/kcm/kcmdolphinservices.desktop | 4 ++-- src/settings/kcm/kcmdolphinviewmodes.desktop | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/settings/kcm/kcmdolphingeneral.desktop b/src/settings/kcm/kcmdolphingeneral.desktop index 011c907b0..366aa0fd1 100644 --- a/src/settings/kcm/kcmdolphingeneral.desktop +++ b/src/settings/kcm/kcmdolphingeneral.desktop @@ -16,7 +16,7 @@ Name[eo]=Dolphin-Ĝeneralo Name[es]=Dolphin general Name[et]=Dolphini üldine Name[eu]=Dolphin orokorra -Name[fi]=Dolphin: yleistä +Name[fi]=Dolphin – yleiset Name[fr]=Dolphin général Name[fy]=Dolfyn algemien Name[ga]=Dolphin Ginearálta @@ -86,7 +86,7 @@ Comment[eo]=Ĉi tiu servo permesas agordi la ĝeneralajn Dolphin-agordojn. Comment[es]=Este servicio le permite hacer la configuración general de Dolphin. Comment[et]=See teenus võimaldab seadistada Dolphini üldisi seadistusi. Comment[eu]=Zerbitzu honen bitartez Dolphin-en ezarpen orokorrak konfiguratu daitezke. -Comment[fi]=Tämä palvelu sallii Dolphinin yleisasetusten muokkauksen. +Comment[fi]=Tällä palvelulla voi muokata Dolphinin yleisasetuksia. Comment[fr]=Ce service permet de configurer les paramètres généraux de Dolphin Comment[fy]=Mei dizze tsjinst kinne jo de algemiene dolfyn opsjes ynstelle. Comment[ga]=Leis an tseirbhís seo is féidir na socruithe ginearálta Dolphin a chumrú. @@ -239,7 +239,7 @@ Comment[eo]=Agordi la ĝeneralan dosieradministrilon Comment[es]=Configurar las preferencias del gestor de archivos Comment[et]=Failihalduri üldiste seadistuste seadistamine Comment[eu]=Konfiguratu fitxategi kudeatzailearen ezarpen orokorrak -Comment[fi]=Muokkaa tiedostonhallinnan yleisasetuksia +Comment[fi]=Tiedostonhallinnan yleisasetukset Comment[fr]=Configuration des paramètres généraux du gestionnaire de fichiers Comment[fy]=Algemiene triembehearopsjes ynstelle Comment[ga]=Cumraigh socruithe ginearálta bhainisteoir na gcomhad diff --git a/src/settings/kcm/kcmdolphinnavigation.desktop b/src/settings/kcm/kcmdolphinnavigation.desktop index 16a95864a..cf23a2eba 100644 --- a/src/settings/kcm/kcmdolphinnavigation.desktop +++ b/src/settings/kcm/kcmdolphinnavigation.desktop @@ -17,7 +17,7 @@ Name[es]=Navegación de Dolphin Name[et]=Dolphini liikumine Name[eu]=Dolphin nabigazioa Name[fa]=ناوبری دلفین -Name[fi]=Dolphin-navigointi +Name[fi]=Dolphin – selaus Name[fr]=Navigation dans Dolphin Name[fy]=Dolfyn navigaasje Name[ga]=Nascleanúint Dolphin @@ -87,7 +87,7 @@ Comment[eo]=Ĉi tiu servo permesas agordi la Dolphin foliumadon. Comment[es]=Este servicio le permite configurar la navegación de Dolphin. Comment[et]=See teenus võimaldab seadistada Dolphini liikumist. Comment[eu]=Zerbitzu honen bitartez Dolphin-en nabigazioa konfiguratu daiteke. -Comment[fi]=Tämä palvelu sallii Dolphinin navigoinnin muokkauksen. +Comment[fi]=Tällä palvelulla voi muokata Dolphinin selausasetuksia. Comment[fr]=Ce service permet de configurer la navigation dans Dolphin. Comment[fy]=Mei dizze tsjinst kinne jo de dolfyn navigaasje ynstelle. Comment[ga]=Leis an tseirbhís seo is féidir nascleanúint Dolphin a chumrú. @@ -167,7 +167,7 @@ Name[eo]=Navigado Name[es]=Navegación Name[et]=Liikumine Name[eu]=Nabigazioa -Name[fi]=Navigointi +Name[fi]=Selaus Name[fr]=Navigation Name[fy]=Navigaasje Name[ga]=Nascleanúint @@ -239,7 +239,7 @@ Comment[eo]=Agordi la dosieradministrilan foliumadon Comment[es]=Configurar las preferencias de navegación del gestor de archivos Comment[et]=Failihalduri liikumise seadistamine Comment[eu]=Konfiguratu fitxategi-kudeatzailearen nabigazioa -Comment[fi]=Muokkaa tiedostonhallinnan navigointia +Comment[fi]=Tiedostonhallinnan selausasetukset Comment[fr]=Configuration de la navigation dans le gestionnaire de fichiers Comment[fy]=Triembehearnavigaasje ynstelle Comment[ga]=Cumraigh nascleanúint bhainisteoir na gcomhad diff --git a/src/settings/kcm/kcmdolphinservices.desktop b/src/settings/kcm/kcmdolphinservices.desktop index 47e135867..37b382e24 100644 --- a/src/settings/kcm/kcmdolphinservices.desktop +++ b/src/settings/kcm/kcmdolphinservices.desktop @@ -16,7 +16,7 @@ Name[eo]=Dolphin-servoj Name[es]=Servicios de Dolphin Name[et]=Dolphini teenused Name[eu]=Dolphin zerbitzuak -Name[fi]=Dolphin-palvelut +Name[fi]=Dolphin – palvelut Name[fr]=Services de Dolphin Name[fy]=Dolfyn tsjinsten Name[ga]=Seirbhísí Dolphin @@ -190,7 +190,7 @@ Comment[eo]=Agordi la dosieradministrilajn servojn Comment[es]=Configurar las preferencias del gestor de archivos Comment[et]=Failihalduri teenuste seadistamine Comment[eu]=Konfiguratu fitxategi-kudeatzaile zerbitzuak -Comment[fi]=Muokkaa tiedostonhallinnan palveluita +Comment[fi]=Tiedostonhallinnan palveluasetukset Comment[fr]=Configuration des services du gestionnaire de fichiers Comment[fy]=Triembeheartsjinsten ynstelle Comment[ga]=Cumraigh seirbhísí bhainisteoir na gcomhad diff --git a/src/settings/kcm/kcmdolphinviewmodes.desktop b/src/settings/kcm/kcmdolphinviewmodes.desktop index ada4ee127..4305aca6e 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.desktop +++ b/src/settings/kcm/kcmdolphinviewmodes.desktop @@ -16,7 +16,7 @@ Name[eo]=Dolphin-rigardaj stiloj Name[es]=Modos de vista de Dolphin Name[et]=Dolphini vaaterežiimid Name[eu]=Dolphin-en ikuspegi moduak -Name[fi]=Dolphinin näkymätilat +Name[fi]=Dolphin – katselutilat Name[fr]=Modes d'affichage de Dolphin Name[fy]=Dolfyn werjeftemodus Name[ga]=Móid Amhairc Dolphin @@ -86,7 +86,7 @@ Comment[eo]=Ĉi tiu servo permesas agordi la Dolphin rigardajn stilojn. Comment[es]=Este servicio le permite configurar los modos de vista de Dolphin. Comment[et]=See teenus võimaldab seadistada Dolphini vaaterežiime. Comment[eu]=Zerbitzu honen bitartez Dolphin-en ikuspegi moduak aldatu daitezke. -Comment[fi]=Tämä palvelu sallii Dolphinin näkymätilojen muokkauksen. +Comment[fi]=Tällä palvelulla voi muokata Dolphinin katselutilojen asetuksia. Comment[fr]=Ce service permet de configurer les modes d'affichage de Dolphin. Comment[fy]=Mei dizze tsjinst kinne jo de dolfyn werjeftemodus ynstelle. Comment[ga]=Leis an tseirbhís seo is féidir na hamhairc Dolphin a chumrú. @@ -236,7 +236,7 @@ Comment[eo]=Agordi la dosieradministrilan rigardajn stilojn Comment[es]=Configurar los modos de vista del gestor de archivos Comment[et]=Failihalduri vaaterežiimide seadistamine Comment[eu]=Konfiguratu fitxategi-kudeatzailearen ikuspegi moduak -Comment[fi]=Muokkaa tiedostonhallinnan katselutiloja +Comment[fi]=Tiedostonhallinnan katselutilojen asetukset Comment[fr]=Configuration des modes d'affichage du gestionnaire de fichiers Comment[fy]=Triembehear werjeftemodus ynstelle Comment[ga]=Cumraigh amhairc bhainisteoir na gcomhad -- cgit v1.3 From 56b992c48622102c19867294ca0930cba7879c7d Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Tue, 10 Jul 2012 08:23:14 +0200 Subject: Use the right name when adding a folder to Places with the context menu Without this patch, the name of the parent folder was used for the entry in the Places Panel. Will backport to the KDE/4.9 branch when the RC2 freeze is over. Thanks to Daniel Kreuter for the patch! BUG: 303157 FIXED-IN: 4.9.0 (cherry picked from commit 9940244ddd68fabf2979b9c0832105e43d725619) --- src/dolphincontextmenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index e1913a82f..bb26c7aae 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -295,7 +295,7 @@ void DolphinContextMenu::openItemContextMenu() const KUrl selectedUrl(m_fileInfo.url()); if (selectedUrl.isValid()) { PlacesItemModel model; - const QString text = m_mainWindow->activeViewContainer()->placesText(); + const QString text = selectedUrl.fileName(); PlacesItem* item = model.createPlacesItem(text, selectedUrl); model.appendItemToGroup(item); } -- cgit v1.3 From b8ef5ebca1662526e994815d6e044652ce7ccf4a Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Thu, 12 Jul 2012 00:27:53 +0200 Subject: Re-implement dropping of files on folders in the Places Panel. This resolves a regression caused by the Places Panel rewrite. There is a small glitch left when reordering items (dragging below the last or above the first item only shows the drop indicator when first dragging out of the item and then back), but I prefer not to fix this glitch right now because this would require a more intrusive change, and I do not want to risk regressions because is not much time left to fix them before 4.9.0 is released. Thanks to Peter Penz for providing some advice about this issue. BUG: 302557 FIXED-IN: 4.9.0 (cherry picked from commit f4c960025167b7c7e04e1290ac9d9fee03a9b62d) --- src/kitemviews/kitemlistcontroller.cpp | 41 +++++++++++++++++------------- src/kitemviews/kitemlistcontroller.h | 9 +++++++ src/kitemviews/kitemlistview.cpp | 7 +++++ src/panels/places/placesitemlistwidget.cpp | 2 ++ src/panels/places/placesitemmodel.cpp | 7 ++++- src/panels/places/placesitemmodel.h | 5 +++- src/panels/places/placespanel.cpp | 19 +++++++++++++- src/panels/places/placespanel.h | 1 + 8 files changed, 71 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 76f7fa1cd..88f5d9f7c 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -778,7 +778,6 @@ bool KItemListController::dragLeaveEvent(QGraphicsSceneDragDropEvent* event, con bool KItemListController::dragMoveEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform) { - Q_UNUSED(transform); if (!m_model || !m_view) { return false; } @@ -799,20 +798,23 @@ bool KItemListController::dragMoveEvent(QGraphicsSceneDragDropEvent* event, cons } if (newHoveredWidget) { + bool droppingBetweenItems = false; + if (m_model->sortRole().isEmpty()) { + // The model supports inserting items between other items. + droppingBetweenItems = (m_view->showDropIndicator(pos) >= 0); + } + const int index = newHoveredWidget->index(); - if (m_model->supportsDropping(index)) { + if (!droppingBetweenItems && m_model->supportsDropping(index)) { + // Something has been dragged on an item. + m_view->hideDropIndicator(); newHoveredWidget->setHovered(true); - } else if (m_model->sortRole().isEmpty()) { - // The model supports inserting of items on - // the given index. Assure that a drop-indicator - // is shown by the view. - m_view->showDropIndicator(pos); - } - emit itemHovered(index); + emit itemHovered(index); - if (m_autoActivationTimer->interval() >= 0) { - m_autoActivationTimer->setProperty("index", index); - m_autoActivationTimer->start(); + if (m_autoActivationTimer->interval() >= 0) { + m_autoActivationTimer->setProperty("index", index); + m_autoActivationTimer->start(); + } } } } @@ -822,7 +824,6 @@ bool KItemListController::dragMoveEvent(QGraphicsSceneDragDropEvent* event, cons bool KItemListController::dropEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform) { - Q_UNUSED(transform) if (!m_view) { return false; } @@ -831,13 +832,19 @@ bool KItemListController::dropEvent(QGraphicsSceneDragDropEvent* event, const QT m_view->setAutoScroll(false); const QPointF pos = transform.map(event->pos()); + + int dropAboveIndex = -1; if (m_model->sortRole().isEmpty()) { - // The model supports inserting of items on - // a given index. - const int dropIndex = m_view->showDropIndicator(pos); + // The model supports inserting of items between other items. + dropAboveIndex = m_view->showDropIndicator(pos); + } + + if (dropAboveIndex >= 0) { + // Something has been dropped between two items. m_view->hideDropIndicator(); - emit itemDropEvent(dropIndex, event); + emit aboveItemDropEvent(dropAboveIndex, event); } else { + // Something has been dropped on an item or on an empty part of the view. emit itemDropEvent(m_view->itemAt(pos), event); } diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h index db31d50c3..a88152622 100644 --- a/src/kitemviews/kitemlistcontroller.h +++ b/src/kitemviews/kitemlistcontroller.h @@ -201,9 +201,18 @@ signals: * Is emitted if a drop event is done above the item with the index * \a index. If \a index is < 0 the drop event is done above an * empty area of the view. + * TODO: Introduce a new signal viewDropEvent(QGraphicsSceneDragDropEvent), + * which is emitted if the drop event occurs on an empty area in + * the view, and make sure that index is always >= 0 in itemDropEvent(). */ void itemDropEvent(int index, QGraphicsSceneDragDropEvent* event); + /** + * Is emitted if a drop event is done between the item with the index + * \a index and the previous item. + */ + void aboveItemDropEvent(int index, QGraphicsSceneDragDropEvent* event); + void modelChanged(KItemModelBase* current, KItemModelBase* previous); void viewChanged(KItemListView* current, KItemListView* previous); diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 64b33f96f..72b3fd8fc 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -2318,6 +2318,13 @@ int KItemListView::showDropIndicator(const QPointF& pos) const QPointF mappedPos = widget->mapFromItem(this, pos); const QRectF rect = itemRect(widget->index()); if (mappedPos.y() >= 0 && mappedPos.y() <= rect.height()) { + if (m_model->supportsDropping(widget->index())) { + const int gap = qMax(4, m_styleOption.padding); + if (mappedPos.y() >= gap && mappedPos.y() <= rect.height() - gap) { + return -1; + } + } + const bool isAboveItem = (mappedPos.y () < rect.height() / 2); const qreal y = isAboveItem ? rect.top() : rect.bottom(); diff --git a/src/panels/places/placesitemlistwidget.cpp b/src/panels/places/placesitemlistwidget.cpp index 3f4c92dfa..24c2b3f11 100644 --- a/src/panels/places/placesitemlistwidget.cpp +++ b/src/panels/places/placesitemlistwidget.cpp @@ -19,6 +19,8 @@ #include "placesitemlistwidget.h" +#include "kdebug.h" + PlacesItemListWidget::PlacesItemListWidget(KItemListWidgetInformant* informant, QGraphicsItem* parent) : KStandardItemListWidget(informant, parent) { diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 00ab9670b..497901345 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -396,7 +396,12 @@ QMimeData* PlacesItemModel::createMimeData(const QSet& indexes) const return mimeData; } -void PlacesItemModel::dropMimeData(int index, const QMimeData* mimeData) +bool PlacesItemModel::supportsDropping(int index) const +{ + return index >= 0 && index < count(); +} + +void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData) { if (mimeData->hasFormat(internalMimeType())) { // The item has been moved inside the view diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h index a060f4549..463e564e3 100644 --- a/src/panels/places/placesitemmodel.h +++ b/src/panels/places/placesitemmodel.h @@ -120,7 +120,10 @@ public: /** @reimp */ virtual QMimeData* createMimeData(const QSet& indexes) const; - void dropMimeData(int index, const QMimeData* mimeData); + /** @reimp */ + virtual bool supportsDropping(int index) const; + + void dropMimeDataBefore(int index, const QMimeData* mimeData); /** * @return Converts the URL, which contains "virtual" URLs for system-items like diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 64de516fa..429c5399a 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -93,6 +93,7 @@ void PlacesPanel::showEvent(QShowEvent* event) connect(m_controller, SIGNAL(itemContextMenuRequested(int,QPointF)), this, SLOT(slotItemContextMenuRequested(int,QPointF))); connect(m_controller, SIGNAL(viewContextMenuRequested(QPointF)), this, SLOT(slotViewContextMenuRequested(QPointF))); connect(m_controller, SIGNAL(itemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotItemDropEvent(int,QGraphicsSceneDragDropEvent*))); + connect(m_controller, SIGNAL(aboveItemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotAboveItemDropEvent(int,QGraphicsSceneDragDropEvent*))); KItemListContainer* container = new KItemListContainer(m_controller, this); container->setEnabledFrame(false); @@ -253,7 +254,23 @@ void PlacesPanel::slotViewContextMenuRequested(const QPointF& pos) void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event) { - m_model->dropMimeData(index, event->mimeData()); + if (index < 0) { + return; + } + + KUrl destUrl = m_model->placesItem(index)->url(); + QDropEvent dropEvent(event->pos().toPoint(), + event->possibleActions(), + event->mimeData(), + event->buttons(), + event->modifiers()); + + DragAndDropHelper::dropUrls(KFileItem(), destUrl, &dropEvent); +} + +void PlacesPanel::slotAboveItemDropEvent(int index, QGraphicsSceneDragDropEvent* event) +{ + m_model->dropMimeDataBefore(index, event->mimeData()); } void PlacesPanel::slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent) diff --git a/src/panels/places/placespanel.h b/src/panels/places/placespanel.h index 427b01248..8a84e00a0 100644 --- a/src/panels/places/placespanel.h +++ b/src/panels/places/placespanel.h @@ -56,6 +56,7 @@ private slots: void slotItemContextMenuRequested(int index, const QPointF& pos); void slotViewContextMenuRequested(const QPointF& pos); void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event); + void slotAboveItemDropEvent(int index, QGraphicsSceneDragDropEvent* event); void slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent); void slotTrashUpdated(KJob* job); void slotStorageSetupDone(int index, bool success); -- cgit v1.3 From 3dbe88e42a90a008507a458c31523d8dc0c2a596 Mon Sep 17 00:00:00 2001 From: Christoph Feck Date: Wed, 18 Jul 2012 01:22:55 +0200 Subject: Respect platform's icon sizes Use QStyle icon sizes instead of hard coding 16 or 32 pixels. Using styles that follow KDE settings (every KStyle, e.g. Oxygen) the icon sizes can be configured by the user in System Settings. The size for the icon/details view can be later changed by the user, overriding the defaults. The icon size for the places panel is not (yet?) configurable separately. (Not resolving the bug, see comment in review request) CCBUG: 301959 REVIEW: 105548 (cherry picked from commit 79211f6e48d33b6be235811912061fda265fefb6) --- src/kitemviews/kstandarditemlistview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/kitemviews/kstandarditemlistview.cpp b/src/kitemviews/kstandarditemlistview.cpp index f4d05dcf6..79eb86b89 100644 --- a/src/kitemviews/kstandarditemlistview.cpp +++ b/src/kitemviews/kstandarditemlistview.cpp @@ -141,9 +141,9 @@ void KStandardItemListView::onSupportsItemExpandingChanged(bool supportsExpandin void KStandardItemListView::polishEvent() { switch (m_itemLayout) { - case IconsLayout: applyDefaultStyleOption(KIconLoader::SizeMedium, 2, 4, 8); break; - case CompactLayout: applyDefaultStyleOption(KIconLoader::SizeSmall, 2, 8, 0); break; - case DetailsLayout: applyDefaultStyleOption(KIconLoader::SizeSmall, 2, 0, 0); break; + case IconsLayout: applyDefaultStyleOption(style()->pixelMetric(QStyle::PM_LargeIconSize), 2, 4, 8); break; + case CompactLayout: applyDefaultStyleOption(style()->pixelMetric(QStyle::PM_SmallIconSize), 2, 8, 0); break; + case DetailsLayout: applyDefaultStyleOption(style()->pixelMetric(QStyle::PM_SmallIconSize), 2, 0, 0); break; default: Q_ASSERT(false); break; } -- cgit v1.3 From 4a0454ff88a0900706826e7ed61aef405c73ba90 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 18 Jul 2012 20:40:56 +0200 Subject: Fix open-in-new-window to work with remote URLs FIXED-IN: 4.9.0 BUGS: 274655, 292822 --- src/dolphinmainwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 1ce51935f..17268297c 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -434,7 +434,7 @@ void DolphinMainWindow::updateFilterBarAction(bool show) void DolphinMainWindow::openNewMainWindow() { - KRun::run("dolphin", KUrl::List(), this); + KRun::run("dolphin %u", KUrl::List(), this); } void DolphinMainWindow::openNewTab() @@ -545,7 +545,7 @@ void DolphinMainWindow::openInNewWindow() } if (!newWindowUrl.isEmpty()) { - KRun::run("dolphin", KUrl::List() << newWindowUrl, this); + KRun::run("dolphin %u", KUrl::List() << newWindowUrl, this); } } @@ -1299,7 +1299,7 @@ void DolphinMainWindow::openContextMenu(const QPoint& pos, switch (command) { case DolphinContextMenu::OpenParentFolderInNewWindow: { - KRun::run("dolphin", KUrl::List() << item.url().upUrl(), this); + KRun::run("dolphin %u", KUrl::List() << item.url().upUrl(), this); break; } -- cgit v1.3 From 149975a0044f0a964c44b98e3228f4aeb6588d00 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 20 Jul 2012 12:09:04 +0200 Subject: Fix bug 303375 - Dots in directory names treated as file extension. Patch by Emmanuel Pescosta BUG: 303375 REVIEW: 105575 FIXED-IN: 4.9.0 --- src/kitemviews/kfileitemlistwidget.cpp | 31 ++++++++++++++++++++++++++++++ src/kitemviews/kfileitemlistwidget.h | 5 +++++ src/kitemviews/kstandarditemlistwidget.cpp | 24 ++++++++--------------- src/kitemviews/kstandarditemlistwidget.h | 13 +++++++++++++ src/views/renamedialog.cpp | 4 +++- 5 files changed, 60 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/kitemviews/kfileitemlistwidget.cpp b/src/kitemviews/kfileitemlistwidget.cpp index c99da383f..3a7724134 100644 --- a/src/kitemviews/kfileitemlistwidget.cpp +++ b/src/kitemviews/kfileitemlistwidget.cpp @@ -19,6 +19,7 @@ #include "kfileitemlistwidget.h" +#include #include #include #include @@ -101,4 +102,34 @@ QFont KFileItemListWidget::customizedFont(const QFont& baseFont) const return font; } +int KFileItemListWidget::selectionLength(const QString& text) const +{ + // Select the text without MIME-type extension + int selectionLength = text.length(); + + // If item is a directory, use the whole text length for + // selection (ignore all points) + if(data().value("isDir").toBool()) { + return selectionLength; + } + + const QString extension = KMimeType::extractKnownExtension(text); + if (extension.isEmpty()) { + // For an unknown extension just exclude the extension after + // the last point. This does not work for multiple extensions like + // *.tar.gz but usually this is anyhow a known extension. + selectionLength = text.lastIndexOf(QLatin1Char('.')); + + // If no point could be found, use whole text length for selection. + if (selectionLength < 1) { + selectionLength = text.length(); + } + + } else { + selectionLength -= extension.length() + 1; + } + + return selectionLength; +} + #include "kfileitemlistwidget.moc" diff --git a/src/kitemviews/kfileitemlistwidget.h b/src/kitemviews/kfileitemlistwidget.h index b0d8e1cd7..24c677828 100644 --- a/src/kitemviews/kfileitemlistwidget.h +++ b/src/kitemviews/kfileitemlistwidget.h @@ -48,6 +48,11 @@ protected: virtual bool isRoleRightAligned(const QByteArray& role) const; virtual bool isHidden() const; virtual QFont customizedFont(const QFont& baseFont) const; + + /** + * @return Selection length without MIME-type extension + */ + virtual int selectionLength(const QString& text) const; }; #endif diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index e584c0678..9cdb60e24 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -576,6 +576,11 @@ void KStandardItemListWidget::siblingsInformationChanged(const QBitArray& curren m_dirtyLayout = true; } +int KStandardItemListWidget::selectionLength(const QString& text) const +{ + return text.length(); +} + void KStandardItemListWidget::editedRoleChanged(const QByteArray& current, const QByteArray& previous) { Q_UNUSED(previous); @@ -605,25 +610,12 @@ void KStandardItemListWidget::editedRoleChanged(const QByteArray& current, const QTextOption textOption = textInfo->staticText.textOption(); m_roleEditor->document()->setDefaultTextOption(textOption); - // Select the text without MIME-type extension - // TODO: This is file-item-specific and should be moved - // into KFileItemListWidget. - int selectionLength = text.length(); - - const QString extension = KMimeType::extractKnownExtension(text); - if (extension.isEmpty()) { - // For an unknown extension just exclude the extension after - // the last point. This does not work for multiple extensions like - // *.tar.gz but usually this is anyhow a known extension. - selectionLength = text.lastIndexOf(QLatin1Char('.')); - } else { - selectionLength -= extension.length() + 1; - } + const int textSelectionLength = selectionLength(text); - if (selectionLength > 0) { + if (textSelectionLength > 0) { QTextCursor cursor = m_roleEditor->textCursor(); cursor.movePosition(QTextCursor::StartOfBlock); - cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, selectionLength); + cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, textSelectionLength); m_roleEditor->setTextCursor(cursor); } diff --git a/src/kitemviews/kstandarditemlistwidget.h b/src/kitemviews/kstandarditemlistwidget.h index 222d7b5f4..82b68eac9 100644 --- a/src/kitemviews/kstandarditemlistwidget.h +++ b/src/kitemviews/kstandarditemlistwidget.h @@ -131,6 +131,19 @@ protected: */ QString roleText(const QByteArray& role, const QHash& values) const; + /** + * Fixes: + * Select the text without MIME-type extension + * This is file-item-specific and should be moved + * into KFileItemListWidget. + * + * Inherited classes can define, if the MIME-type extension + * should be selected or not. + * + * @return Selection length (with or without MIME-type extension) + */ + virtual int selectionLength(const QString& text) const; + virtual void dataChanged(const QHash& current, const QSet& roles = QSet()); virtual void visibleRolesChanged(const QList& current, const QList& previous); virtual void columnWidthChanged(const QByteArray& role, qreal current, qreal previous); diff --git a/src/views/renamedialog.cpp b/src/views/renamedialog.cpp index e232b9614..a91f91b1b 100644 --- a/src/views/renamedialog.cpp +++ b/src/views/renamedialog.cpp @@ -87,7 +87,9 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) : if (m_renameOneItem) { const QString fileName = items.first().url().prettyUrl(); const QString extension = KMimeType::extractKnownExtension(fileName.toLower()); - if (extension.length() > 0) { + + // If the current item is a directory, select the whole file name. + if ((extension.length() > 0) && !items.first().isDir()) { // Don't select the extension selectionLength -= extension.length() + 1; } -- cgit v1.3 From 43474e7b9d55c3fe768032cf7e69f46bcf5c14cd Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 20 Jul 2012 12:11:45 +0200 Subject: Fix compiler warning, which spotted a real bug. ItemLayout is an enum, not a flag, so == is even more correct than '&'. --- src/views/dolphinitemlistview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/views/dolphinitemlistview.cpp b/src/views/dolphinitemlistview.cpp index a031b1699..039b5f230 100644 --- a/src/views/dolphinitemlistview.cpp +++ b/src/views/dolphinitemlistview.cpp @@ -90,7 +90,7 @@ void DolphinItemListView::readSettings() setEnabledSelectionToggles(GeneralSettings::showSelectionToggle()); - const bool expandableFolders = (itemLayout() && KFileItemListView::DetailsLayout) && + const bool expandableFolders = (itemLayout() == KFileItemListView::DetailsLayout) && DetailsModeSettings::expandableFolders(); setSupportsItemExpanding(expandableFolders); -- cgit v1.3 From ec2d5c7a7f1400f612962b9dc8f8396c882332f9 Mon Sep 17 00:00:00 2001 From: Dawit Alemayehu Date: Tue, 17 Jul 2012 22:47:10 -0400 Subject: Show the "Find File" and "Open Terminal" actions in the Tools for file URLs only. BUG: 279283 FIXED-IN: 4.9.0 REVIEW: 105607 --- src/dolphinpart.cpp | 28 ++++++++++++++++++---------- src/dolphinpart.h | 2 ++ 2 files changed, 20 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index b3b7cd044..d1626e55d 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -56,6 +56,7 @@ K_EXPORT_PLUGIN(DolphinPartFactory("dolphinpart", "dolphin")) DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args) : KParts::ReadOnlyPart(parent) + ,m_openTerminalAction(0) { Q_UNUSED(args) setComponentData(DolphinPartFactory::componentData(), false); @@ -190,18 +191,18 @@ void DolphinPart::createActions() goActionGroup); // Tools menu - KAction* findFile = actionCollection()->addAction("find_file"); - findFile->setText(i18nc("@action:inmenu Tools", "Find File...")); - findFile->setShortcut(Qt::CTRL | Qt::Key_F); - findFile->setIcon(KIcon("edit-find")); - connect(findFile, SIGNAL(triggered()), this, SLOT(slotFindFile())); + m_findFileAction = actionCollection()->addAction("find_file"); + m_findFileAction->setText(i18nc("@action:inmenu Tools", "Find File...")); + m_findFileAction->setShortcut(Qt::CTRL | Qt::Key_F); + m_findFileAction->setIcon(KIcon("edit-find")); + connect(m_findFileAction, SIGNAL(triggered()), this, SLOT(slotFindFile())); if (KAuthorized::authorizeKAction("shell_access")) { - KAction* action = actionCollection()->addAction("open_terminal"); - action->setIcon(KIcon("utilities-terminal")); - action->setText(i18nc("@action:inmenu Tools", "Open &Terminal")); - connect(action, SIGNAL(triggered()), SLOT(slotOpenTerminal())); - action->setShortcut(Qt::Key_F4); + m_openTerminalAction = actionCollection()->addAction("open_terminal"); + m_openTerminalAction->setIcon(KIcon("utilities-terminal")); + m_openTerminalAction->setText(i18nc("@action:inmenu Tools", "Open &Terminal")); + connect(m_openTerminalAction, SIGNAL(triggered()), SLOT(slotOpenTerminal())); + m_openTerminalAction->setShortcut(Qt::Key_F4); } } @@ -296,6 +297,13 @@ bool DolphinPart::openUrl(const KUrl& url) emit aboutToOpenURL(); if (reload) m_view->reload(); + // Disable "Find File" and "Open Terminal" actions for non-file URLs, + // e.g. ftp, smb, etc. #279283 + const bool isLocalUrl = url.isLocalFile(); + m_findFileAction->setEnabled(isLocalUrl); + if (m_openTerminalAction) { + m_openTerminalAction->setEnabled(isLocalUrl); + } return true; } diff --git a/src/dolphinpart.h b/src/dolphinpart.h index 0a8ce07bd..e5693b363 100644 --- a/src/dolphinpart.h +++ b/src/dolphinpart.h @@ -238,6 +238,8 @@ private: DolphinRemoteEncoding* m_remoteEncoding; DolphinPartBrowserExtension* m_extension; KNewFileMenu* m_newFileMenu; + KAction* m_findFileAction; + KAction* m_openTerminalAction; QString m_nameFilter; Q_DISABLE_COPY(DolphinPart) }; -- cgit v1.3 From 81bac38f2c837f7c23854ef7b278f43b11baebd8 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Tue, 24 Jul 2012 19:23:37 +0200 Subject: SVN_SILENT made messages (.desktop file) --- src/settings/kcm/kcmdolphinviewmodes.desktop | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/settings/kcm/kcmdolphinviewmodes.desktop b/src/settings/kcm/kcmdolphinviewmodes.desktop index 4305aca6e..bee3ac64c 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.desktop +++ b/src/settings/kcm/kcmdolphinviewmodes.desktop @@ -16,7 +16,7 @@ Name[eo]=Dolphin-rigardaj stiloj Name[es]=Modos de vista de Dolphin Name[et]=Dolphini vaaterežiimid Name[eu]=Dolphin-en ikuspegi moduak -Name[fi]=Dolphin – katselutilat +Name[fi]=Dolphin – näkymät Name[fr]=Modes d'affichage de Dolphin Name[fy]=Dolfyn werjeftemodus Name[ga]=Móid Amhairc Dolphin @@ -165,7 +165,7 @@ Name[eo]=Modeloj de Vidoj Name[es]=Modos de vista Name[et]=Vaaterežiimid Name[eu]=Ikuspegi moduak -Name[fi]=Katselutilat +Name[fi]=Näkymät Name[fr]=Modes d'affichage Name[fy]=Werjeftemodus Name[ga]=Móid Amhairc -- cgit v1.3 From c62146f9ffa824cf619247c6482a1d4a89349a7c Mon Sep 17 00:00:00 2001 From: Patrick Spendrin Date: Sun, 29 Jul 2012 01:11:21 +0200 Subject: msvc needs to have the class definition for reference parameters in methods --- src/kitemviews/kfileitemmodelrolesupdater.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index 55f5142f6..8276d807f 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -610,8 +610,10 @@ void KFileItemModelRolesUpdater::applyChangedNepomukRoles(const Nepomuk::Resourc connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet)), this, SLOT(slotItemsChanged(KItemRangeList,QSet))); #else +#ifndef Q_CC_MSVC Q_UNUSED(resource); #endif +#endif } void KFileItemModelRolesUpdater::slotDirWatchDirty(const QString& path) -- cgit v1.3 From 28773a880130989d58158f3a40940c79918e4d34 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Mon, 30 Jul 2012 09:50:07 +0200 Subject: SVN_SILENT made messages (.desktop file) --- src/dolphinpart.desktop | 3 ++- 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, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/dolphinpart.desktop b/src/dolphinpart.desktop index d7a336681..ff5600337 100644 --- a/src/dolphinpart.desktop +++ b/src/dolphinpart.desktop @@ -223,6 +223,7 @@ Name[pl]=Kompaktowo Name[pt]=Compacto Name[pt_BR]=Compacto Name[ro]=Compact +Name[ru]=Столбцы Name[sk]=Kompaktný Name[sl]=Strnjeno Name[sr]=Сажето @@ -305,7 +306,7 @@ Name[pl]=Szczegóły Name[pt]=Detalhes Name[pt_BR]=Detalhes Name[ro]=Detalii -Name[ru]=Сведения +Name[ru]=Таблица Name[si]=විස්තර Name[sk]=Podrobnosti Name[sl]=Podrobnosti diff --git a/src/settings/kcm/kcmdolphingeneral.desktop b/src/settings/kcm/kcmdolphingeneral.desktop index 366aa0fd1..da5fb9b5b 100644 --- a/src/settings/kcm/kcmdolphingeneral.desktop +++ b/src/settings/kcm/kcmdolphingeneral.desktop @@ -320,6 +320,7 @@ X-KDE-Keywords[pl]=menedżer plików X-KDE-Keywords[pt]=gestor de ficheiros X-KDE-Keywords[pt_BR]=gerenciador de arquivos X-KDE-Keywords[ro]=gestionar de fișiere +X-KDE-Keywords[ru]=диспетчер файлов X-KDE-Keywords[sk]=správca súborov X-KDE-Keywords[sl]=upravljalnik datotek X-KDE-Keywords[sr]=file manager,менаџер фајлова diff --git a/src/settings/kcm/kcmdolphinnavigation.desktop b/src/settings/kcm/kcmdolphinnavigation.desktop index cf23a2eba..ff748f2a2 100644 --- a/src/settings/kcm/kcmdolphinnavigation.desktop +++ b/src/settings/kcm/kcmdolphinnavigation.desktop @@ -320,6 +320,7 @@ X-KDE-Keywords[pl]=menedżer plików X-KDE-Keywords[pt]=gestor de ficheiros X-KDE-Keywords[pt_BR]=gerenciador de arquivos X-KDE-Keywords[ro]=gestionar de fișiere +X-KDE-Keywords[ru]=диспетчер файлов X-KDE-Keywords[sk]=správca súborov X-KDE-Keywords[sl]=upravljalnik datotek X-KDE-Keywords[sr]=file manager,менаџер фајлова diff --git a/src/settings/kcm/kcmdolphinservices.desktop b/src/settings/kcm/kcmdolphinservices.desktop index 37b382e24..2c9219069 100644 --- a/src/settings/kcm/kcmdolphinservices.desktop +++ b/src/settings/kcm/kcmdolphinservices.desktop @@ -271,6 +271,7 @@ X-KDE-Keywords[pl]=menedżer plików X-KDE-Keywords[pt]=gestor de ficheiros X-KDE-Keywords[pt_BR]=gerenciador de arquivos X-KDE-Keywords[ro]=gestionar de fișiere +X-KDE-Keywords[ru]=диспетчер файлов X-KDE-Keywords[sk]=správca súborov X-KDE-Keywords[sl]=upravljalnik datotek X-KDE-Keywords[sr]=file manager,менаџер фајлова diff --git a/src/settings/kcm/kcmdolphinviewmodes.desktop b/src/settings/kcm/kcmdolphinviewmodes.desktop index bee3ac64c..9d6bcde7b 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.desktop +++ b/src/settings/kcm/kcmdolphinviewmodes.desktop @@ -318,6 +318,7 @@ X-KDE-Keywords[pl]=menedżer plików X-KDE-Keywords[pt]=gestor de ficheiros X-KDE-Keywords[pt_BR]=gerenciador de arquivos X-KDE-Keywords[ro]=gestionar de fișiere +X-KDE-Keywords[ru]=диспетчер файлов X-KDE-Keywords[sk]=správca súborov X-KDE-Keywords[sl]=upravljalnik datotek X-KDE-Keywords[sr]=file manager,менаџер фајлова -- cgit v1.3 From 59fb4144c0db064adab4c4d6de0006d596cd6b93 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Thu, 2 Aug 2012 10:53:11 +0200 Subject: SVN_SILENT made messages (.desktop file) --- src/settings/kcm/kcmdolphingeneral.desktop | 1 + src/settings/kcm/kcmdolphinnavigation.desktop | 1 + src/settings/kcm/kcmdolphinservices.desktop | 1 + src/settings/kcm/kcmdolphinviewmodes.desktop | 1 + 4 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/settings/kcm/kcmdolphingeneral.desktop b/src/settings/kcm/kcmdolphingeneral.desktop index da5fb9b5b..de9dfc0c6 100644 --- a/src/settings/kcm/kcmdolphingeneral.desktop +++ b/src/settings/kcm/kcmdolphingeneral.desktop @@ -310,6 +310,7 @@ X-KDE-Keywords[it]=gestore dei file X-KDE-Keywords[kk]=file manager X-KDE-Keywords[km]=កម្មវិធី​គ្រប់គ្រង​ឯកសារ X-KDE-Keywords[ko]=파일 관리자 +X-KDE-Keywords[lt]=Failų tvarkyklė X-KDE-Keywords[lv]=failu pārvaldnieks X-KDE-Keywords[nb]=filbehandler X-KDE-Keywords[nds]=Dateipleger diff --git a/src/settings/kcm/kcmdolphinnavigation.desktop b/src/settings/kcm/kcmdolphinnavigation.desktop index ff748f2a2..e05f15d34 100644 --- a/src/settings/kcm/kcmdolphinnavigation.desktop +++ b/src/settings/kcm/kcmdolphinnavigation.desktop @@ -310,6 +310,7 @@ X-KDE-Keywords[it]=gestore dei file X-KDE-Keywords[kk]=file manager X-KDE-Keywords[km]=កម្មវិធី​គ្រប់គ្រង​ឯកសារ X-KDE-Keywords[ko]=파일 관리자 +X-KDE-Keywords[lt]=Failų tvarkyklė X-KDE-Keywords[lv]=failu pārvaldnieks X-KDE-Keywords[nb]=filbehandler X-KDE-Keywords[nds]=Dateipleger diff --git a/src/settings/kcm/kcmdolphinservices.desktop b/src/settings/kcm/kcmdolphinservices.desktop index 2c9219069..a87b96240 100644 --- a/src/settings/kcm/kcmdolphinservices.desktop +++ b/src/settings/kcm/kcmdolphinservices.desktop @@ -261,6 +261,7 @@ X-KDE-Keywords[it]=gestore dei file X-KDE-Keywords[kk]=file manager X-KDE-Keywords[km]=កម្មវិធី​គ្រប់គ្រង​ឯកសារ X-KDE-Keywords[ko]=파일 관리자 +X-KDE-Keywords[lt]=Failų tvarkyklė X-KDE-Keywords[lv]=failu pārvaldnieks X-KDE-Keywords[nb]=filbehandler X-KDE-Keywords[nds]=Dateipleger diff --git a/src/settings/kcm/kcmdolphinviewmodes.desktop b/src/settings/kcm/kcmdolphinviewmodes.desktop index 9d6bcde7b..328f66466 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.desktop +++ b/src/settings/kcm/kcmdolphinviewmodes.desktop @@ -308,6 +308,7 @@ X-KDE-Keywords[it]=gestore dei file X-KDE-Keywords[kk]=file manager X-KDE-Keywords[km]=កម្មវិធី​គ្រប់គ្រង​ឯកសារ X-KDE-Keywords[ko]=파일 관리자 +X-KDE-Keywords[lt]=Failų tvarkyklė X-KDE-Keywords[lv]=failu pārvaldnieks X-KDE-Keywords[nb]=filbehandler X-KDE-Keywords[nds]=Dateipleger -- cgit v1.3 From d7f18f528452c954cc2e2490d1e24d20f9b5ccdc Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Mon, 6 Aug 2012 02:21:23 +0200 Subject: Stop preview jobs when closing Dolphin Patch by Benni Hill. Thanks for the patch! BUG: 304467 FIXED-IN: 4.9.1 --- src/kitemviews/kfileitemmodelrolesupdater.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index 8276d807f..6dba2245d 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -133,6 +133,7 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO KFileItemModelRolesUpdater::~KFileItemModelRolesUpdater() { + resetPendingRoles(); } void KFileItemModelRolesUpdater::setIconSize(const QSize& size) -- cgit v1.3 From e534bc08f05a7218cf46fc5137a25304916530ee Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Tue, 7 Aug 2012 22:52:31 +0200 Subject: Fix the size of the rating stars in Icons View Moreover, make sure that the selection rectangle is large enough to include the stars. Patch by Emmanuel Pescosta. Thanks for the patch! BUG: 302624 FIXED-IN: 4.9.1 REVIEW: 105830 --- src/kitemviews/kstandarditemlistwidget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index 9cdb60e24..555449a32 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -291,7 +291,7 @@ void KStandardItemListWidget::paint(QPainter* painter, const QStyleOptionGraphic QPointF pos = ratingTextInfo->pos; const Qt::Alignment align = ratingTextInfo->staticText.textOption().alignment(); if (align & Qt::AlignHCenter) { - pos.rx() += (size().width() - m_rating.width()) / 2; + pos.rx() += (size().width() - m_rating.width()) / 2 - 2; } painter->drawPixmap(pos, m_rating); } @@ -913,7 +913,7 @@ void KStandardItemListWidget::updateTextsCache() const qreal availableWidth = (m_layout == DetailsLayout) ? columnWidth("rating") - columnPadding(option) - : m_textRect.width(); + : size().width(); if (ratingSize.width() > availableWidth) { ratingSize.rwidth() = availableWidth; } @@ -1029,6 +1029,9 @@ void KStandardItemListWidget::updateIconsLayoutTextCache() const QString elidedText = m_customizedFontMetrics.elidedText(text, Qt::ElideRight, maxWidth); textInfo->staticText.setText(elidedText); requiredWidth = m_customizedFontMetrics.width(elidedText); + } else if (role == "rating") { + // Use the width of the rating pixmap, because the rating text is empty. + requiredWidth = m_rating.width(); } } layout.endLayout(); -- cgit v1.3 From 0751d0b0187f113d319c6680ba0110626507d8bc Mon Sep 17 00:00:00 2001 From: Martin Sandsmark Date: Thu, 9 Aug 2012 03:27:11 +0200 Subject: Use a saner check for multimedia files in infopanel. Don't rely on the reported supported mimetypes from Phonon, Phonon supports more than just video and audio, but if it is video or audio there's a very good chance Phonon supports it. (If the mime type isn't in the list returned by Phonon there's still a good chance it supports it, because mime types are stupid.) BUG: 252539 FIXED-IN: 4.9.1 (cherry picked from commit 2fb4419de053c43a0a70ffb21920db687fa87b6e) --- src/panels/information/informationpanelcontent.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index c03a5a4e2..39ed1d2bd 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -197,9 +197,7 @@ void InformationPanelContent::showItem(const KFileItem& item) if (InformationPanelSettings::previewsShown()) { const QString mimeType = item.mimetype(); - const bool usePhonon = Phonon::BackendCapabilities::isMimeTypeAvailable(mimeType) && - (mimeType != "image/png"); // TODO: workaround, as Phonon - // thinks it supports PNG images + const bool usePhonon = mimeType.startsWith("audio/") || mimeType.startsWith("video/"); if (usePhonon) { m_phononWidget->show(); m_phononWidget->setUrl(item.targetUrl()); -- cgit v1.3 From 540fc3cde43dfca9e35c1c060f1402b0ce12f2a7 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Thu, 9 Aug 2012 23:38:48 +0200 Subject: Use a better icon for recently accessed items in the Places Panel The problem with the icon "package_utility_time" that has been used before was that it is not available on all distros. The new icon "actions/chronometer" should be available on every KDE install. Thanks to Elias Probst for suggesting the new icon - I'm not that familiar with the icons provided by KDE myself. BUG: 304323 FIXED-IN: 4.9.1 --- src/panels/places/placesitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp index dac1bdb3b..318da5391 100644 --- a/src/panels/places/placesitem.cpp +++ b/src/panels/places/placesitem.cpp @@ -138,7 +138,7 @@ void PlacesItem::setBookmark(const KBookmark& bookmark) const GroupType type = groupType(); if (icon().isEmpty()) { switch (type) { - case RecentlyAccessedType: setIcon("package_utility_time"); break; + case RecentlyAccessedType: setIcon("actions/chronometer"); break; case SearchForType: setIcon("nepomuk"); break; case PlacesType: default: setIcon("folder"); -- cgit v1.3 From bed969941463bfa89f38ada695090964e78642a9 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Thu, 9 Aug 2012 23:52:51 +0200 Subject: Follow-up to d7e7ca53bb95c7555bbf107d92b47ac25eda1918 - use correct icon I overlooked that "actions/" is not part of the icon name. Just rebuilding and re-running Dolphin did not reveal this issue, it seems that the old icon "package_utility_time" was still cached somewhere. I hope that it really works on all distros now. CCBUG: 304323 --- src/panels/places/placesitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp index 318da5391..f72f63975 100644 --- a/src/panels/places/placesitem.cpp +++ b/src/panels/places/placesitem.cpp @@ -138,7 +138,7 @@ void PlacesItem::setBookmark(const KBookmark& bookmark) const GroupType type = groupType(); if (icon().isEmpty()) { switch (type) { - case RecentlyAccessedType: setIcon("actions/chronometer"); break; + case RecentlyAccessedType: setIcon("chronometer"); break; case SearchForType: setIcon("nepomuk"); break; case PlacesType: default: setIcon("folder"); -- cgit v1.3 From cd1f32709cac70c47ff00e266ad3458adbe5ae16 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Fri, 10 Aug 2012 17:24:32 +0200 Subject: SVN_SILENT made messages (.desktop file) --- src/dolphinpart.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/dolphinpart.desktop b/src/dolphinpart.desktop index ff5600337..987f70472 100644 --- a/src/dolphinpart.desktop +++ b/src/dolphinpart.desktop @@ -205,7 +205,7 @@ Name[el]=Σύμπτυξη Name[es]=Compacta Name[et]=Kompaktne Name[fi]=Tiivis -Name[fr]=Compact +Name[fr]=Concis Name[ga]=Dlúth Name[hu]=Kompakt Name[ia]=Compacte -- cgit v1.3 From a8cbc655502982dabf37477ed8db314e2bd97906 Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Sat, 11 Aug 2012 16:06:10 +0800 Subject: Show icon size as tooltip when adjusting icon size BUG:292700 FIXED-IN: 4.9.1 REVIEW: 105990 (cherry picked from commit 5e87cefd4c17467c3a650b133dc9bdadea22f9f7) --- src/settings/viewmodes/viewsettingstab.cpp | 28 ++++++++++++++++++++++++++++ src/settings/viewmodes/viewsettingstab.h | 5 +++++ 2 files changed, 33 insertions(+) (limited to 'src') diff --git a/src/settings/viewmodes/viewsettingstab.cpp b/src/settings/viewmodes/viewsettingstab.cpp index fe043a788..bc124516d 100644 --- a/src/settings/viewmodes/viewsettingstab.cpp +++ b/src/settings/viewmodes/viewsettingstab.cpp @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include @@ -59,12 +61,16 @@ ViewSettingsTab::ViewSettingsTab(Mode mode, QWidget* parent) : m_defaultSizeSlider->setPageStep(1); m_defaultSizeSlider->setTickPosition(QSlider::TicksBelow); m_defaultSizeSlider->setRange(minRange, maxRange); + connect(m_defaultSizeSlider, SIGNAL(valueChanged(int)), + this, SLOT(slotDefaultSliderMoved(int))); QLabel* previewLabel = new QLabel(i18nc("@label:listbox", "Preview:"), this); m_previewSizeSlider = new QSlider(Qt::Horizontal, this); m_previewSizeSlider->setPageStep(1); m_previewSizeSlider->setTickPosition(QSlider::TicksBelow); m_previewSizeSlider->setRange(minRange, maxRange); + connect(m_previewSizeSlider, SIGNAL(valueChanged(int)), + this, SLOT(slotPreviewSliderMoved(int))); QGridLayout* layout = new QGridLayout(iconSizeGroup); layout->addWidget(defaultLabel, 0, 0, Qt::AlignRight); @@ -261,4 +267,26 @@ ViewModeSettings::ViewMode ViewSettingsTab::viewMode() const } +void ViewSettingsTab::slotDefaultSliderMoved(int value) +{ + showToolTip(m_defaultSizeSlider, value); +} + +void ViewSettingsTab::slotPreviewSliderMoved(int value) +{ + showToolTip(m_previewSizeSlider, value); +} + +void ViewSettingsTab::showToolTip(QSlider* slider, int value) +{ + const int size = ZoomLevelInfo::iconSizeForZoomLevel(value); + slider->setToolTip(i18ncp("@info:tooltip", "Size: 1 pixel", "Size: %1 pixels", size)); + if (!slider->isVisible()) { + return; + } + QPoint global = slider->rect().topLeft(); + global.ry() += slider->height() / 2; + QHelpEvent toolTipEvent(QEvent::ToolTip, QPoint(0, 0), slider->mapToGlobal(global)); + QApplication::sendEvent(slider, &toolTipEvent); +} #include "viewsettingstab.moc" diff --git a/src/settings/viewmodes/viewsettingstab.h b/src/settings/viewmodes/viewsettingstab.h index 2115da1bc..6bea95b90 100644 --- a/src/settings/viewmodes/viewsettingstab.h +++ b/src/settings/viewmodes/viewsettingstab.h @@ -52,8 +52,13 @@ public: signals: void changed(); +private slots: + + void slotDefaultSliderMoved(int value); + void slotPreviewSliderMoved(int value); private: void loadSettings(); + void showToolTip(QSlider* slider, int value); ViewModeSettings::ViewMode viewMode() const; -- cgit v1.3 From ab61d9d3ba40e5a5869ab02907b4b14921118924 Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Mon, 13 Aug 2012 18:40:43 +0200 Subject: Fix wrong text color in places and in folders panel. FIXED-IN: 4.9.1 REVIEW: 105832 BUG: 303133 --- src/CMakeLists.txt | 1 + src/kitemviews/kstandarditemlistwidget.cpp | 9 ++++-- src/kitemviews/kstandarditemlistwidget.h | 2 ++ src/panels/folders/foldersitemlistwidget.cpp | 36 ++++++++++++++++++++++++ src/panels/folders/foldersitemlistwidget.h | 42 ++++++++++++++++++++++++++++ src/panels/folders/folderspanel.cpp | 2 ++ src/panels/places/placesitemlistwidget.cpp | 5 ++++ src/panels/places/placesitemlistwidget.h | 3 +- 8 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 src/panels/folders/foldersitemlistwidget.cpp create mode 100644 src/panels/folders/foldersitemlistwidget.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5c1a6dad5..afc190f83 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -165,6 +165,7 @@ set(dolphin_SRCS panels/places/placesitemmodel.cpp panels/places/placesitemsignalhandler.cpp panels/panel.cpp + panels/folders/foldersitemlistwidget.cpp panels/folders/treeviewcontextmenu.cpp panels/folders/folderspanel.cpp search/dolphinfacetswidget.cpp diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index 555449a32..69c5602c7 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -464,6 +464,11 @@ QFont KStandardItemListWidget::customizedFont(const QFont& baseFont) const return baseFont; } +QPalette::ColorRole KStandardItemListWidget::normalTextColorPalette() const +{ + return QPalette::Text; +} + void KStandardItemListWidget::setTextColor(const QColor& color) { if (color != m_customTextColor) { @@ -480,7 +485,7 @@ QColor KStandardItemListWidget::textColor() const } const QPalette::ColorGroup group = isActiveWindow() ? QPalette::Active : QPalette::Inactive; - const QPalette::ColorRole role = isSelected() ? QPalette::HighlightedText : QPalette::Text; + const QPalette::ColorRole role = isSelected() ? QPalette::HighlightedText : normalTextColorPalette(); return styleOption().palette.brush(group, role).color(); } @@ -1029,7 +1034,7 @@ void KStandardItemListWidget::updateIconsLayoutTextCache() const QString elidedText = m_customizedFontMetrics.elidedText(text, Qt::ElideRight, maxWidth); textInfo->staticText.setText(elidedText); requiredWidth = m_customizedFontMetrics.width(elidedText); - } else if (role == "rating") { + } else if (role == "rating") { // Use the width of the rating pixmap, because the rating text is empty. requiredWidth = m_rating.width(); } diff --git a/src/kitemviews/kstandarditemlistwidget.h b/src/kitemviews/kstandarditemlistwidget.h index 82b68eac9..462d83d0f 100644 --- a/src/kitemviews/kstandarditemlistwidget.h +++ b/src/kitemviews/kstandarditemlistwidget.h @@ -120,6 +120,8 @@ protected: */ virtual QFont customizedFont(const QFont& baseFont) const; + virtual QPalette::ColorRole normalTextColorPalette() const; + void setTextColor(const QColor& color); QColor textColor() const; diff --git a/src/panels/folders/foldersitemlistwidget.cpp b/src/panels/folders/foldersitemlistwidget.cpp new file mode 100644 index 000000000..513059204 --- /dev/null +++ b/src/panels/folders/foldersitemlistwidget.cpp @@ -0,0 +1,36 @@ +/*************************************************************************** + * Copyright (C) 2012 by Emmanuel Pescosta * + * * + * 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 "foldersitemlistwidget.h" + +FoldersItemListWidget::FoldersItemListWidget(KItemListWidgetInformant* informant, QGraphicsItem* parent) : + KFileItemListWidget(informant, parent) +{ +} + +FoldersItemListWidget::~FoldersItemListWidget() +{ +} + +QPalette::ColorRole FoldersItemListWidget::normalTextColorPalette() const +{ + return QPalette::WindowText; +} + +#include "foldersitemlistwidget.moc" diff --git a/src/panels/folders/foldersitemlistwidget.h b/src/panels/folders/foldersitemlistwidget.h new file mode 100644 index 000000000..fa7b143ae --- /dev/null +++ b/src/panels/folders/foldersitemlistwidget.h @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (C) 2012 by Emmanuel Pescosta * + * * + * 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 FOLDERSITEMLISTWIDGET_H +#define FOLDERSITEMLISTWIDGET_H + +#include + +/** + * @brief Extends KFileItemListWidget to use the right text color. +*/ +class FoldersItemListWidget : public KFileItemListWidget +{ + Q_OBJECT + +public: + FoldersItemListWidget(KItemListWidgetInformant* informant, QGraphicsItem* parent); + virtual ~FoldersItemListWidget(); + +protected: + virtual QPalette::ColorRole normalTextColorPalette() const; +}; + +#endif + + diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp index 78e437a41..0760200b6 100644 --- a/src/panels/folders/folderspanel.cpp +++ b/src/panels/folders/folderspanel.cpp @@ -22,6 +22,7 @@ #include "dolphin_folderspanelsettings.h" #include "dolphin_generalsettings.h" #include "treeviewcontextmenu.h" +#include "foldersitemlistwidget.h" #include #include @@ -120,6 +121,7 @@ void FoldersPanel::showEvent(QShowEvent* event) // This assures that no performance and memory overhead is given when the folders panel is not // used at all and stays invisible. KFileItemListView* view = new KFileItemListView(); + view->setWidgetCreator(new KItemListWidgetCreator()); view->setSupportsItemExpanding(true); // Set the opacity to 0 initially. The opacity will be increased after the loading of the initial tree // has been finished in slotLoadingCompleted(). This prevents an unnecessary animation-mess when diff --git a/src/panels/places/placesitemlistwidget.cpp b/src/panels/places/placesitemlistwidget.cpp index 24c2b3f11..00f0fdab0 100644 --- a/src/panels/places/placesitemlistwidget.cpp +++ b/src/panels/places/placesitemlistwidget.cpp @@ -35,4 +35,9 @@ bool PlacesItemListWidget::isHidden() const return data().value("isHidden").toBool(); } +QPalette::ColorRole PlacesItemListWidget::normalTextColorPalette() const +{ + return QPalette::WindowText; +} + #include "placesitemlistwidget.moc" diff --git a/src/panels/places/placesitemlistwidget.h b/src/panels/places/placesitemlistwidget.h index d7a4f3ddd..93cd8f468 100644 --- a/src/panels/places/placesitemlistwidget.h +++ b/src/panels/places/placesitemlistwidget.h @@ -24,7 +24,7 @@ /** * @brief Extends KStandardItemListWidget to interpret the hidden - * property of the PlacesModel. + * property of the PlacesModel and use the right text color. */ class PlacesItemListWidget : public KStandardItemListWidget { @@ -36,6 +36,7 @@ public: protected: virtual bool isHidden() const; + virtual QPalette::ColorRole normalTextColorPalette() const; }; #endif -- cgit v1.3 From 15b687a27065f466f5f0469a2b653a87ca61d055 Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Tue, 14 Aug 2012 22:02:24 +0200 Subject: Fix wrong text color in Places Group Header. Use QPalette::Window for base color and QPalette::WindowText for text color. Also changed m_roleColor color mixing to 60% (from 70%) -> Better visible color difference when base color is darker than text color. Also changed styleOption().palette.brush(group, role).color() to styleOption().palette.color(group, role) in KStandardItemListWidget -> should be more efficient. BUG: 303133 FIXED-IN: 4.9.1 (cherry picked from commit b3c3da985159a9627c079ad615cd77fc5f7bb72a) --- src/kitemviews/kitemlistgroupheader.cpp | 28 ++++++++++++++++++++++--- src/kitemviews/kitemlistgroupheader.h | 6 ++++++ src/kitemviews/kstandarditemlistwidget.cpp | 6 +++--- src/kitemviews/kstandarditemlistwidget.h | 2 +- src/panels/folders/foldersitemlistwidget.cpp | 2 +- src/panels/folders/foldersitemlistwidget.h | 2 +- src/panels/places/placesitemlistgroupheader.cpp | 5 +++++ src/panels/places/placesitemlistgroupheader.h | 2 ++ src/panels/places/placesitemlistwidget.cpp | 2 +- src/panels/places/placesitemlistwidget.h | 2 +- 10 files changed, 46 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/kitemviews/kitemlistgroupheader.cpp b/src/kitemviews/kitemlistgroupheader.cpp index 576d20b88..17c95a97c 100644 --- a/src/kitemviews/kitemlistgroupheader.cpp +++ b/src/kitemviews/kitemlistgroupheader.cpp @@ -180,10 +180,10 @@ void KItemListGroupHeader::updateCache() // Calculate the role- and line-color. No alphablending is used for // performance reasons. - const QColor c1 = m_styleOption.palette.text().color(); - const QColor c2 = m_styleOption.palette.base().color(); + const QColor c1 = textColor(); + const QColor c2 = baseColor(); m_separatorColor = mixedColor(c1, c2, 10); - m_roleColor = mixedColor(c1, c2, 70); + m_roleColor = mixedColor(c1, c2, 60); const int padding = qMax(1, m_styleOption.padding); const int horizontalMargin = qMax(2, m_styleOption.horizontalMargin); @@ -211,4 +211,26 @@ QColor KItemListGroupHeader::mixedColor(const QColor& c1, const QColor& c2, int (c1.blue() * c1Percent + c2.blue() * c2Percent) / 100); } +QPalette::ColorRole KItemListGroupHeader::normalTextColorRole() const +{ + return QPalette::Text; +} + +QPalette::ColorRole KItemListGroupHeader::normalBaseColorRole() const +{ + return QPalette::Window; +} + +QColor KItemListGroupHeader::textColor() const +{ + const QPalette::ColorGroup group = isActiveWindow() ? QPalette::Active : QPalette::Inactive; + return styleOption().palette.color(group, normalTextColorRole()); +} + +QColor KItemListGroupHeader::baseColor() const +{ + const QPalette::ColorGroup group = isActiveWindow() ? QPalette::Active : QPalette::Inactive; + return styleOption().palette.color(group, normalBaseColorRole()); +} + #include "kitemlistgroupheader.moc" diff --git a/src/kitemviews/kitemlistgroupheader.h b/src/kitemviews/kitemlistgroupheader.h index e19ab4871..1e8ed2cca 100644 --- a/src/kitemviews/kitemlistgroupheader.h +++ b/src/kitemviews/kitemlistgroupheader.h @@ -104,11 +104,17 @@ protected: /** @reimp */ virtual void resizeEvent(QGraphicsSceneResizeEvent* event); + virtual QPalette::ColorRole normalTextColorRole() const; + virtual QPalette::ColorRole normalBaseColorRole() const; + private: void updateCache(); static QColor mixedColor(const QColor& c1, const QColor& c2, int c1Percent = 50); + QColor textColor() const; + QColor baseColor() const; + private: bool m_dirtyCache; QByteArray m_role; diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index 69c5602c7..3a76f14a2 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -464,7 +464,7 @@ QFont KStandardItemListWidget::customizedFont(const QFont& baseFont) const return baseFont; } -QPalette::ColorRole KStandardItemListWidget::normalTextColorPalette() const +QPalette::ColorRole KStandardItemListWidget::normalTextColorRole() const { return QPalette::Text; } @@ -485,8 +485,8 @@ QColor KStandardItemListWidget::textColor() const } const QPalette::ColorGroup group = isActiveWindow() ? QPalette::Active : QPalette::Inactive; - const QPalette::ColorRole role = isSelected() ? QPalette::HighlightedText : normalTextColorPalette(); - return styleOption().palette.brush(group, role).color(); + const QPalette::ColorRole role = isSelected() ? QPalette::HighlightedText : normalTextColorRole(); + return styleOption().palette.color(group, role); } void KStandardItemListWidget::setOverlay(const QPixmap& overlay) diff --git a/src/kitemviews/kstandarditemlistwidget.h b/src/kitemviews/kstandarditemlistwidget.h index 462d83d0f..787722ddd 100644 --- a/src/kitemviews/kstandarditemlistwidget.h +++ b/src/kitemviews/kstandarditemlistwidget.h @@ -120,7 +120,7 @@ protected: */ virtual QFont customizedFont(const QFont& baseFont) const; - virtual QPalette::ColorRole normalTextColorPalette() const; + virtual QPalette::ColorRole normalTextColorRole() const; void setTextColor(const QColor& color); QColor textColor() const; diff --git a/src/panels/folders/foldersitemlistwidget.cpp b/src/panels/folders/foldersitemlistwidget.cpp index 513059204..b4f9a5be8 100644 --- a/src/panels/folders/foldersitemlistwidget.cpp +++ b/src/panels/folders/foldersitemlistwidget.cpp @@ -28,7 +28,7 @@ FoldersItemListWidget::~FoldersItemListWidget() { } -QPalette::ColorRole FoldersItemListWidget::normalTextColorPalette() const +QPalette::ColorRole FoldersItemListWidget::normalTextColorRole() const { return QPalette::WindowText; } diff --git a/src/panels/folders/foldersitemlistwidget.h b/src/panels/folders/foldersitemlistwidget.h index fa7b143ae..08d41b829 100644 --- a/src/panels/folders/foldersitemlistwidget.h +++ b/src/panels/folders/foldersitemlistwidget.h @@ -34,7 +34,7 @@ public: virtual ~FoldersItemListWidget(); protected: - virtual QPalette::ColorRole normalTextColorPalette() const; + virtual QPalette::ColorRole normalTextColorRole() const; }; #endif diff --git a/src/panels/places/placesitemlistgroupheader.cpp b/src/panels/places/placesitemlistgroupheader.cpp index 27d4c7917..ec7c4b18c 100644 --- a/src/panels/places/placesitemlistgroupheader.cpp +++ b/src/panels/places/placesitemlistgroupheader.cpp @@ -37,4 +37,9 @@ void PlacesItemListGroupHeader::paintSeparator(QPainter* painter, const QColor& Q_UNUSED(color); } +QPalette::ColorRole PlacesItemListGroupHeader::normalTextColorRole() const +{ + return QPalette::WindowText; +} + #include "placesitemlistgroupheader.moc" diff --git a/src/panels/places/placesitemlistgroupheader.h b/src/panels/places/placesitemlistgroupheader.h index fbcd116f1..1c2d5cc25 100644 --- a/src/panels/places/placesitemlistgroupheader.h +++ b/src/panels/places/placesitemlistgroupheader.h @@ -32,6 +32,8 @@ public: protected: virtual void paintSeparator(QPainter* painter, const QColor& color); + + virtual QPalette::ColorRole normalTextColorRole() const; }; #endif diff --git a/src/panels/places/placesitemlistwidget.cpp b/src/panels/places/placesitemlistwidget.cpp index 00f0fdab0..e33d1daf9 100644 --- a/src/panels/places/placesitemlistwidget.cpp +++ b/src/panels/places/placesitemlistwidget.cpp @@ -35,7 +35,7 @@ bool PlacesItemListWidget::isHidden() const return data().value("isHidden").toBool(); } -QPalette::ColorRole PlacesItemListWidget::normalTextColorPalette() const +QPalette::ColorRole PlacesItemListWidget::normalTextColorRole() const { return QPalette::WindowText; } diff --git a/src/panels/places/placesitemlistwidget.h b/src/panels/places/placesitemlistwidget.h index 93cd8f468..a2a88c1f0 100644 --- a/src/panels/places/placesitemlistwidget.h +++ b/src/panels/places/placesitemlistwidget.h @@ -36,7 +36,7 @@ public: protected: virtual bool isHidden() const; - virtual QPalette::ColorRole normalTextColorPalette() const; + virtual QPalette::ColorRole normalTextColorRole() const; }; #endif -- cgit v1.3 From 90e1e4e9f0a9a44ef7d97a257094fac976193dc7 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 16 Aug 2012 22:27:12 +0200 Subject: Fix translations not showing in the Sort by and Additional Information submenus Acked by Frank REVIEW: 106049 BUGS: 305228 FIXED-IN: 4.9.1 --- src/kitemviews/kfileitemmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index f8302cfab..1bf9e65d4 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -287,7 +287,7 @@ QString KFileItemModel::roleDescription(const QByteArray& role) const int count = 0; const RoleInfoMap* map = rolesInfoMap(count); for (int i = 0; i < count; ++i) { - description.insert(map[i].role, map[i].roleTranslation); + description.insert(map[i].role, i18nc(map[i].roleTranslationContext, map[i].roleTranslation)); } } @@ -560,8 +560,8 @@ QList KFileItemModel::rolesInformation() if (map[i].roleType != NoRole) { RoleInfo info; info.role = map[i].role; - info.translation = map[i].roleTranslation; - info.group = map[i].groupTranslation; + info.translation = i18nc(map[i].roleTranslationContext, map[i].roleTranslation); + info.group = i18nc(map[i].groupTranslationContext, map[i].groupTranslation); info.requiresNepomuk = map[i].requiresNepomuk; info.requiresIndexer = map[i].requiresIndexer; rolesInfo.append(info); -- cgit v1.3 From e7793132e8fc1549bb7781b43dbee840211224e6 Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Sat, 18 Aug 2012 15:11:53 +0200 Subject: Select the correct item in places-panel, when a directory is opened. BUG: 304541 REVIEW: 106074 FIXED-IN: 4.9.1 (cherry picked from commit 1ec8de2c619006e3fe997fbf6074035d65dea6c5) --- src/panels/places/placespanel.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 429c5399a..d4450888e 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -62,6 +62,16 @@ PlacesPanel::~PlacesPanel() bool PlacesPanel::urlChanged() { + if (!url().isValid() || url().protocol().contains("search")) { + // Skip results shown by a search, as possible identical + // directory names are useless without parent-path information. + return false; + } + + if (m_controller) { + selectClosestItem(); + } + return true; } -- cgit v1.3 From 2727715cdd8aa738f4b5f0bbcca55a9d249be77b Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Fri, 24 Aug 2012 18:51:27 +0200 Subject: Fix regression that caused "(I18N_EMPTY_MESSAGE)" sub menus in menus For top-level roles like "Name" and "Size", the group translation is 0. In that case, the "group" member of the corresponding RoleInfo struct must be an empty string. This is expected by the code which generates Dolphin's menus, which group the top-level roles into a sub menu with the name "(I18N_EMPTY_MESSAGE)" otherwise. This is a recent regression caused by 199fabbaa8d8a12fb49e4c9922c38ec8b033923c. Thanks to Christoph Feck for investigating this issue! CCBUG: 305228 --- src/kitemviews/kfileitemmodel.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 1bf9e65d4..6936af431 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -561,7 +561,14 @@ QList KFileItemModel::rolesInformation() RoleInfo info; info.role = map[i].role; info.translation = i18nc(map[i].roleTranslationContext, map[i].roleTranslation); - info.group = i18nc(map[i].groupTranslationContext, map[i].groupTranslation); + if (map[i].groupTranslation) { + info.group = i18nc(map[i].groupTranslationContext, map[i].groupTranslation); + } else { + // For top level roles, groupTranslation is 0. We must make sure that + // info.group is an empty string then because the code that generates + // menus tries to put the actions into sub menus otherwise. + info.group = QString(); + } info.requiresNepomuk = map[i].requiresNepomuk; info.requiresIndexer = map[i].requiresIndexer; rolesInfo.append(info); -- cgit v1.3 From 09775ec745e825d248c982396ad36a9bd63aa255 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Fri, 24 Aug 2012 23:21:31 +0200 Subject: Do not crash when finishing inline renaming in unusual ways The crash was caused by a null pointer dereference when, e.g., minimizing Dolphin. The root cause was that KStandardItemListWidget::closeRoleEditor() was called twice: once when the role editor loses focus, and once again when the window is resized. After m_roleEditor was set to 0, the second call dereferenced this null pointer. I think the best solution is to disconnect from the role editor's signals when the editor is not needed any more by the KStandardItemListWidget. BUG: 304524 FIXED-IN: 4.9.1 --- src/kitemviews/kstandarditemlistwidget.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index 3a76f14a2..7ae7e2efc 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -594,6 +594,11 @@ void KStandardItemListWidget::editedRoleChanged(const QByteArray& current, const if (current.isEmpty() || !parent || current != "text") { if (m_roleEditor) { emit roleEditingCanceled(index(), current, data().value(current)); + + disconnect(m_roleEditor, SIGNAL(roleEditingCanceled(int,QByteArray,QVariant)), + this, SLOT(slotRoleEditingCanceled(int,QByteArray,QVariant))); + disconnect(m_roleEditor, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)), + this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant))); m_roleEditor->deleteLater(); m_roleEditor = 0; } @@ -1253,6 +1258,11 @@ void KStandardItemListWidget::closeRoleEditor() // to transfer the keyboard focus back to the KItemListContainer. scene()->views()[0]->parentWidget()->setFocus(); } + + disconnect(m_roleEditor, SIGNAL(roleEditingCanceled(int,QByteArray,QVariant)), + this, SLOT(slotRoleEditingCanceled(int,QByteArray,QVariant))); + disconnect(m_roleEditor, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)), + this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant))); m_roleEditor->deleteLater(); m_roleEditor = 0; } -- cgit v1.3 From 23ce8df1c8163a94bbbf584cbe44a6ebd22b2c3a Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Fri, 24 Aug 2012 21:47:14 +0200 Subject: Fix wrong behaviour, when Dolphin is started with --split argument. Actual Results: dolphin starts without split view Expected Results: dolphin starts with split view New behaviour: * no url given - use default url for all two views * one url given - use given url for all two views * two urls given - open the first url in the left view and the second url in the right view BUG: 305538 REVIEW: 106171 FIXED-IN: 4.9.1 --- src/dolphinapplication.cpp | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/dolphinapplication.cpp b/src/dolphinapplication.cpp index 0cd51a454..8e83a8592 100644 --- a/src/dolphinapplication.cpp +++ b/src/dolphinapplication.cpp @@ -38,6 +38,16 @@ DolphinApplication::DolphinApplication() : KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); + const int argsCount = args->count(); + + QList urls; + for (int i = 0; i < argsCount; ++i) { + const KUrl url = args->url(i); + if (url.isValid()) { + urls.append(url); + } + } + bool resetSplitSettings = false; if (args->isSet("split") && !GeneralSettings::splitView()) { // Dolphin should be opened with a split view although this is not @@ -45,31 +55,29 @@ DolphinApplication::DolphinApplication() : // all passed URLs have been opened. GeneralSettings::setSplitView(true); resetSplitSettings = true; - } - const int argsCount = args->count(); - if (argsCount > 0) { - QList urls; - for (int i = 0; i < argsCount; ++i) { - const KUrl url = args->url(i); - if (url.isValid()) { - urls.append(url); - } + // We need 2 URLs to open Dolphin in split view mode + if (urls.isEmpty()) { // No URL given - Open home URL in all two views + urls.append(GeneralSettings::homeUrl()); + urls.append(GeneralSettings::homeUrl()); + } else if (urls.length() == 1) { // Only 1 URL given - Open given URL in all two views + urls.append(urls.at(0)); } + } - if (!urls.isEmpty()) { - if (args->isSet("select")) { - m_mainWindow->openFiles(urls); - } else { - m_mainWindow->openDirectories(urls); - } + if (!urls.isEmpty()) { + if (args->isSet("select")) { + m_mainWindow->openFiles(urls); + } else { + m_mainWindow->openDirectories(urls); } } - args->clear(); if (resetSplitSettings) { GeneralSettings::setSplitView(false); } + + args->clear(); } DolphinApplication::~DolphinApplication() -- cgit v1.3 From d898f40f29f6328fd80165022790609972dcce7c Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Thu, 23 Aug 2012 22:58:05 -0300 Subject: Adjust to Ark's drag'n'drop D-Bus interface changes. Ark's drag'n'drop D-Bus interface needs to be changed: so far, the object path was always /DndExtract, but this does not work if Ark is being used as an embedded KPart (in Konqueror or Rekonq, for example), as all tabs will end up calling QDBusConnection::registerObject() with the same path. Only the first call will work, and the result is that dragging and dropping from any tab previewing an archive with Ark will extract from the first archive being previewed. To fix that, applications that accept the application/x-kde-dndextract mimetype should now be adjusted to check the application/x-kde-ark-dndextract-service and application/x-kde-ark-dndextract-path ones instead; the former contains the same service information that used to be passed, while the latter tells which object path should be talked to. This is the Dolphin part of the change, which also needs to be made to the folderview plasmoid. REVIEW: 106131 CCBUG: 304860 --- src/views/draganddrophelper.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/views/draganddrophelper.cpp b/src/views/draganddrophelper.cpp index 45e5076f6..f81d4d0bf 100644 --- a/src/views/draganddrophelper.cpp +++ b/src/views/draganddrophelper.cpp @@ -35,10 +35,13 @@ QString DragAndDropHelper::dropUrls(const KFileItem& destItem, const KUrl& destU } const QMimeData* mimeData = event->mimeData(); - if (mimeData->hasFormat("application/x-kde-dndextract")) { - const QString remoteDBusClient = mimeData->data("application/x-kde-dndextract"); - QDBusMessage message = QDBusMessage::createMethodCall(remoteDBusClient, "/DndExtract", - "org.kde.DndExtract", "extractSelectedFilesTo"); + if (mimeData->hasFormat("application/x-kde-ark-dndextract-service") && + mimeData->hasFormat("application/x-kde-ark-dndextract-path")) { + const QString remoteDBusClient = mimeData->data("application/x-kde-ark-dndextract-service"); + const QString remoteDBusPath = mimeData->data("application/x-kde-ark-dndextract-path"); + + QDBusMessage message = QDBusMessage::createMethodCall(remoteDBusClient, remoteDBusPath, + "org.kde.ark.DndExtract", "extractSelectedFilesTo"); message.setArguments(QVariantList() << destUrl.pathOrUrl()); QDBusConnection::sessionBus().call(message); } else if (!destItem.isNull() && (destItem.isDir() || destItem.isDesktopFile())) { -- cgit v1.3