diff options
Diffstat (limited to 'src/views')
| -rw-r--r-- | src/views/dolphinplacesmodel.cpp | 34 | ||||
| -rw-r--r-- | src/views/dolphinplacesmodel.h | 43 | ||||
| -rw-r--r-- | src/views/dolphinview.cpp | 1 | ||||
| -rw-r--r-- | src/views/dolphinviewactionhandler.cpp | 3 | ||||
| -rw-r--r-- | src/views/viewproperties.cpp | 4 |
5 files changed, 81 insertions, 4 deletions
diff --git a/src/views/dolphinplacesmodel.cpp b/src/views/dolphinplacesmodel.cpp new file mode 100644 index 000000000..4b8e6ea5e --- /dev/null +++ b/src/views/dolphinplacesmodel.cpp @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2011 by Peter Penz <[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 "dolphinplacesmodel.h" + +#include <KFilePlacesModel> + +KFilePlacesModel* DolphinPlacesModel::m_filePlacesModel = 0; + +KFilePlacesModel* DolphinPlacesModel::instance() +{ + return m_filePlacesModel; +} + +void DolphinPlacesModel::setModel(KFilePlacesModel* model) +{ + m_filePlacesModel = model; +} diff --git a/src/views/dolphinplacesmodel.h b/src/views/dolphinplacesmodel.h new file mode 100644 index 000000000..0f950cabe --- /dev/null +++ b/src/views/dolphinplacesmodel.h @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (C) 2011 by Peter Penz <[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 DOLPHIN_PLACES_MODEL_H +#define DOLPHIN_PLACES_MODEL_H + +#include <libdolphin_export.h> + +class KFilePlacesModel; + +/** + * @brief Allows global access to the places-model of Dolphin + * that is shown in the "Places" panel. + */ +class LIBDOLPHINPRIVATE_EXPORT DolphinPlacesModel +{ +public: + static KFilePlacesModel* instance(); + +private: + static void setModel(KFilePlacesModel* model); + static KFilePlacesModel* m_filePlacesModel; + + friend class DolphinMainWindow; // Sets the model with setModel() +}; + +#endif diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 6312d27cf..9bb1d03db 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -64,7 +64,6 @@ #include "dolphinitemlistcontainer.h" #include "draganddrophelper.h" #include "renamedialog.h" -#include "settings/dolphinsettings.h" #include "versioncontrol/versioncontrolobserver.h" #include "viewmodecontroller.h" #include "viewproperties.h" diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index f765b4a09..f88e01a45 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -314,6 +314,9 @@ QString DolphinViewActionHandler::currentViewModeActionName() const return "details"; case DolphinView::CompactView: return "compact"; + default: + Q_ASSERT(false); + break; } return QString(); // can't happen } diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index bb747139f..9f8b4d8ba 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -33,8 +33,6 @@ #include <QFile> #include <QFileInfo> -#include "settings/dolphinsettings.h" - namespace { // String representation to mark the additional properties of // the details view as customized by the user. See @@ -47,7 +45,7 @@ ViewProperties::ViewProperties(const KUrl& url) : m_autoSave(true), m_node(0) { - GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + GeneralSettings* settings = GeneralSettings::self(); const bool useGlobalViewProps = settings->globalViewProps(); bool useDetailsViewWithPath = false; |
