diff options
| author | Dawit Alemayehu <[email protected]> | 2012-09-27 17:48:56 -0400 |
|---|---|---|
| committer | Dawit Alemayehu <[email protected]> | 2012-09-27 17:48:56 -0400 |
| commit | b7a8327c305e3d5bd92bb79889fafc2a75a82adb (patch) | |
| tree | f7c49868126002c9af3bffc044e4985c026405de /src/panels | |
| parent | 814611ca366f1abc6cbc31433511a3b619ea0e66 (diff) | |
| parent | 9b01d1bcc1ddeffd3f59cee73341ec440ef6f1e0 (diff) | |
Merge branch '4.9'
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/places/dolphin_placespanelsettings.kcfg | 14 | ||||
| -rw-r--r-- | src/panels/places/dolphin_placespanelsettings.kcfgc | 4 | ||||
| -rw-r--r-- | src/panels/places/placespanel.cpp | 4 | ||||
| -rw-r--r-- | src/panels/places/placesview.cpp | 35 | ||||
| -rw-r--r-- | src/panels/places/placesview.h | 38 |
5 files changed, 93 insertions, 2 deletions
diff --git a/src/panels/places/dolphin_placespanelsettings.kcfg b/src/panels/places/dolphin_placespanelsettings.kcfg new file mode 100644 index 000000000..b2ef8e574 --- /dev/null +++ b/src/panels/places/dolphin_placespanelsettings.kcfg @@ -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> diff --git a/src/panels/places/dolphin_placespanelsettings.kcfgc b/src/panels/places/dolphin_placespanelsettings.kcfgc new file mode 100644 index 000000000..65a77ec34 --- /dev/null +++ b/src/panels/places/dolphin_placespanelsettings.kcfgc @@ -0,0 +1,4 @@ +File=dolphin_placespanelsettings.kcfg +ClassName=PlacesPanelSettings +Singleton=true +Mutators=true diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index e483f9b83..3c7f2bb9b 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -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>()); diff --git a/src/panels/places/placesview.cpp b/src/panels/places/placesview.cpp new file mode 100644 index 000000000..dce5083d7 --- /dev/null +++ b/src/panels/places/placesview.cpp @@ -0,0 +1,35 @@ +/*************************************************************************** + * Copyright (C) 2012 by Frank Reininghaus <[email protected]> * + * * + * 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" diff --git a/src/panels/places/placesview.h b/src/panels/places/placesview.h new file mode 100644 index 000000000..87eb3a50b --- /dev/null +++ b/src/panels/places/placesview.h @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (C) 2012 by Frank Reininghaus <[email protected]> * + * * + * 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 |
