|
|
|
@ -522,7 +522,7 @@ ScriptManager::slotUninstallScript()
|
|
|
|
|
|
|
|
|
|
// find if the script is installed in the global or local scripts directory
|
|
|
|
|
KURL scriptsDirURL;
|
|
|
|
|
TQStringList dirs = KGlobal::dirs()->findDirs( "data", "amarok/scripts/" );
|
|
|
|
|
TQStringList dirs = TDEGlobal::dirs()->findDirs( "data", "amarok/scripts/" );
|
|
|
|
|
for ( TQStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it ) {
|
|
|
|
|
scriptsDirURL = KURL::fromPathOrURL( *it );
|
|
|
|
|
if ( scriptsDirURL.isParentOf( scriptDirURL ) )
|
|
|
|
@ -588,16 +588,16 @@ ScriptManager::slotRunScript( bool silent )
|
|
|
|
|
if( m_scripts[name].process ) return false;
|
|
|
|
|
|
|
|
|
|
Amarok::ProcIO* script = new Amarok::ProcIO();
|
|
|
|
|
script->setComm( static_cast<KProcess::Communication>( KProcess::All ) );
|
|
|
|
|
script->setComm( static_cast<TDEProcess::Communication>( TDEProcess::All ) );
|
|
|
|
|
const KURL url = m_scripts[name].url;
|
|
|
|
|
*script << url.path();
|
|
|
|
|
script->setWorkingDirectory( Amarok::saveLocation( "scripts-data/" ) );
|
|
|
|
|
|
|
|
|
|
connect( script, TQT_SIGNAL( receivedStderr( KProcess*, char*, int ) ), TQT_SLOT( slotReceivedStderr( KProcess*, char*, int ) ) );
|
|
|
|
|
connect( script, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ), TQT_SLOT( slotReceivedStdout( KProcess*, char*, int ) ) );
|
|
|
|
|
connect( script, TQT_SIGNAL( processExited( KProcess* ) ), TQT_SLOT( scriptFinished( KProcess* ) ) );
|
|
|
|
|
connect( script, TQT_SIGNAL( receivedStderr( TDEProcess*, char*, int ) ), TQT_SLOT( slotReceivedStderr( TDEProcess*, char*, int ) ) );
|
|
|
|
|
connect( script, TQT_SIGNAL( receivedStdout( TDEProcess*, char*, int ) ), TQT_SLOT( slotReceivedStdout( TDEProcess*, char*, int ) ) );
|
|
|
|
|
connect( script, TQT_SIGNAL( processExited( TDEProcess* ) ), TQT_SLOT( scriptFinished( TDEProcess* ) ) );
|
|
|
|
|
|
|
|
|
|
if( script->start( KProcess::NotifyOnExit ) )
|
|
|
|
|
if( script->start( TDEProcess::NotifyOnExit ) )
|
|
|
|
|
{
|
|
|
|
|
if( m_scripts[name].type == "score" && !scoreScriptRunning().isNull() )
|
|
|
|
|
{
|
|
|
|
@ -716,7 +716,7 @@ ScriptManager::slotShowContextMenu( TQListViewItem* item, const TQPoint& pos )
|
|
|
|
|
switch( id )
|
|
|
|
|
{
|
|
|
|
|
case EDIT:
|
|
|
|
|
KRun::runCommand( "kwrite " + KProcess::quote(it.data().url.path()) );
|
|
|
|
|
KRun::runCommand( "kwrite " + TDEProcess::quote(it.data().url.path()) );
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SHOW_LOG:
|
|
|
|
@ -744,14 +744,14 @@ ScriptManager::slotShowContextMenu( TQListViewItem* item, const TQPoint& pos )
|
|
|
|
|
|
|
|
|
|
/* This is just a workaround, some scripts crash for some people if stdout is not handled. */
|
|
|
|
|
void
|
|
|
|
|
ScriptManager::slotReceivedStdout( KProcess*, char* buf, int len )
|
|
|
|
|
ScriptManager::slotReceivedStdout( TDEProcess*, char* buf, int len )
|
|
|
|
|
{
|
|
|
|
|
debug() << TQString::fromLatin1( buf, len ) << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ScriptManager::slotReceivedStderr( KProcess* process, char* buf, int len )
|
|
|
|
|
ScriptManager::slotReceivedStderr( TDEProcess* process, char* buf, int len )
|
|
|
|
|
{
|
|
|
|
|
// Look up script entry in our map
|
|
|
|
|
ScriptMap::Iterator it;
|
|
|
|
@ -769,7 +769,7 @@ ScriptManager::slotReceivedStderr( KProcess* process, char* buf, int len )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ScriptManager::scriptFinished( KProcess* process ) //SLOT
|
|
|
|
|
ScriptManager::scriptFinished( TDEProcess* process ) //SLOT
|
|
|
|
|
{
|
|
|
|
|
// Look up script entry in our map
|
|
|
|
|
ScriptMap::Iterator it;
|
|
|
|
|