┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information/informationpanel.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-07-05 22:54:37 +0000
committerPeter Penz <[email protected]>2009-07-05 22:54:37 +0000
commitdc29afa688cf809f4506075107036f62fd139d31 (patch)
treefc667679e7261df935f378c8cf220cbf7038d560 /src/panels/information/informationpanel.h
parentb4aacaf4d2a0f119176f491543261b62914d6be0 (diff)
The complexity of the class InformationPanel has grown a lot from KDE 4.0 to KDE 4.3. One main reason is that a lot of things are done now asynchronously with timers to prevent a blocking UI and unnecessary expensive operations.
To keep the Information Panel maintainable and prepared for future features a cleanup has been done. The whole user interface handling has been moved into the class InformationPanelContent that offers a straight forward interface: showItem(const KFileItem& item) and showItems(const KFileItemList& items). The class InformationPanel is responsible for calling those methods in a way that hovering items, changing directories, doing selections, rename and delete operations, ... don't result in calling showItem() 10 times per second. This cleanup won't be backported to KDE 4.3.x svn path=/trunk/KDE/kdebase/apps/; revision=991902
Diffstat (limited to 'src/panels/information/informationpanel.h')
-rw-r--r--src/panels/information/informationpanel.h100
1 files changed, 3 insertions, 97 deletions
diff --git a/src/panels/information/informationpanel.h b/src/panels/information/informationpanel.h
index 51642068b..b83db7f70 100644
--- a/src/panels/information/informationpanel.h
+++ b/src/panels/information/informationpanel.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006 by Peter Penz <[email protected]> *
+ * Copyright (C) 2006-2009 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 *
@@ -22,29 +22,7 @@
#include <panels/panel.h>
-#include <QPushButton>
-#include <QPixmap>
-#include <QEvent>
-#include <QLabel>
-#include <QList>
-
-#include <kconfig.h>
-#include <kurl.h>
-#include <kmimetype.h>
-#include <kdesktopfileactions.h>
-#include <kvbox.h>
-
-class InformationPanelDialog;
-class PhononWidget;
-class PixmapViewer;
-class MetaDataWidget;
-class MetaTextLabel;
-class QPixmap;
-class QString;
-class KFileItem;
-class KSeparator;
-class QLabel;
-class QScrollArea;
+class InformationPanelContent;
/**
* @brief Panel for showing meta information of one ore more selected items.
@@ -85,9 +63,6 @@ protected:
/** @see QWidget::resizeEvent() */
virtual void resizeEvent(QResizeEvent* event);
- /** @see QObject::eventFilter() */
- virtual bool eventFilter(QObject* obj, QEvent* event);
-
/** @see QWidget::contextMenuEvent() */
virtual void contextMenuEvent(QContextMenuEvent* event);
@@ -105,24 +80,6 @@ private slots:
void slotInfoTimeout();
/**
- * Marks the currently shown preview as outdated
- * by greying the content.
- */
- void markOutdatedPreview();
-
- /**
- * Is invoked if no preview is available for the item. In this
- * case the icon will be shown.
- */
- void showIcon(const KFileItem& item);
-
- /**
- * Is invoked if a preview is available for the item. The preview
- * \a pixmap is shown inside the info page.
- */
- void showPreview(const KFileItem& item, const QPixmap& pixmap);
-
- /**
* Resets the information panel to show the current
* URL (InformationPanel::url()). Is called by
* DolphinInformationPanel::markUrlAsInvalid().
@@ -136,18 +93,7 @@ private slots:
void slotEnteredDirectory(const QString& directory);
void slotLeftDirectory(const QString& directory);
- void slotPlayingStarted();
- void slotPlayingStopped();
-
private:
- /**
- * Checks whether the an URL is repesented by a place. If yes,
- * then the place icon and name are shown instead of a preview.
- * @return True, if the URL represents exactly a place.
- * @param url The url to check.
- */
- bool applyPlace(const KUrl& url);
-
/** Assures that any pending item information request is cancelled. */
void cancelRequest();
@@ -158,14 +104,6 @@ private:
void showMetaInfo();
/**
- * Updates the file item m_fileItem if necessary and returns
- * the file item which should be used to show the meta information.
- * The returned item is different from m_fileItem if a selection
- * is given.
- */
- KFileItem updateFileItem();
-
- /**
* Returns true, if the meta information should be shown for
* the multiple selected items that are stored in
* m_selection. If true is returned, it is assured that
@@ -181,14 +119,6 @@ private:
bool isEqualToShownUrl(const KUrl& url) const;
/**
- * Sets the text for the label \a m_nameLabel and assures that the
- * text is split in a way that it can be wrapped within the
- * label width (QLabel::setWordWrap() does not work if the
- * text represents one extremely long word).
- */
- void setNameLabelText(const QString& text);
-
- /**
* Marks the URL as invalid and will reset the Information Panel
* after a short delay. The reset is not done synchronously to
* prevent expensive updates during temporary invalid URLs by
@@ -196,28 +126,12 @@ private:
*/
void markUrlAsInvalid();
- /**
- * Assures that the settings for the meta information
- * are initialized with proper default values.
- */
- void initMetaInfoSettings(KConfigGroup& group);
-
- void updatePhononWidget();
-
- /**
- * Temporary helper method for KDE 4.3 as we currently don't get
- * translated labels for Nepmok literals: Replaces camelcase labels
- * like "fileLocation" by "File Location:".
- */
- QString tunedLabel(const QString& label) const;
-
void init();
private:
bool m_initialized;
bool m_pendingPreview;
QTimer* m_infoTimer;
- QTimer* m_outdatedPreviewTimer;
QTimer* m_urlChangedTimer;
QTimer* m_resetUrlTimer;
@@ -237,15 +151,7 @@ private:
KFileItem m_fileItem; // file item for m_shownUrl if available (otherwise null)
KFileItemList m_selection;
- QLabel* m_nameLabel;
- PixmapViewer* m_preview;
- KSeparator* m_previewSeparator;
- PhononWidget* m_phononWidget;
- MetaDataWidget* m_metaDataWidget;
- KSeparator* m_metaDataSeparator;
-
- QScrollArea* m_metaTextArea;
- MetaTextLabel* m_metaTextLabel;
+ InformationPanelContent* m_content;
};
#endif // INFORMATIONPANEL_H