From c05395ef9a6f449bd96b4323d308b53d70cede99 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 29 Aug 2009 09:42:21 +0000 Subject: Move code for initializing and handling view extensions to the new class ViewExtensionsFactory. Beside making DolphinView less complex this will allow the column view to share the view extension code instead of (partly) duplicating it as it has been done before. Currently only the tooltips- and filepreview-handling have been moved into ViewExtensionsFactory, a further cleanup will be done later. svn path=/trunk/KDE/kdebase/apps/; revision=1016893 --- src/viewextensionsfactory.h | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/viewextensionsfactory.h (limited to 'src/viewextensionsfactory.h') diff --git a/src/viewextensionsfactory.h b/src/viewextensionsfactory.h new file mode 100644 index 000000000..dd819249b --- /dev/null +++ b/src/viewextensionsfactory.h @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (C) 2009 by Peter Penz * + * * + * 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 VIEWEXTENSIONSFACTORY_H +#define VIEWEXTENSIONSFACTORY_H + +#include + +class DolphinController; +class KFilePreviewGenerator; +class ToolTipManager; +class QAbstractItemView; + +class ViewExtensionsFactory : public QObject +{ + Q_OBJECT + + public: + explicit ViewExtensionsFactory(QAbstractItemView* view, + DolphinController* controller); + virtual ~ViewExtensionsFactory(); + + private slots: + /** + * Tells the preview generator to update all icons. + */ + void updateIcons(); + + /** + * Tells the preview generator to cancel all pending previews. + */ + void cancelPreviews(); + + void slotShowPreviewChanged(); + + private: + DolphinController* m_controller; + ToolTipManager* m_toolTipManager; + KFilePreviewGenerator* m_previewGenerator; +}; + +#endif + -- cgit v1.3