From 4453d62f8b454a1f0d489bf7abde533d52e475e8 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 13 May 2016 11:48:30 +0200 Subject: use selected icon state for selected sidebar item Since now the breeze icons can be recolored by kiconloader with svg stylesheets, use this feature to recolor the currently selected icon in the sidebar and in the details view (not the icon view) look wouldn't change if used with icon themes that don't support this feature This makes it look more in line with the breeze style REVIEW:127877 --- src/kitemviews/kstandarditemlistwidget.cpp | 17 +++++++++++++---- src/kitemviews/kstandarditemlistwidget.h | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src/kitemviews') diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index 51c5bc896..8740cb73f 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -850,6 +850,15 @@ void KStandardItemListWidget::hideEvent(QHideEvent* event) KItemListWidget::hideEvent(event); } +bool KStandardItemListWidget::event(QEvent *event) +{ + if (event->type() == QEvent::WindowDeactivate || event->type() == QEvent::WindowActivate) { + m_dirtyContent = true; + } + + return KItemListWidget::event(event); +} + void KStandardItemListWidget::slotCutItemsChanged() { const QUrl itemUrl = data().value("url").toUrl(); @@ -954,7 +963,7 @@ void KStandardItemListWidget::updatePixmapCache() iconName = QStringLiteral("unknown"); } const QStringList overlays = values["iconOverlays"].toStringList(); - m_pixmap = pixmapForIcon(iconName, overlays, maxIconHeight); + m_pixmap = pixmapForIcon(iconName, overlays, maxIconHeight, isSelected() && isActiveWindow() ? QIcon::Selected : QIcon::Normal); } else if (m_pixmap.width() / m_pixmap.devicePixelRatio() != maxIconWidth || m_pixmap.height() / m_pixmap.devicePixelRatio() != maxIconHeight) { // A custom pixmap has been applied. Assure that the pixmap @@ -1438,11 +1447,11 @@ void KStandardItemListWidget::closeRoleEditor() m_roleEditor = 0; } -QPixmap KStandardItemListWidget::pixmapForIcon(const QString& name, const QStringList& overlays, int size) +QPixmap KStandardItemListWidget::pixmapForIcon(const QString& name, const QStringList& overlays, int size, QIcon::Mode mode) { static const QIcon fallbackIcon = QIcon::fromTheme(QStringLiteral("unknown")); size *= qApp->devicePixelRatio(); - const QString key = "KStandardItemListWidget:" % name % ":" % overlays.join(QStringLiteral(":")) % ":" % QString::number(size); + const QString key = "KStandardItemListWidget:" % name % ":" % overlays.join(QStringLiteral(":")) % ":" % QString::number(size) % ":" % QString::number(mode); QPixmap pixmap; if (!QPixmapCache::find(key, pixmap)) { @@ -1467,7 +1476,7 @@ QPixmap KStandardItemListWidget::pixmapForIcon(const QString& name, const QStrin requestedSize = size; } - pixmap = icon.pixmap(requestedSize / qApp->devicePixelRatio(), requestedSize / qApp->devicePixelRatio()); + pixmap = icon.pixmap(requestedSize / qApp->devicePixelRatio(), requestedSize / qApp->devicePixelRatio(), mode); if (requestedSize != size) { KPixmapModifier::scale(pixmap, QSize(size, size)); } diff --git a/src/kitemviews/kstandarditemlistwidget.h b/src/kitemviews/kstandarditemlistwidget.h index 9ab5d4c8f..e6ba4bb3f 100644 --- a/src/kitemviews/kstandarditemlistwidget.h +++ b/src/kitemviews/kstandarditemlistwidget.h @@ -183,6 +183,7 @@ protected: virtual void resizeEvent(QGraphicsSceneResizeEvent* event) Q_DECL_OVERRIDE; virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE; virtual void hideEvent(QHideEvent* event) Q_DECL_OVERRIDE; + bool event(QEvent *event) Q_DECL_OVERRIDE; private slots: void slotCutItemsChanged(); @@ -212,7 +213,7 @@ private: */ void closeRoleEditor(); - static QPixmap pixmapForIcon(const QString& name, const QStringList& overlays, int size); + static QPixmap pixmapForIcon(const QString& name, const QStringList& overlays, int size, QIcon::Mode mode); /** * @return Preferred size of the rating-image based on the given -- cgit v1.3.1 From b1471bbd09d88da3ffe8159075b3108bf9586220 Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Sun, 15 May 2016 18:09:09 +0200 Subject: Fix crash when closing split view with ownCloud plugin loaded KPluginLoader::instantiatePlugins() wraps QPluginLoader::instace(), which doesn't return a new object for each call, so if we set the KFileItemModelRolesUpdater instance as parent to the plugin the shared instance will be deleted leading to crashes when other instances of KFileItemModelRolesUpdater tries to use their plugin objects. To fix this, set the QApplication as a parent. BUG: 357479 REVIEW: 127930 --- src/kitemviews/kfileitemmodelrolesupdater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/kitemviews') diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index e5353dc2a..fe30f62f9 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -133,7 +133,7 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO connect(m_directoryContentsCounter, &KDirectoryContentsCounter::result, this, &KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived); - auto plugins = KPluginLoader::instantiatePlugins(QStringLiteral("kf5/overlayicon"), nullptr, this); + auto plugins = KPluginLoader::instantiatePlugins(QStringLiteral("kf5/overlayicon"), nullptr, qApp); foreach (QObject *it, plugins) { auto plugin = qobject_cast(it); if (plugin) { -- cgit v1.3.1 From e615bfaed4cd562d31ea0506529f730c414b6ec0 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 25 Jun 2016 16:39:49 +0200 Subject: add_definitions(-DQT_NO_URL_CAST_FROM_STRING) + fix compilation This fixes some URLs built from local paths without scheme. --- CMakeLists.txt | 2 ++ src/dolphinmainwindow.cpp | 2 +- src/dolphinviewcontainer.cpp | 2 +- src/kitemviews/kfileitemmodelrolesupdater.cpp | 10 +++++----- src/panels/places/placesitem.cpp | 6 +++--- src/panels/places/placesitemmodel.cpp | 10 +++++----- src/settings/kcm/kcmdolphingeneral.cpp | 2 +- src/statusbar/mountpointobservercache.cpp | 4 ++-- src/views/dolphinview.cpp | 2 +- 9 files changed, 21 insertions(+), 19 deletions(-) (limited to 'src/kitemviews') diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e6111307..86b06e889 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,6 +102,8 @@ else() ) endif() +add_definitions(-DQT_NO_URL_CAST_FROM_STRING) + add_subdirectory(src) add_subdirectory(doc) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 3a06d2c0e..34008b5eb 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -83,7 +83,7 @@ namespace { // Used for GeneralSettings::version() to determine whether // an updated version of Dolphin is running. const int CurrentDolphinVersion = 200; -}; +} DolphinMainWindow::DolphinMainWindow() : KXmlGuiWindow(0), diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 73ffd5c2d..1c43fc977 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -95,7 +95,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) : m_view = new DolphinView(url, this); connect(m_view, &DolphinView::urlChanged, - m_urlNavigator, &KUrlNavigator::setUrl); + m_urlNavigator, &KUrlNavigator::setLocationUrl); connect(m_view, &DolphinView::urlChanged, m_messageWidget, &KMessageWidget::hide); connect(m_view, &DolphinView::directoryLoadingCompleted, diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index fe30f62f9..92a020003 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -374,9 +374,9 @@ void KFileItemModelRolesUpdater::slotItemsRemoved(const KItemRangeList& itemRang m_balooFileMonitor->clear(); } else { QStringList newFileList; - foreach (const QString& itemUrl, m_balooFileMonitor->files()) { - if (m_model->index(itemUrl) >= 0) { - newFileList.append(itemUrl); + foreach (const QString& file, m_balooFileMonitor->files()) { + if (m_model->index(QUrl::fromLocalFile(file)) >= 0) { + newFileList.append(file); } } m_balooFileMonitor->setFiles(newFileList); @@ -707,10 +707,10 @@ void KFileItemModelRolesUpdater::resolveRecentlyChangedItems() updateChangedItems(); } -void KFileItemModelRolesUpdater::applyChangedBalooRoles(const QString& itemUrl) +void KFileItemModelRolesUpdater::applyChangedBalooRoles(const QString& file) { #ifdef HAVE_BALOO - const KFileItem item = m_model->fileItem(itemUrl); + const KFileItem item = m_model->fileItem(QUrl::fromLocalFile(file)); if (item.isNull()) { // itemUrl is not in the model anymore, probably because diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp index a04064d0b..b32f8204d 100644 --- a/src/panels/places/placesitem.cpp +++ b/src/panels/places/placesitem.cpp @@ -276,12 +276,12 @@ void PlacesItem::initializeDevice(const QString& udi) Solid::Block *block = m_device.as(); if (block) { const QString device = block->device(); - setUrl(QStringLiteral("audiocd:/?device=%1").arg(device)); + setUrl(QUrl(QStringLiteral("audiocd:/?device=%1").arg(device))); } else { - setUrl(QStringLiteral("audiocd:/")); + setUrl(QUrl(QStringLiteral("audiocd:/"))); } } else if (m_mtp) { - setUrl(QStringLiteral("mtp:udi=%1").arg(m_device.udi())); + setUrl(QUrl(QStringLiteral("mtp:udi=%1").arg(m_device.udi()))); } } diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index a42cb0403..25c4d51f6 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -1099,17 +1099,17 @@ QUrl PlacesItemModel::createTimelineUrl(const QUrl& url) const int year = date.year(); const int month = date.month(); const int day = date.day(); - timelineUrl = "timeline:/" + timelineDateString(year, month) + - '/' + timelineDateString(year, month, day); + timelineUrl = QUrl("timeline:/" + timelineDateString(year, month) + + '/' + timelineDateString(year, month, day)); } else if (path.endsWith(QLatin1String("thismonth"))) { const QDate date = QDate::currentDate(); - timelineUrl = "timeline:/" + timelineDateString(date.year(), date.month()); + timelineUrl = QUrl("timeline:/" + timelineDateString(date.year(), date.month())); } else if (path.endsWith(QLatin1String("lastmonth"))) { const QDate date = QDate::currentDate().addMonths(-1); - timelineUrl = "timeline:/" + timelineDateString(date.year(), date.month()); + timelineUrl = QUrl("timeline:/" + timelineDateString(date.year(), date.month())); } else { Q_ASSERT(path.endsWith(QLatin1String("today"))); - timelineUrl= url; + timelineUrl = url; } return timelineUrl; diff --git a/src/settings/kcm/kcmdolphingeneral.cpp b/src/settings/kcm/kcmdolphingeneral.cpp index 6a02e0297..3cf7e7652 100644 --- a/src/settings/kcm/kcmdolphingeneral.cpp +++ b/src/settings/kcm/kcmdolphingeneral.cpp @@ -48,7 +48,7 @@ DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget* parent, const QV QTabWidget* tabWidget = new QTabWidget(this); // initialize 'Behavior' tab - BehaviorSettingsPage* behaviorPage = new BehaviorSettingsPage(QDir::homePath(), tabWidget); + BehaviorSettingsPage* behaviorPage = new BehaviorSettingsPage(QUrl::fromLocalFile(QDir::homePath()), tabWidget); tabWidget->addTab(behaviorPage, i18nc("@title:tab Behavior settings", "Behavior")); connect(behaviorPage, &BehaviorSettingsPage::changed, this, static_cast(&DolphinGeneralConfigModule::changed)); diff --git a/src/statusbar/mountpointobservercache.cpp b/src/statusbar/mountpointobservercache.cpp index ab3744eac..48796ac5a 100644 --- a/src/statusbar/mountpointobservercache.cpp +++ b/src/statusbar/mountpointobservercache.cpp @@ -62,10 +62,10 @@ MountPointObserver* MountPointObserverCache::observerForUrl(const QUrl& url) } else { // Even if determining the mount point failed, the observer might still // be able to retrieve information about the url. - cachedObserverUrl = url.toLocalFile(); + cachedObserverUrl = url; } } else { - cachedObserverUrl = url.url(); + cachedObserverUrl = url; } MountPointObserver* observer = m_observerForMountPoint.value(cachedObserverUrl); diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 25aad9b51..5466fd38e 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1278,7 +1278,7 @@ QUrl DolphinView::openItemAsFolderUrl(const KFileItem& item, const bool browseTh if (desktopFile.hasLinkType()) { const QString linkUrl = desktopFile.readUrl(); if (!linkUrl.startsWith(QLatin1String("http"))) { - return linkUrl; + return QUrl::fromUserInput(linkUrl); } } } -- cgit v1.3.1 From f688bcd1f14175f1624e2abcc6452882448467c0 Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Wed, 13 Jul 2016 00:29:15 +0200 Subject: Fix scrolling on hidpi screens Scrolling with libinput was unbearably slow. QScrollBar is much better at scrolling than us, so let it handle it. REVIEW: 128432 BUG: 357618 --- src/kitemviews/kitemlistcontainer.cpp | 22 +------------------ src/kitemviews/private/kitemlistsmoothscroller.cpp | 25 +++++----------------- src/kitemviews/private/kitemlistsmoothscroller.h | 12 +++++------ 3 files changed, 11 insertions(+), 48 deletions(-) (limited to 'src/kitemviews') diff --git a/src/kitemviews/kitemlistcontainer.cpp b/src/kitemviews/kitemlistcontainer.cpp index 69a0a5f27..6974ebb48 100644 --- a/src/kitemviews/kitemlistcontainer.cpp +++ b/src/kitemviews/kitemlistcontainer.cpp @@ -185,27 +185,7 @@ void KItemListContainer::wheelEvent(QWheelEvent* event) KItemListSmoothScroller* smoothScroller = scrollHorizontally ? m_horizontalSmoothScroller : m_verticalSmoothScroller; - const QScrollBar* scrollBar = smoothScroller->scrollBar(); - if (!event->pixelDelta().isNull()) { - const int numPixels = event->pixelDelta().y(); - if (event->modifiers().testFlag(Qt::ShiftModifier)) { - const int scrollingDirection = numPixels > 0 ? 1 : -1; - smoothScroller->scrollTo(scrollBar->value() - scrollBar->pageStep() * scrollingDirection); - } else { - smoothScroller->scrollTo(scrollBar->value() - numPixels); - } - } else { - const int numDegrees = event->angleDelta().y() / 8; - const int numSteps = qApp->wheelScrollLines() * numDegrees / 15; - if (event->modifiers().testFlag(Qt::ShiftModifier)) { - const int scrollingDirection = numSteps > 0 ? 1 : -1; - smoothScroller->scrollTo(scrollBar->value() - scrollBar->pageStep() * scrollingDirection); - } else { - smoothScroller->scrollTo(scrollBar->value() - numSteps * scrollBar->pageStep() / 12); - } - } - - event->accept(); + smoothScroller->handleWheelEvent(event); } void KItemListContainer::slotScrollOrientationChanged(Qt::Orientation current, Qt::Orientation previous) diff --git a/src/kitemviews/private/kitemlistsmoothscroller.cpp b/src/kitemviews/private/kitemlistsmoothscroller.cpp index c89d3cf8f..6bfdba4c9 100644 --- a/src/kitemviews/private/kitemlistsmoothscroller.cpp +++ b/src/kitemviews/private/kitemlistsmoothscroller.cpp @@ -172,8 +172,7 @@ bool KItemListSmoothScroller::eventFilter(QObject* obj, QEvent* event) break; case QEvent::Wheel: - handleWheelEvent(static_cast(event)); - return true; // eat event so that QScrollBar does not scroll one step more by itself + return false; // we're the ones sending them default: break; @@ -196,25 +195,11 @@ void KItemListSmoothScroller::handleWheelEvent(QWheelEvent* event) const bool previous = m_smoothScrolling; m_smoothScrolling = true; - int numPixels; - if (!event->pixelDelta().isNull()) { - numPixels = event->pixelDelta().y(); - } else { - const int numDegrees = event->angleDelta().y() / 8; - const int numSteps = qApp->wheelScrollLines() * numDegrees / 15; - numPixels = numSteps * m_scrollBar->pageStep() / 12; - } - int value = m_scrollBar->value(); - if (event->modifiers().testFlag(Qt::ShiftModifier)) { - const int scrollingDirection = numPixels > 0 ? 1 : -1; - value -= m_scrollBar->pageStep() * scrollingDirection; - } else { - value -= numPixels; - } - m_scrollBar->setValue(value); - m_smoothScrolling = previous; + QWheelEvent copy = *event; + QApplication::sendEvent(m_scrollBar, ©); + event->setAccepted(copy.isAccepted()); - event->accept(); + m_smoothScrolling = previous; } diff --git a/src/kitemviews/private/kitemlistsmoothscroller.h b/src/kitemviews/private/kitemlistsmoothscroller.h index fca4b0c53..a3576a3fd 100644 --- a/src/kitemviews/private/kitemlistsmoothscroller.h +++ b/src/kitemviews/private/kitemlistsmoothscroller.h @@ -77,6 +77,11 @@ public: // stable. bool requestScrollBarUpdate(int newMaximum); + /** + * Forwards wheel events to the scrollbar, ensuring smooth and proper scrolling + */ + void handleWheelEvent(QWheelEvent* event); + protected: virtual bool eventFilter(QObject* obj, QEvent* event); @@ -84,13 +89,6 @@ private slots: void slotAnimationStateChanged(QAbstractAnimation::State newState, QAbstractAnimation::State oldState); -private: - /** - * Results into a smooth-scrolling of the target dependent on the direction - * of the wheel event. - */ - void handleWheelEvent(QWheelEvent* event); - private: bool m_scrollBarPressed; bool m_smoothScrolling; -- cgit v1.3.1 From 676cdcbbdbea031c1bec56230561bf8a0efcd0f6 Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Sat, 6 Aug 2016 13:03:48 +0200 Subject: Fix some low-hanging warning fruits --- src/kitemviews/kitemlistwidget.cpp | 4 ++-- src/kitemviews/private/kbaloorolesprovider.h | 2 +- src/panels/places/placesitemlistgroupheader.h | 2 +- src/panels/places/placespanel.h | 2 +- src/tests/kfileitemmodeltest.cpp | 2 +- src/views/dolphinview.cpp | 4 ---- src/views/tooltips/filemetadatatooltip.cpp | 4 +--- 7 files changed, 7 insertions(+), 13 deletions(-) (limited to 'src/kitemviews') diff --git a/src/kitemviews/kitemlistwidget.cpp b/src/kitemviews/kitemlistwidget.cpp index b834e951f..9c31155b3 100644 --- a/src/kitemviews/kitemlistwidget.cpp +++ b/src/kitemviews/kitemlistwidget.cpp @@ -516,10 +516,10 @@ void KItemListWidget::clearHoverCache() void KItemListWidget::drawItemStyleOption(QPainter* painter, QWidget* widget, QStyle::State styleState) { - QStyleOptionViewItemV4 viewItemOption; + QStyleOptionViewItem viewItemOption; viewItemOption.initFrom(widget); viewItemOption.state = styleState; - viewItemOption.viewItemPosition = QStyleOptionViewItemV4::OnlyOne; + viewItemOption.viewItemPosition = QStyleOptionViewItem::OnlyOne; viewItemOption.showDecorationSelected = true; viewItemOption.rect = selectionRect().toRect(); widget->style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &viewItemOption, painter, widget); diff --git a/src/kitemviews/private/kbaloorolesprovider.h b/src/kitemviews/private/kbaloorolesprovider.h index 9673bff4f..a9bd2e8ef 100644 --- a/src/kitemviews/private/kbaloorolesprovider.h +++ b/src/kitemviews/private/kbaloorolesprovider.h @@ -82,7 +82,7 @@ private: QSet m_roles; QHash m_roleForProperty; - friend class KBalooRolesProviderSingleton; + friend struct KBalooRolesProviderSingleton; }; #endif diff --git a/src/panels/places/placesitemlistgroupheader.h b/src/panels/places/placesitemlistgroupheader.h index 7daaba602..ec845e0ae 100644 --- a/src/panels/places/placesitemlistgroupheader.h +++ b/src/panels/places/placesitemlistgroupheader.h @@ -33,7 +33,7 @@ public: protected: virtual void paintSeparator(QPainter* painter, const QColor& color) Q_DECL_OVERRIDE; - virtual QPalette::ColorRole normalTextColorRole() const; + virtual QPalette::ColorRole normalTextColorRole() const Q_DECL_OVERRIDE; }; #endif diff --git a/src/panels/places/placespanel.h b/src/panels/places/placespanel.h index 81aeedb28..0c8b5f7f2 100644 --- a/src/panels/places/placespanel.h +++ b/src/panels/places/placespanel.h @@ -52,7 +52,7 @@ protected: virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE; public slots: - virtual void readSettings(); + virtual void readSettings() Q_DECL_OVERRIDE; private slots: void slotItemActivated(int index); diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp index eba32e1e1..6c45e114b 100644 --- a/src/tests/kfileitemmodeltest.cpp +++ b/src/tests/kfileitemmodeltest.cpp @@ -1674,7 +1674,7 @@ void KFileItemModelTest::testCollapseFolderWhileLoading() const KFileItem fileItemC1 = m_model->fileItem(2); KFileItem fileItemC2 = fileItemC1; QUrl urlC2 = fileItemC2.url(); - urlC2.adjusted(QUrl::RemoveFilename); + urlC2 = urlC2.adjusted(QUrl::RemoveFilename); urlC2.setPath(urlC2.path() + "c2.txt"); fileItemC2.setUrl(urlC2); diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 5466fd38e..a737dd0a6 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -75,10 +75,6 @@ #endif #include -namespace { - const int MaxModeEnum = DolphinView::CompactView; -} - DolphinView::DolphinView(const QUrl& url, QWidget* parent) : QWidget(parent), m_active(true), diff --git a/src/views/tooltips/filemetadatatooltip.cpp b/src/views/tooltips/filemetadatatooltip.cpp index 8fbca290d..0d58717d4 100644 --- a/src/views/tooltips/filemetadatatooltip.cpp +++ b/src/views/tooltips/filemetadatatooltip.cpp @@ -48,7 +48,7 @@ FileMetaDataToolTip::FileMetaDataToolTip(QWidget* parent) : m_fileMetaDataWidget(0) { setAttribute(Qt::WA_TranslucentBackground); - setWindowFlags(Qt::ToolTip | Qt::FramelessWindowHint); + setWindowFlags(Qt::ToolTip | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint); // Create widget for file preview m_preview = new QLabel(this); @@ -174,8 +174,6 @@ void FileMetaDataToolTip::paintEvent(QPaintEvent* event) void FileMetaDataToolTip::showEvent(QShowEvent *) { -#pragma message("TODO: port Plasma::WindowEffects::overrideShadow") - //Plasma::WindowEffects::overrideShadow(winId(), true); KWindowEffects::enableBlurBehind(winId(), true, mask()); } -- cgit v1.3.1 From 1710304e9ba926d2aec4226d00974b826f9bcbc0 Mon Sep 17 00:00:00 2001 From: arnav dhamija Date: Sun, 25 Sep 2016 19:46:22 +0530 Subject: Used KUrlMimeData::setUrls for kfileitemmodel's createMimeData for implementing the upcoming stash:/ ioslave --- src/kitemviews/kfileitemmodel.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/kitemviews') diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 1f94972c2..05f85a633 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -24,6 +24,8 @@ #include "dolphin_generalsettings.h" #include +#include + #include "dolphindebug.h" #include "private/kfileitemmodelsortalgorithm.h" @@ -265,7 +267,7 @@ QMimeData* KFileItemModel::createMimeData(const KItemSet& indexes) const lastAddedItem = itemData; const KFileItem& item = itemData->item; if (!item.isNull()) { - urls << item.targetUrl(); + urls << item.url(); bool isLocal; mostLocalUrls << item.mostLocalUrl(isLocal); @@ -275,13 +277,7 @@ QMimeData* KFileItemModel::createMimeData(const KItemSet& indexes) const } } - const bool different = canUseMostLocalUrls && mostLocalUrls != urls; - if (different) { - data->setUrls(mostLocalUrls); - } else { - data->setUrls(urls); - } - + KUrlMimeData::setUrls(urls, mostLocalUrls, data); return data; } @@ -2324,4 +2320,3 @@ bool KFileItemModel::isConsistent() const return true; } - -- cgit v1.3.1