Changeset 9175


Ignore:
Timestamp:
Sep 26, 2009, 4:11:00 AM (12 years ago)
Author:
charles
Message:

(trunk qt) #2418: Cannot open a torrent in kde4 with right clicking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/app.cc

    r8570 r9175  
    4949    getUsage( void )
    5050    {
    51         return "Transmission " LONG_VERSION_STRING "\n"
    52                "http://www.transmissionbt.com/\n"
    53                "A fast and easy BitTorrent client";
     51        return "Usage:\n"
     52               "  transmission [OPTIONS...] [torrent files]";
    5453    }
    5554
     
    9998    const char * optarg;
    10099    const char * configDir = 0;
     100    QStringList filenames;
    101101    while( ( c = tr_getopt( getUsage( ), argc, (const char**)argv, opts, &optarg ) ) ) {
    102102        switch( c ) {
     
    105105            case 'v':        Utils::toStderr( QObject::tr( "transmission %1" ).arg( LONG_VERSION_STRING ) ); exit( 0 ); break;
    106106            case TR_OPT_ERR: Utils::toStderr( QObject::tr( "Invalid option" ) ); showUsage( ); break;
    107             default:         Utils::toStderr( QObject::tr( "Got opt %1" ).arg((int)c) ); showUsage( ); break;
     107            default:         filenames.append( optarg ); break;
    108108        }
    109109    }
     
    168168        d->show( );
    169169    }
     170
     171    for( QStringList::const_iterator it=filenames.begin(), end=filenames.end(); it!=end; ++it )
     172        mySession->addTorrent( *it );
    170173}
    171174
Note: See TracChangeset for help on using the changeset viewer.