1
/***************************************************************************
2
* Copyright (C) 2004-2007 by Mark Kretschmann <kretschmann@kde.org> *
3
* 2005-2007 by Seb Ruiz <ruiz@kde.org> *
4
* 2006 by Alexandre Oliveira <aleprj@gmail.com> *
5
* 2006 by Martin Ellis <martin.ellis@kdemail.net> *
6
* 2007 by Leonardo Franchi <lfranchi@gmail.com> *
7
* 2008 by Peter ZHOU <peterzhoulei@gmail.com> *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
14
* This program is distributed in the hope that it will be useful, *
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17
* GNU General Public License for more details. *
19
* You should have received a copy of the GNU General Public License *
20
* along with this program; if not, write to the *
21
* Free Software Foundation, Inc., *
22
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
23
***************************************************************************/
1
/****************************************************************************************
2
* Copyright (c) 2004-2007 Mark Kretschmann <kretschmann@kde.org> *
3
* Copyright (c) 2005-2007 Seb Ruiz <ruiz@kde.org> *
4
* Copyright (c) 2006 Alexandre Pereira de Oliveira <aleprj@gmail.com> *
5
* Copyright (c) 2006 Martin Ellis <martin.ellis@kdemail.net> *
6
* Copyright (c) 2007 Leo Franchi <lfranchi@gmail.com> *
7
* Copyright (c) 2008 Peter ZHOU <peterzhoulei@gmail.com> *
9
* This program is free software; you can redistribute it and/or modify it under *
10
* the terms of the GNU General Public License as published by the Free Software *
11
* Foundation; either version 2 of the License, or (at your option) any later *
14
* This program is distributed in the hope that it will be useful, but WITHOUT ANY *
15
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
16
* PARTICULAR PURPOSE. See the GNU General Public License for more details. *
18
* You should have received a copy of the GNU General Public License along with *
19
* this program. If not, see <http://www.gnu.org/licenses/>. *
20
****************************************************************************************/
25
22
#define DEBUG_PREFIX "ScriptManager"
72
69
#include <sys/stat.h>
73
70
#include <sys/types.h>
78
proxyForUrl(const QString& url)
84
if ( KProtocolManager::proxyForUrl( kurl ) !=
85
QString::fromLatin1( "DIRECT" ) ) {
86
KProtocolManager::slaveProtocol ( kurl, proxy );
93
proxyForProtocol(const QString& protocol)
95
return KProtocolManager::proxyFor( protocol );
99
72
////////////////////////////////////////////////////////////////////////////////
100
73
// class ScriptManager
101
74
////////////////////////////////////////////////////////////////////////////////
634
604
scriptObject = scriptEngine->newQObject( objectPtr );
635
605
m_global.setProperty( "Script", scriptObject );
636
606
m_scripts[name].wrapperList.append( objectPtr );
638
608
objectPtr = new InfoScript( m_scripts[name].url );
639
609
QScriptValue infoContext = scriptEngine->newQObject( objectPtr );
640
610
m_global.setProperty( "Info", infoContext );
657
627
scriptObject = scriptEngine->newQObject( objectPtr );
658
628
m_global.setProperty( "Lyrics", scriptObject );
659
629
m_scripts[name].wrapperList.append( objectPtr );
661
631
objectPtr = new AmarokScript::AmarokServicePluginManagerScript( scriptEngine );
662
632
scriptObject = scriptEngine->newQObject( objectPtr );
663
633
m_global.setProperty( "ServicePluginManager", scriptObject );