[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/stable/extragear/multimedia/amarok
From: Mark Kretschmann <markey () web ! de>
Date: 2007-06-02 7:46:23
Message-ID: 1180770383.349255.22624.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 670627 by markey:
Always uninstall scripts correctly. Thanks Sergio!
BUG: 143716
M +2 -0 ChangeLog
M +22 -7 src/scriptmanager.cpp
--- branches/stable/extragear/multimedia/amarok/ChangeLog #670626:670627
@@ -30,6 +30,8 @@
and one full star.
BUGFIXES:
+ * Uninstalling scripts would in some cases leave files behind. Patch by
+ Sergio Pistone <sergio_pistone@yahoo.com.ar>. (BR 143716)
* Last.fm "Custom Station" stream works again. (BR 146020)
* Fix regression where the "Show Script Manager" button displayed on the
Lyrics tab of the Context Browser wouldn't actually show the Script
--- branches/stable/extragear/multimedia/amarok/src/scriptmanager.cpp #670626:670627
@@ -518,21 +518,36 @@
if( m_scripts.find( name ) == m_scripts.end() )
return;
- const QString directory = m_scripts[name].url.directory();
+ KURL scriptDirURL( m_scripts[name].url.upURL() );
- // Delete directory recursively
- const KURL url = KURL::fromPathOrURL( directory );
- if( !KIO::NetAccess::del( url, 0 ) ) {
- KMessageBox::sorry( 0, i18n( "<p>Could not uninstall this script.</p><p>The \
ScriptManager can only uninstall scripts which have been installed as packages.</p>" \
) ); + // find if the script is installed in the global or local scripts directory
+ KURL scriptsDirURL;
+ QStringList dirs = KGlobal::dirs()->findDirs( "data", "amarok/scripts/" );
+ for ( QStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it ) {
+ scriptsDirURL = KURL::fromPathOrURL( *it );
+ if ( scriptsDirURL.isParentOf( scriptDirURL ) )
+ break;
+ }
+
+ // find the begining of this script directory tree
+ KURL scriptDirUpURL = scriptDirURL.upURL();
+ while ( ! scriptsDirURL.equals( scriptDirUpURL, true ) && \
scriptsDirURL.isParentOf( scriptDirUpURL ) ) { + scriptDirURL = \
scriptDirUpURL; + scriptDirUpURL = scriptDirURL.upURL();
+ }
+
+ // Delete script directory recursively
+ if( !KIO::NetAccess::del( scriptDirURL, 0 ) ) {
+ KMessageBox::sorry( 0, i18n( "<p>Could not uninstall this script.</p><p>The \
ScriptManager can only uninstall scripts which have been installed as packages.</p>" \
) ); // only true when not running as root (which is reasonable) return;
}
QStringList keys;
- // Find all scripts that were in the uninstalled folder
+ // Find all scripts that were in the uninstalled directory
{
foreachType( ScriptMap, m_scripts )
- if( it.data().url.directory() == directory )
+ if( scriptDirURL.isParentOf( it.data().url ) )
keys << it.key();
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic