class DOLPHIN_EXPORT ViewProperties
{
public:
- explicit ViewProperties(const QUrl& url);
+ explicit ViewProperties(const QUrl &url);
virtual ~ViewProperties();
void setViewMode(DolphinView::Mode mode);
void setGroupedSorting(bool grouped);
bool groupedSorting() const;
- void setSortRole(const QByteArray& role);
+ void setSortRole(const QByteArray &role);
QByteArray sortRole() const;
void setSortOrder(Qt::SortOrder sortOrder);
Qt::SortOrder sortOrder() const;
+ void setGroupRole(const QByteArray &role);
+ QByteArray groupRole() const;
+
+ void setGroupOrder(Qt::SortOrder groupOrder);
+ Qt::SortOrder groupOrder() const;
+
void setSortFoldersFirst(bool foldersFirst);
bool sortFoldersFirst() const;
+ void setSortHiddenLast(bool hiddenLast);
+ bool sortHiddenLast() const;
+
+ void setDynamicViewPassed(bool dynamicViewPassed);
+ bool dynamicViewPassed() const;
+
/**
* Sets 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).
*/
- void setVisibleRoles(const QList<QByteArray>& info);
+ void setVisibleRoles(const QList<QByteArray> &info);
/**
* Returns the additional information for the current set view-mode.
*/
QList<QByteArray> visibleRoles() const;
- void setHeaderColumnWidths(const QList<int>& widths);
+ void setHeaderColumnWidths(const QList<int> &widths);
QList<int> headerColumnWidths() const;
/**
* show hidden files, sorting and sort order like
* set in \a props.
*/
- void setDirProperties(const ViewProperties& props);
+ void setDirProperties(const ViewProperties &props);
/**
* If \a autoSave is true, the properties are automatically
*/
void save();
- /**
- * @return True if properties for the given URL exist:
- * As soon as the properties for an URL have been saved with
- * ViewProperties::save(), true will be returned. If false is
- * returned, the default view-properties are used.
- */
- bool exist() const;
-
-private:
/**
* Returns the destination directory path where the view
* properties are stored. \a subDir specifies the used sub
* directory.
*/
- QString destinationDir(const QString& subDir) const;
+ QString destinationDir(const QString &subDir) const;
+private:
/**
* Returns the view-mode prefix when storing additional properties for
* a view-mode.
/**
* Returns true, if \a filePath is part of the home-path (see QDir::homePath()).
*/
- static bool isPartOfHome(const QString& filePath);
+ static bool isPartOfHome(const QString &filePath);
/**
* @return A hash-value for an URL that can be used as directory name.
*/
static QString directoryHashForUrl(const QUrl &url);
+ /** @returns a ViewPropertySettings object with properties loaded for the directory at @param filePath. Ownership is returned to the caller. */
+ ViewPropertySettings *loadProperties(const QString &folderPath) const;
+ /** @returns a ViewPropertySettings object with the globally configured default values. Ownership is returned to the caller. */
+ ViewPropertySettings *defaultProperties() const;
+
Q_DISABLE_COPY(ViewProperties)
private:
bool m_changedProps;
bool m_autoSave;
QString m_filePath;
- ViewPropertySettings* m_node;
+ ViewPropertySettings *m_node;
};
#endif