Format code
This commit is contained in:
1 parent
d5ab0db12b
commit
94d7f0e0fe
1 file changed
+21
-22
+21
-22
@@ -61,7 +61,6 @@ int main( int argc, char *argv[] )
|
||||
if( sessionBusInterface )
|
||||
{
|
||||
|
||||
|
||||
Bool force_new = false;
|
||||
QStringList filenameList;
|
||||
for( Int i = 1; i < argc; i++ )
|
||||
@@ -84,8 +83,8 @@ int main( int argc, char *argv[] )
|
||||
if( foundRunningService )
|
||||
{
|
||||
// open given session
|
||||
QDBusMessage m = QDBusMessage::createMethodCall( PLAYUVER_DBUS_SESSION_NAME, QStringLiteral( PLAYUVER_DBUS_PATH ), QStringLiteral( PLAYUVER_DBUS_SESSION_NAME ),
|
||||
QStringLiteral( "activate" ) );
|
||||
QDBusMessage m = QDBusMessage::createMethodCall( PLAYUVER_DBUS_SESSION_NAME, QStringLiteral( PLAYUVER_DBUS_PATH ),
|
||||
QStringLiteral( PLAYUVER_DBUS_SESSION_NAME ), QStringLiteral( "activate" ) );
|
||||
|
||||
QDBusConnection::sessionBus().call( m );
|
||||
|
||||
@@ -95,33 +94,33 @@ int main( int argc, char *argv[] )
|
||||
QStringList tokens;
|
||||
|
||||
// open given files...
|
||||
foreach(const QString & file, filenameList){
|
||||
QDBusMessage m = QDBusMessage::createMethodCall(PLAYUVER_DBUS_SESSION_NAME,
|
||||
QStringLiteral(PLAYUVER_DBUS_PATH), QStringLiteral(PLAYUVER_DBUS_SESSION_NAME), QStringLiteral("loadFile"));
|
||||
|
||||
QList<QVariant> dbusargs;
|
||||
dbusargs.append( file );
|
||||
m.setArguments(dbusargs);
|
||||
|
||||
QDBusMessage res = QDBusConnection::sessionBus().call(m);
|
||||
if (res.type() == QDBusMessage::ReplyMessage)
|
||||
foreach(const QString & file, filenameList)
|
||||
{
|
||||
if (res.arguments().count() == 1)
|
||||
QDBusMessage m = QDBusMessage::createMethodCall(PLAYUVER_DBUS_SESSION_NAME,
|
||||
QStringLiteral(PLAYUVER_DBUS_PATH), QStringLiteral(PLAYUVER_DBUS_SESSION_NAME), QStringLiteral("loadFile"));
|
||||
|
||||
QList<QVariant> dbusargs;
|
||||
dbusargs.append( file );
|
||||
m.setArguments(dbusargs);
|
||||
|
||||
QDBusMessage res = QDBusConnection::sessionBus().call(m);
|
||||
if (res.type() == QDBusMessage::ReplyMessage)
|
||||
{
|
||||
QVariant v = res.arguments()[0];
|
||||
if (v.isValid())
|
||||
if (res.arguments().count() == 1)
|
||||
{
|
||||
QString s = v.toString();
|
||||
if ((!s.isEmpty()) && (s != QStringLiteral("ERROR")))
|
||||
QVariant v = res.arguments()[0];
|
||||
if (v.isValid())
|
||||
{
|
||||
tokens << s;
|
||||
QString s = v.toString();
|
||||
if ((!s.isEmpty()) && (s != QStringLiteral("ERROR")))
|
||||
{
|
||||
tokens << s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// this will wait until exiting is emitted by the used instance, if wanted...
|
||||
// this will wait until exiting is emitted by the used instance, if wanted...
|
||||
return needToBlock ? application.exec() : 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user