diff options
| author | Peter Penz <[email protected]> | 2009-01-14 20:14:36 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2009-01-14 20:14:36 +0000 |
| commit | f37ecd6ecfab9bc1d2929504b4f6e4363f8137b9 (patch) | |
| tree | 22489a861bec9c228b87a8c714b8850ec05b3aa0 /src/panels/information | |
| parent | 307285e9635a4bf584d6e5d7478876b90ef870f0 (diff) | |
Cleanup panel related class names: The terms "sidebar"/"sidebarpage" are relicts from the KDE 3 version of Dolphin and are called "Panels" in the KDE 4 version of Dolphin. Yes, renaming classes may take more than 1 year ;-)
svn path=/trunk/KDE/kdebase/apps/; revision=911089
Diffstat (limited to 'src/panels/information')
| -rw-r--r-- | src/panels/information/informationpanel.cpp (renamed from src/panels/information/infosidebarpage.cpp) | 74 | ||||
| -rw-r--r-- | src/panels/information/informationpanel.h (renamed from src/panels/information/infosidebarpage.h) | 30 |
2 files changed, 52 insertions, 52 deletions
diff --git a/src/panels/information/infosidebarpage.cpp b/src/panels/information/informationpanel.cpp index 9eb35bc8d..a77a39908 100644 --- a/src/panels/information/infosidebarpage.cpp +++ b/src/panels/information/informationpanel.cpp @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ -#include "infosidebarpage.h" +#include "informationpanel.h" #include <config-nepomuk.h> @@ -50,8 +50,8 @@ #include "metatextlabel.h" #include "pixmapviewer.h" -InfoSidebarPage::InfoSidebarPage(QWidget* parent) : - SidebarPage(parent), +InformationPanel::InformationPanel(QWidget* parent) : + Panel(parent), m_initialized(false), m_pendingPreview(false), m_infoTimer(0), @@ -67,20 +67,20 @@ InfoSidebarPage::InfoSidebarPage(QWidget* parent) : { } -InfoSidebarPage::~InfoSidebarPage() +InformationPanel::~InformationPanel() { } -QSize InfoSidebarPage::sizeHint() const +QSize InformationPanel::sizeHint() const { - QSize size = SidebarPage::sizeHint(); + QSize size = Panel::sizeHint(); size.setWidth(minimumSizeHint().width()); return size; } -void InfoSidebarPage::setUrl(const KUrl& url) +void InformationPanel::setUrl(const KUrl& url) { - SidebarPage::setUrl(url); + Panel::setUrl(url); if (url.isValid() && !isEqualToShownUrl(url)) { if (isVisible()) { cancelRequest(); @@ -92,7 +92,7 @@ void InfoSidebarPage::setUrl(const KUrl& url) } } -void InfoSidebarPage::setSelection(const KFileItemList& selection) +void InformationPanel::setSelection(const KFileItemList& selection) { if (!isVisible()) { return; @@ -122,7 +122,7 @@ void InfoSidebarPage::setSelection(const KFileItemList& selection) } } -void InfoSidebarPage::requestDelayedItemInfo(const KFileItem& item) +void InformationPanel::requestDelayedItemInfo(const KFileItem& item) { if (!isVisible()) { return; @@ -148,9 +148,9 @@ void InfoSidebarPage::requestDelayedItemInfo(const KFileItem& item) } } -void InfoSidebarPage::showEvent(QShowEvent* event) +void InformationPanel::showEvent(QShowEvent* event) { - SidebarPage::showEvent(event); + Panel::showEvent(event); if (!event->spontaneous()) { if (!m_initialized) { // do a delayed initialization so that no performance @@ -162,14 +162,14 @@ void InfoSidebarPage::showEvent(QShowEvent* event) } } -void InfoSidebarPage::resizeEvent(QResizeEvent* event) +void InformationPanel::resizeEvent(QResizeEvent* event) { if (isVisible()) { // If the text inside the name label or the info label cannot // get wrapped, then the maximum width of the label is increased - // so that the width of the information sidebar gets increased. + // so that the width of the information panel gets increased. // To prevent this, the maximum width is adjusted to - // the current width of the sidebar. + // the current width of the panel. const int maxWidth = event->size().width() - KDialog::spacingHint() * 4; m_nameLabel->setMaximumWidth(maxWidth); @@ -179,10 +179,10 @@ void InfoSidebarPage::resizeEvent(QResizeEvent* event) m_infoTimer->start(); } - SidebarPage::resizeEvent(event); + Panel::resizeEvent(event); } -void InfoSidebarPage::showItemInfo() +void InformationPanel::showItemInfo() { if (!isVisible()) { return; @@ -230,13 +230,13 @@ void InfoSidebarPage::showItemInfo() showMetaInfo(); } -void InfoSidebarPage::slotInfoTimeout() +void InformationPanel::slotInfoTimeout() { m_shownUrl = m_urlCandidate; showItemInfo(); } -void InfoSidebarPage::markOutdatedPreview() +void InformationPanel::markOutdatedPreview() { KIconEffect iconEffect; QPixmap disabledPixmap = iconEffect.apply(m_preview->pixmap(), @@ -245,7 +245,7 @@ void InfoSidebarPage::markOutdatedPreview() m_preview->setPixmap(disabledPixmap); } -void InfoSidebarPage::showIcon(const KFileItem& item) +void InformationPanel::showIcon(const KFileItem& item) { m_outdatedPreviewTimer->stop(); m_pendingPreview = false; @@ -254,7 +254,7 @@ void InfoSidebarPage::showIcon(const KFileItem& item) } } -void InfoSidebarPage::showPreview(const KFileItem& item, +void InformationPanel::showPreview(const KFileItem& item, const QPixmap& pixmap) { m_outdatedPreviewTimer->stop(); @@ -266,7 +266,7 @@ void InfoSidebarPage::showPreview(const KFileItem& item, } } -void InfoSidebarPage::slotFileRenamed(const QString& source, const QString& dest) +void InformationPanel::slotFileRenamed(const QString& source, const QString& dest) { if (m_shownUrl == KUrl(source)) { // the currently shown file has been renamed, hence update the item information @@ -276,7 +276,7 @@ void InfoSidebarPage::slotFileRenamed(const QString& source, const QString& dest } } -void InfoSidebarPage::slotFilesAdded(const QString& directory) +void InformationPanel::slotFilesAdded(const QString& directory) { if (m_shownUrl == KUrl(directory)) { // If the 'trash' icon changes because the trash has been emptied or got filled, @@ -286,7 +286,7 @@ void InfoSidebarPage::slotFilesAdded(const QString& directory) } } -void InfoSidebarPage::slotFilesChanged(const QStringList& files) +void InformationPanel::slotFilesChanged(const QStringList& files) { foreach (const QString& fileName, files) { if (m_shownUrl == KUrl(fileName)) { @@ -296,7 +296,7 @@ void InfoSidebarPage::slotFilesChanged(const QStringList& files) } } -void InfoSidebarPage::slotFilesRemoved(const QStringList& files) +void InformationPanel::slotFilesRemoved(const QStringList& files) { foreach (const QString& fileName, files) { if (m_shownUrl == KUrl(fileName)) { @@ -309,7 +309,7 @@ void InfoSidebarPage::slotFilesRemoved(const QStringList& files) } } -void InfoSidebarPage::slotEnteredDirectory(const QString& directory) +void InformationPanel::slotEnteredDirectory(const QString& directory) { if (m_shownUrl == KUrl(directory)) { KFileItem item(KFileItem::Unknown, KFileItem::Unknown, KUrl(directory)); @@ -317,7 +317,7 @@ void InfoSidebarPage::slotEnteredDirectory(const QString& directory) } } -void InfoSidebarPage::slotLeftDirectory(const QString& directory) +void InformationPanel::slotLeftDirectory(const QString& directory) { if (m_shownUrl == KUrl(directory)) { // The signal 'leftDirectory' is also emitted when a media @@ -329,7 +329,7 @@ void InfoSidebarPage::slotLeftDirectory(const QString& directory) } } -bool InfoSidebarPage::applyPlace(const KUrl& url) +bool InformationPanel::applyPlace(const KUrl& url) { KFilePlacesModel* placesModel = DolphinSettings::instance().placesModel(); int count = placesModel->rowCount(); @@ -347,12 +347,12 @@ bool InfoSidebarPage::applyPlace(const KUrl& url) return false; } -void InfoSidebarPage::cancelRequest() +void InformationPanel::cancelRequest() { m_infoTimer->stop(); } -void InfoSidebarPage::showMetaInfo() +void InformationPanel::showMetaInfo() { m_metaTextLabel->clear(); @@ -416,7 +416,7 @@ void InfoSidebarPage::showMetaInfo() } } -bool InfoSidebarPage::convertMetaInfo(const QString& key, QString& text) const +bool InformationPanel::convertMetaInfo(const QString& key, QString& text) const { struct MetaKey { const char* key; @@ -455,7 +455,7 @@ bool InfoSidebarPage::convertMetaInfo(const QString& key, QString& text) const return false; } -KFileItem InfoSidebarPage::fileItem() const +KFileItem InformationPanel::fileItem() const { if (!m_fileItem.isNull()) { return m_fileItem; @@ -473,17 +473,17 @@ KFileItem InfoSidebarPage::fileItem() const return item; } -bool InfoSidebarPage::showMultipleSelectionInfo() const +bool InformationPanel::showMultipleSelectionInfo() const { return m_fileItem.isNull() && (m_selection.count() > 1); } -bool InfoSidebarPage::isEqualToShownUrl(const KUrl& url) const +bool InformationPanel::isEqualToShownUrl(const KUrl& url) const { return m_shownUrl.equals(url, KUrl::CompareWithoutTrailingSlash); } -void InfoSidebarPage::setNameLabelText(const QString& text) +void InformationPanel::setNameLabelText(const QString& text) { QTextOption textOption; textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); @@ -512,7 +512,7 @@ void InfoSidebarPage::setNameLabelText(const QString& text) m_nameLabel->setText(wrappedText); } -void InfoSidebarPage::init() +void InformationPanel::init() { const int spacing = KDialog::spacingHint(); @@ -584,4 +584,4 @@ void InfoSidebarPage::init() m_initialized = true; } -#include "infosidebarpage.moc" +#include "informationpanel.moc" diff --git a/src/panels/information/infosidebarpage.h b/src/panels/information/informationpanel.h index 879a245ad..527148ae8 100644 --- a/src/panels/information/infosidebarpage.h +++ b/src/panels/information/informationpanel.h @@ -17,10 +17,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ -#ifndef INFOSIDEBARPAGE_H -#define INFOSIDEBARPAGE_H +#ifndef INFORMATIONPANEL_H +#define INFORMATIONPANEL_H -#include <panels/sidebarpage.h> +#include <panels/panel.h> #include <QtGui/QPushButton> #include <QtGui/QPixmap> @@ -42,32 +42,32 @@ class MetaDataWidget; class MetaTextLabel; /** - * @brief Sidebar for showing meta information of one ore more selected items. + * @brief Panel for showing meta information of one ore more selected items. */ -class InfoSidebarPage : public SidebarPage +class InformationPanel : public Panel { Q_OBJECT public: - explicit InfoSidebarPage(QWidget* parent = 0); - virtual ~InfoSidebarPage(); + explicit InformationPanel(QWidget* parent = 0); + virtual ~InformationPanel(); /** @see QWidget::sizeHint() */ virtual QSize sizeHint() const; public slots: - /** @see SidebarPage::setUrl() */ + /** @see Panel::setUrl() */ virtual void setUrl(const KUrl& url); /** - * This is invoked to inform the sidebar that the user has selected a new + * This is invoked to inform the panel that the user has selected a new * set of items. */ void setSelection(const KFileItemList& selection); /** * Does a delayed request of information for the item \a item. - * If within this delay InfoSidebarPage::setUrl() or InfoSidebarPage::setSelection() + * If within this delay InformationPanel::setUrl() or InformationPanel::setSelection() * are invoked, then the request will be skipped. Requesting a delayed item information * makes sense when hovering items. */ @@ -83,13 +83,13 @@ protected: private slots: /** * Shows the information for the item of the URL which has been provided by - * InfoSidebarPage::requestItemInfo() and provides default actions. + * InformationPanel::requestItemInfo() and provides default actions. */ void showItemInfo(); /** * Triggered if the request for item information has timed out. - * @see InfoSidebarPage::requestDelayedItemInfo() + * @see InformationPanel::requestDelayedItemInfo() */ void slotInfoTimeout(); @@ -145,7 +145,7 @@ private: /** * Returns the item for file where the preview and meta information - * should be received, if InfoSidebarPage::showMultipleSelectionInfo() + * should be received, if InformationPanel::showMultipleSelectionInfo() * returns false. */ KFileItem fileItem() const; @@ -156,7 +156,7 @@ private: * m_selection. If true is returned, it is assured that * m_selection.count() > 1. If false is returned, the meta * information should be shown for the file - * InfosidebarPage::fileUrl(); + * InformationPanel::fileUrl(); */ bool showMultipleSelectionInfo() const; @@ -191,4 +191,4 @@ private: MetaTextLabel* m_metaTextLabel; }; -#endif // INFOSIDEBARPAGE_H +#endif // INFORMATIONPANEL_H |
