Changeset 13692


Ignore:
Timestamp:
Dec 27, 2012, 5:46:11 PM (8 years ago)
Author:
jordan
Message:

(trunk, qt) #5193 'qt: open folder: if the first file in a torrent is not an immediate child of the torrent folder, wrong folder opened' -- fixed with patch from basinilya

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/mainwin.cc

    r13555 r13692  
    639639    const int torrentId( *getSelectedTorrents().begin() );
    640640    const Torrent * tor( myModel.getTorrentFromId( torrentId ) );
    641     const QString path( tor->getPath( ) );
     641    QString path( tor->getPath( ) );
    642642    const FileList files = tor->files();
     643    const QString firstfile = files.at(0).filename;
     644    int slashIndex = firstfile.indexOf('/');
    643645    if (files.size() == 1)
    644646        openSelect( path + "/" + files.at(0).filename );
    645647    else {
    646         QDir dir( path + "/" + files.at(0).filename );
    647         dir.cdUp();
    648         openSelect( dir.path() );
     648        path = path + "/" + firstfile.left(slashIndex);
     649        openSelect( path );
    649650    }
    650651}
Note: See TracChangeset for help on using the changeset viewer.