From 3ed09d23f4287154d31885a3f5b249f2d95d21d7 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Sun, 25 Nov 2012 22:32:05 -0500 Subject: [PATCH] Hide /Volumes if we made it visible when closing the settings dialog --- src/SettingsDialog.cpp | 2 ++ src/libtomahawk/widgets/CheckDirTree.cpp | 14 ++++++++++++++ src/libtomahawk/widgets/CheckDirTree.h | 2 ++ 3 files changed, 18 insertions(+) diff --git a/src/SettingsDialog.cpp b/src/SettingsDialog.cpp index 1ed3381ad..31ae6ccec 100644 --- a/src/SettingsDialog.cpp +++ b/src/SettingsDialog.cpp @@ -278,6 +278,8 @@ SettingsDialog::saveSettings() if ( m_restartRequired ) QMessageBox::information( 0, tr( "Information" ), tr( "Some changed settings will not take effect until Tomahawk is restarted" ) ); + m_collectionWidgetUi->dirTree->cleanup(); + TomahawkUtils::NetworkProxyFactory* proxyFactory = TomahawkUtils::proxyFactory(); if ( !m_advancedWidgetUi->enableProxyCheckBox->isChecked() ) { diff --git a/src/libtomahawk/widgets/CheckDirTree.cpp b/src/libtomahawk/widgets/CheckDirTree.cpp index 9c7d878c6..5949bf3a4 100644 --- a/src/libtomahawk/widgets/CheckDirTree.cpp +++ b/src/libtomahawk/widgets/CheckDirTree.cpp @@ -44,6 +44,13 @@ CheckDirModel::CheckDirModel( QWidget* parent ) } CheckDirModel::~CheckDirModel() +{ + cleanup(); +} + + +void +CheckDirModel::cleanup() { #ifdef Q_OS_MAC // reset to previous state @@ -190,6 +197,13 @@ CheckDirTree::CheckDirTree( QWidget* parent ) } +void +CheckDirTree::cleanup() +{ + m_dirModel.cleanup(); +} + + void CheckDirTree::checkPath( const QString& path, Qt::CheckState state ) { diff --git a/src/libtomahawk/widgets/CheckDirTree.h b/src/libtomahawk/widgets/CheckDirTree.h index e8e71f994..d3b4ec9f0 100644 --- a/src/libtomahawk/widgets/CheckDirTree.h +++ b/src/libtomahawk/widgets/CheckDirTree.h @@ -40,6 +40,7 @@ public: void setCheck( const QModelIndex& index, const QVariant& value ); Qt::CheckState getCheck( const QModelIndex& index ); + void cleanup(); signals: void dataChangedByUser( const QModelIndex & index ); @@ -69,6 +70,7 @@ public: QStringList getExclusions(); QStringList getCheckedPaths(); + void cleanup(); signals: void changed();