mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-17 15:31:20 +00:00
Merge branch '4.9'
This commit is contained in:
commit
b7a8327c30
|
@ -172,6 +172,7 @@ set(dolphin_SRCS
|
|||
panels/places/placesitemlistwidget.cpp
|
||||
panels/places/placesitemmodel.cpp
|
||||
panels/places/placesitemsignalhandler.cpp
|
||||
panels/places/placesview.cpp
|
||||
panels/panel.cpp
|
||||
panels/folders/foldersitemlistwidget.cpp
|
||||
panels/folders/treeviewcontextmenu.cpp
|
||||
|
@ -205,6 +206,7 @@ set(dolphin_SRCS
|
|||
kde4_add_kcfg_files(dolphin_SRCS
|
||||
panels/folders/dolphin_folderspanelsettings.kcfgc
|
||||
panels/information/dolphin_informationpanelsettings.kcfgc
|
||||
panels/places/dolphin_placespanelsettings.kcfgc
|
||||
settings/dolphin_compactmodesettings.kcfgc
|
||||
settings/dolphin_detailsmodesettings.kcfgc
|
||||
settings/dolphin_generalsettings.kcfgc
|
||||
|
|
|
@ -214,7 +214,7 @@ bool KFileItemModelRolesUpdater::enlargeSmallPreviews() const
|
|||
|
||||
void KFileItemModelRolesUpdater::setEnabledPlugins(const QStringList& list)
|
||||
{
|
||||
if (m_enabledPlugins == list) {
|
||||
if (m_enabledPlugins != list) {
|
||||
m_enabledPlugins = list;
|
||||
if (m_previewShown) {
|
||||
updateAllPreviews();
|
||||
|
@ -593,6 +593,13 @@ void KFileItemModelRolesUpdater::applyChangedNepomukRoles(const Nepomuk::Resourc
|
|||
#ifdef HAVE_NEPOMUK
|
||||
const KUrl itemUrl = m_nepomukUriItems.value(resource.resourceUri());
|
||||
const KFileItem item = m_model->fileItem(itemUrl);
|
||||
|
||||
if (item.isNull()) {
|
||||
// itemUrl is not in the model anymore, probably because
|
||||
// the corresponding file has been deleted in the meantime.
|
||||
return;
|
||||
}
|
||||
|
||||
QHash<QByteArray, QVariant> data = rolesData(item);
|
||||
|
||||
const KNepomukRolesProvider& rolesProvider = KNepomukRolesProvider::instance();
|
||||
|
|
|
@ -869,6 +869,8 @@ bool KItemListView::event(QEvent* event)
|
|||
event->accept();
|
||||
return true;
|
||||
}
|
||||
// Make sure events unconsumed events get propagated up the chain. #302329
|
||||
event->ignore();
|
||||
return QGraphicsWidget::event(event);
|
||||
}
|
||||
|
||||
|
|
14
src/panels/places/dolphin_placespanelsettings.kcfg
Normal file
14
src/panels/places/dolphin_placespanelsettings.kcfg
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
|
||||
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
|
||||
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
|
||||
<kcfgfile name="dolphinrc"/>
|
||||
<group name="PlacesPanel">
|
||||
<entry name="IconSize" type="Int">
|
||||
<label>Size of icons in the Places Panel (-1 means "use the style's small size")</label>
|
||||
<default>-1</default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
4
src/panels/places/dolphin_placespanelsettings.kcfgc
Normal file
4
src/panels/places/dolphin_placespanelsettings.kcfgc
Normal file
|
@ -0,0 +1,4 @@
|
|||
File=dolphin_placespanelsettings.kcfg
|
||||
ClassName=PlacesPanelSettings
|
||||
Singleton=true
|
||||
Mutators=true
|
|
@ -35,7 +35,6 @@
|
|||
#include <kitemviews/kitemlistcontroller.h>
|
||||
#include <kitemviews/kitemlistselectionmanager.h>
|
||||
#include <kitemviews/kstandarditem.h>
|
||||
#include <kitemviews/kstandarditemlistview.h>
|
||||
#include <KMenu>
|
||||
#include <KMessageBox>
|
||||
#include <KNotification>
|
||||
|
@ -44,6 +43,7 @@
|
|||
#include "placesitemlistgroupheader.h"
|
||||
#include "placesitemlistwidget.h"
|
||||
#include "placesitemmodel.h"
|
||||
#include "placesview.h"
|
||||
#include <views/draganddrophelper.h>
|
||||
#include <QGraphicsSceneDragDropEvent>
|
||||
#include <QVBoxLayout>
|
||||
|
@ -104,7 +104,7 @@ void PlacesPanel::showEvent(QShowEvent* event)
|
|||
connect(m_model, SIGNAL(errorMessage(QString)),
|
||||
this, SIGNAL(errorMessage(QString)));
|
||||
|
||||
KStandardItemListView* view = new KStandardItemListView();
|
||||
PlacesView* view = new PlacesView();
|
||||
view->setWidgetCreator(new KItemListWidgetCreator<PlacesItemListWidget>());
|
||||
view->setGroupHeaderCreator(new KItemListGroupHeaderCreator<PlacesItemListGroupHeader>());
|
||||
|
||||
|
|
35
src/panels/places/placesview.cpp
Normal file
35
src/panels/places/placesview.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
/***************************************************************************
|
||||
* Copyright (C) 2012 by Frank Reininghaus <frank78ac@googlemail.com> *
|
||||
* *
|
||||
* 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 "placesview.h"
|
||||
|
||||
#include "dolphin_placespanelsettings.h"
|
||||
|
||||
PlacesView::PlacesView(QGraphicsWidget* parent) :
|
||||
KStandardItemListView(parent)
|
||||
{
|
||||
const int iconSize = PlacesPanelSettings::iconSize();
|
||||
if (iconSize >= 0) {
|
||||
KItemListStyleOption option = styleOption();
|
||||
option.iconSize = iconSize;
|
||||
setStyleOption(option);
|
||||
}
|
||||
}
|
||||
|
||||
#include "placesview.moc"
|
38
src/panels/places/placesview.h
Normal file
38
src/panels/places/placesview.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/***************************************************************************
|
||||
* Copyright (C) 2012 by Frank Reininghaus <frank78ac@googlemail.com> *
|
||||
* *
|
||||
* 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 PLACESVIEW_H
|
||||
#define PLACESVIEW_H
|
||||
|
||||
#include <kitemviews/kstandarditemlistview.h>
|
||||
|
||||
/**
|
||||
* @brief View class for the Places Panel.
|
||||
*
|
||||
* Reads the icon size from GeneralSettings::placesPanelIconSize().
|
||||
*/
|
||||
class PlacesView : public KStandardItemListView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PlacesView(QGraphicsWidget* parent = 0);
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue