/***************************************************************************
- * Copyright (C) 2006-2010 by Peter Penz <peter.penz@gmx.at> *
+ * Copyright (C) 2006-2010 by Peter Penz <peter.penz19@gmail.com> *
* Copyright (C) 2006 by Aaron J. Seigo <aseigo@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
#define VIEWPROPERTIES_H
#include <views/dolphinview.h>
-#include <kurl.h>
+#include <KUrl>
#include <libdolphin_export.h>
class ViewPropertySettings;
* \code
* ViewProperties props(KUrl("/home/peter/Documents"));
* const DolphinView::Mode mode = props.viewMode();
- * const bool showHiddenFiles = props.isShowHiddenFilesEnabled();
+ * const bool hiddenFilesShown = props.hiddenFilesShown();
* \endcode
*
* When modifying a view property, the '.directory' file is automatically updated
void setViewMode(DolphinView::Mode mode);
DolphinView::Mode viewMode() const;
- void setShowPreview(bool show);
- bool showPreview() const;
+ void setPreviewsShown(bool show);
+ bool previewsShown() const;
- void setShowHiddenFiles(bool show);
- bool showHiddenFiles() const;
+ void setHiddenFilesShown(bool show);
+ bool hiddenFilesShown() const;
- void setCategorizedSorting(bool categorized);
- bool categorizedSorting() const;
+ void setGroupedSorting(bool grouped);
+ bool groupedSorting() const;
- void setSorting(DolphinView::Sorting sorting);
- DolphinView::Sorting sorting() const;
+ void setSortRole(const QByteArray& role);
+ QByteArray sortRole() const;
void setSortOrder(Qt::SortOrder sortOrder);
Qt::SortOrder sortOrder() const;
* Note that the additional-info property is the only property where
* the value is dependent from another property (in this case the view-mode).
*/
- void setAdditionalInfo(const KFileItemDelegate::InformationList& info);
+ void setVisibleRoles(const QList<QByteArray>& info);
/**
* Returns the additional information for the current set view-mode.
* Note that the additional-info property is the only property where
* the value is dependent from another property (in this case the view-mode).
*/
- KFileItemDelegate::InformationList additionalInfo() const;
+ QList<QByteArray> visibleRoles() const;
/**
* Sets the directory properties view mode, show preview,
*/
QString destinationDir(const QString& subDir) const;
- /**
- * Helper method for ViewProperties::additionalInfo(): Returns
- * the additional info for the outdated version 1 of the view-properties.
- */
- KFileItemDelegate::InformationList additionalInfoV1() const;
-
- /**
- * Helper method for ViewProperties::additionalInfo(): Returns
- * the additional info for the current version 2 of the view-properties.
- */
- KFileItemDelegate::InformationList additionalInfoV2() const;
-
/**
* Returns the view-mode prefix when storing additional properties for
* a view-mode.
*/
QString viewModePrefix() const;
+ /**
+ * Returns true, if \a filePath is part of the home-path (see QDir::homePath()).
+ */
+ static bool isPartOfHome(const QString& filePath);
+
Q_DISABLE_COPY(ViewProperties)
private: