1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-05 16:42:26 +02:00

Fixes for style.

This commit is contained in:
Alejandro Wainzinger 2011-06-02 18:53:36 -07:00
parent 6500af65c0
commit e5cc13ac57
2 changed files with 29 additions and 30 deletions

View File

@ -20,11 +20,12 @@
#import <ScriptingBridge/ScriptingBridge.h>
#import "adium.h"
void script( const char* status )
void
script( const char* status )
{
NSString *stat = [NSString stringWithUTF8String:status];
NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:stat];
NSDictionary *errorDictionary;
NSAppleEventDescriptor *eventDescriptor = [appleScript executeAndReturnError:&errorDictionary];
[appleScript release];
NSString *stat = [NSString stringWithUTF8String:status];
NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:stat];
NSDictionary *errorDictionary;
NSAppleEventDescriptor *eventDescriptor = [appleScript executeAndReturnError:&errorDictionary];
[appleScript release];
}

View File

@ -28,13 +28,12 @@
static void setStatus(const QString &status)
{
QString adiumStatus = "tell application \"Adium\"\n";
adiumStatus.append("set the status message of every account to \"");
adiumStatus.append(status);
adiumStatus.append("\"\nend tell\n");
const char* scriptstr = adiumStatus.toUtf8();
script( scriptstr );
QString adiumStatus = "tell application \"Adium\"\n";
adiumStatus.append("set the status message of every account to \"");
adiumStatus.append(status);
adiumStatus.append("\"\nend tell\n");
const char* scriptstr = adiumStatus.toUtf8();
script( scriptstr );
}
using namespace Tomahawk::InfoSystem;
@ -60,12 +59,12 @@ AdiumPlugin::~AdiumPlugin()
void
AdiumPlugin::settingsChanged()
{
m_active = TomahawkSettings::instance()->nowPlayingEnabled();
if( !m_active )
setStatus( "" );
m_active = TomahawkSettings::instance()->nowPlayingEnabled();
if( !m_active )
setStatus( "" );
}
void
void
AdiumPlugin::getInfo( const QString caller, const InfoType type, const QVariant data, InfoCustomData customData )
{
switch (type)
@ -84,25 +83,25 @@ AdiumPlugin::pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoTyp
qDebug() << Q_FUNC_INFO;
if( !m_active )
return;
return;
switch ( type )
{
case InfoNowPlaying:
audioStarted( input );
break;
audioStarted( input );
break;
case InfoNowPaused:
audioPaused();
break;
audioPaused();
break;
case InfoNowResumed:
audioResumed( input );
break;
audioResumed( input );
break;
case InfoNowStopped:
audioStopped();
break;
audioStopped();
break;
default:
return;
return;
}
}
@ -126,7 +125,7 @@ void AdiumPlugin::audioStarted( const QVariant &input )
setStatus( nowPlaying );
}
void
void
AdiumPlugin::audioFinished( const QVariant &input )
{
//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
audioStarted( input );
}