Add command line args to playuver

This commit is contained in:
jfmcarreira committed 2015-03-21 03:28:30 +00:00
1 parent e9fcf28365
commit 57e69e6307
6 files changed
+84 -37

No files matched your search

+23 -21
View File
@@ -93,33 +93,32 @@ int main( int argc, char *argv[] )
QStringList tokens;
// open given files...
foreach(const QString & file, filenameList)
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)
{
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)
if (res.arguments().count() == 1)
{
if (res.arguments().count() == 1)
QVariant v = res.arguments()[0];
if (v.isValid())
{
QVariant v = res.arguments()[0];
if (v.isValid())
QString s = v.toString();
if ((!s.isEmpty()) && (s != QStringLiteral("ERROR")))
{
QString s = v.toString();
if ((!s.isEmpty()) && (s != QStringLiteral("ERROR")))
{
tokens << s;
}
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;
}
}
@@ -131,10 +130,13 @@ int main( int argc, char *argv[] )
#endif
plaYUVerApp mainwindow;
mainwindow.show();
mainwindow.parseArgs( argc, argv );
if( mainwindow.parseArgs( argc, argv ) )
{
return 0;
}
#ifdef USE_FERVOR
FvUpdater::sharedUpdater()->SetFeedURL("http://192.168.96.201/share/PlaYUVerProject/PlaYUVerUpdate-" UPDATE_CHANNEL ".xml");
FvUpdater::sharedUpdater()->SetFeedURL("http://192.168.96.201/share/PlaYUVerProject/PlaYUVerUpdate-" UPDATE_CHANNEL ".xml");
FvUpdater::sharedUpdater()->SetDependencies("ALL");
#endif