mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 08:04:25 +02:00
Fixes for style.
This commit is contained in:
@@ -20,11 +20,12 @@
|
|||||||
#import <ScriptingBridge/ScriptingBridge.h>
|
#import <ScriptingBridge/ScriptingBridge.h>
|
||||||
#import "adium.h"
|
#import "adium.h"
|
||||||
|
|
||||||
void script( const char* status )
|
void
|
||||||
|
script( const char* status )
|
||||||
{
|
{
|
||||||
NSString *stat = [NSString stringWithUTF8String:status];
|
NSString *stat = [NSString stringWithUTF8String:status];
|
||||||
NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:stat];
|
NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:stat];
|
||||||
NSDictionary *errorDictionary;
|
NSDictionary *errorDictionary;
|
||||||
NSAppleEventDescriptor *eventDescriptor = [appleScript executeAndReturnError:&errorDictionary];
|
NSAppleEventDescriptor *eventDescriptor = [appleScript executeAndReturnError:&errorDictionary];
|
||||||
[appleScript release];
|
[appleScript release];
|
||||||
}
|
}
|
||||||
|
@@ -28,13 +28,12 @@
|
|||||||
|
|
||||||
static void setStatus(const QString &status)
|
static void setStatus(const QString &status)
|
||||||
{
|
{
|
||||||
QString adiumStatus = "tell application \"Adium\"\n";
|
QString adiumStatus = "tell application \"Adium\"\n";
|
||||||
adiumStatus.append("set the status message of every account to \"");
|
adiumStatus.append("set the status message of every account to \"");
|
||||||
adiumStatus.append(status);
|
adiumStatus.append(status);
|
||||||
adiumStatus.append("\"\nend tell\n");
|
adiumStatus.append("\"\nend tell\n");
|
||||||
const char* scriptstr = adiumStatus.toUtf8();
|
const char* scriptstr = adiumStatus.toUtf8();
|
||||||
script( scriptstr );
|
script( scriptstr );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace Tomahawk::InfoSystem;
|
using namespace Tomahawk::InfoSystem;
|
||||||
@@ -60,12 +59,12 @@ AdiumPlugin::~AdiumPlugin()
|
|||||||
void
|
void
|
||||||
AdiumPlugin::settingsChanged()
|
AdiumPlugin::settingsChanged()
|
||||||
{
|
{
|
||||||
m_active = TomahawkSettings::instance()->nowPlayingEnabled();
|
m_active = TomahawkSettings::instance()->nowPlayingEnabled();
|
||||||
if( !m_active )
|
if( !m_active )
|
||||||
setStatus( "" );
|
setStatus( "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AdiumPlugin::getInfo( const QString caller, const InfoType type, const QVariant data, InfoCustomData customData )
|
AdiumPlugin::getInfo( const QString caller, const InfoType type, const QVariant data, InfoCustomData customData )
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
@@ -84,25 +83,25 @@ AdiumPlugin::pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoTyp
|
|||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
if( !m_active )
|
if( !m_active )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch ( type )
|
switch ( type )
|
||||||
{
|
{
|
||||||
case InfoNowPlaying:
|
case InfoNowPlaying:
|
||||||
audioStarted( input );
|
audioStarted( input );
|
||||||
break;
|
break;
|
||||||
case InfoNowPaused:
|
case InfoNowPaused:
|
||||||
audioPaused();
|
audioPaused();
|
||||||
break;
|
break;
|
||||||
case InfoNowResumed:
|
case InfoNowResumed:
|
||||||
audioResumed( input );
|
audioResumed( input );
|
||||||
break;
|
break;
|
||||||
case InfoNowStopped:
|
case InfoNowStopped:
|
||||||
audioStopped();
|
audioStopped();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +125,7 @@ void AdiumPlugin::audioStarted( const QVariant &input )
|
|||||||
setStatus( nowPlaying );
|
setStatus( nowPlaying );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AdiumPlugin::audioFinished( const QVariant &input )
|
AdiumPlugin::audioFinished( const QVariant &input )
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
@@ -152,4 +151,3 @@ void AdiumPlugin::audioResumed( const QVariant &input )
|
|||||||
// TODO: audio resumed, so push update status to Adium with playing track
|
// TODO: audio resumed, so push update status to Adium with playing track
|
||||||
audioStarted( input );
|
audioStarted( input );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user