mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Fixes for style.
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
@@ -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,9 +59,9 @@ AdiumPlugin::~AdiumPlugin()
|
||||
void
|
||||
AdiumPlugin::settingsChanged()
|
||||
{
|
||||
m_active = TomahawkSettings::instance()->nowPlayingEnabled();
|
||||
if( !m_active )
|
||||
setStatus( "" );
|
||||
m_active = TomahawkSettings::instance()->nowPlayingEnabled();
|
||||
if( !m_active )
|
||||
setStatus( "" );
|
||||
}
|
||||
|
||||
void
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,4 +151,3 @@ void AdiumPlugin::audioResumed( const QVariant &input )
|
||||
// TODO: audio resumed, so push update status to Adium with playing track
|
||||
audioStarted( input );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user