diff options
author | Arno <am@disconnect.de> | 2010-12-27 15:52:30 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2010-12-27 15:52:30 +0100 |
commit | 51f830068cb6b4847468aced1aa654932c39bf80 (patch) | |
tree | 0eff6453050a77999577310746e24f6182493cf3 /filesystemwidget.cpp | |
parent | 7bb7295a9033c0a6729b301e7c9b76393539e29a (diff) | |
download | SheMov-51f830068cb6b4847468aced1aa654932c39bf80.tar.gz SheMov-51f830068cb6b4847468aced1aa654932c39bf80.tar.bz2 SheMov-51f830068cb6b4847468aced1aa654932c39bf80.zip |
Made all icons in qresource available for UI
Every registered icon can be chosen as Qt::DecorationRole for all models
at once. Suitable icons must be added to SmGlobals::mIcons. Key is a
descriptive text, value is the icon path.
To make things easier SmTreeModel got two new member functions:
-QIcon decorationIcon() returning the current Icon
-void setDecorationIcon() to set the current Icon
The current Icon is initialized in the constructor from QSettings -
ui/iconfolder
To update the TreeViews connected to the FileSystemModel a little hack
is needed: Just set the QFileIconProvider again. This causes the Model
to update connected views.
Diffstat (limited to 'filesystemwidget.cpp')
-rw-r--r-- | filesystemwidget.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/filesystemwidget.cpp b/filesystemwidget.cpp index 876d27d..f4a9d24 100644 --- a/filesystemwidget.cpp +++ b/filesystemwidget.cpp @@ -43,8 +43,8 @@ FilesystemWidget::FilesystemWidget(QWidget *parent) : QWidget(parent), mClipboar mModel->setRootPath("/"); mModel->setFilter(QDir::AllEntries | QDir::NoDot); mModel->setReadOnly(false); - SheMovIconProvider *p = new SheMovIconProvider; - mModel->setIconProvider(p); + mIconProvider = new SheMovIconProvider; + mModel->setIconProvider(mIconProvider); mDirProxy = new FilesystemDirProxy; mDirProxy->setSourceModel(mModel); @@ -393,6 +393,10 @@ void FilesystemWidget::writeSettings(){ s.setValue("windows/picviewer", mPicViewer->pos()); } +void FilesystemWidget::configChanged(){ + mModel->setIconProvider(mIconProvider); +} + void FilesystemWidget::dvdMount(){ QSettings s; QString mountDir = s.value("paths/dvdmount").toString(); |