Summary: | open file from 'Files' tab | ||
---|---|---|---|
Product: | [Applications] ktorrent | Reporter: | Becheru Petru-Ioan <becheru.petru.ioan> |
Component: | general | Assignee: | Joris Guisson <joris.guisson> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Becheru Petru-Ioan
2007-01-14 00:53:45 UTC
SVN commit 681804 by guisson: Double clicking on files in file tab, opens them. BUG: 140040 M +5 -2 ChangeLog M +33 -0 plugins/infowidget/fileview.cpp M +1 -0 plugins/infowidget/fileview.h --- branches/extragear/kde3/network/ktorrent/ChangeLog #681803:681804 @@ -1,10 +1,13 @@ -Changes in 2.2dev +Changes in 2.2 : +- Allow user to create torrents without tracker +- Double clicking on files in files tab opens them + +Changes in 2.2rc1 - Revamped plugin settings page, looks much nicer now. - Scan dialog now has only one button cancel, which becomes close when the scan is finished - Add max seed time feature - Add download and seed time columns in view -- Allow user to create torrents without tracker Changes in 2.2beta1 - Ditch KMDI in favor of KDevelop IDEA code --- branches/extragear/kde3/network/ktorrent/plugins/infowidget/fileview.cpp #681803:681804 @@ -29,6 +29,7 @@ #include <interfaces/functions.h> #include <interfaces/torrentinterface.h> #include <interfaces/torrentfileinterface.h> +#include <qfileinfo.h> #include "functions.h" #include "iwfiletreeitem.h" #include "iwfiletreediritem.h" @@ -72,6 +73,8 @@ connect(this,SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint& )), this,SLOT(showContextMenu(KListView*, QListViewItem*, const QPoint& ))); connect(context_menu, SIGNAL ( activated ( int ) ), this, SLOT ( contextItem ( int ) ) ); + connect(this,SIGNAL(doubleClicked( QListViewItem*, const QPoint&, int )), + this,SLOT(onDoubleClicked(QListViewItem*, const QPoint&, int))); setEnabled(false); @@ -388,6 +391,36 @@ if (multi_root) multi_root->updateDNDInformation(); } + + void FileView::onDoubleClicked(QListViewItem* item,const QPoint & ,int ) + { + if (!curr_tc) + return; + + const TorrentStats & s = curr_tc->getStats(); + + if (s.multi_file_torrent) + { + if (item->childCount() == 0) + { + // file + FileTreeItem* file = (FileTreeItem*)item; + QString path = "cache" + bt::DirSeparator() + file->getTorrentFile().getPath(); + new KRun(KURL::fromPathOrURL(curr_tc->getTorDir() + path), 0, true, true); + } + else + { + // directory + FileTreeDirItem* dir = ((FileTreeDirItem*)item); + new KRun(KURL::fromPathOrURL(curr_tc->getTorDir() + "cache" + dir->getPath()), 0, true, true); + } + } + else + { + QFileInfo fi(curr_tc->getTorDir()+"cache"); + new KRun(KURL::fromPathOrURL(fi.readLink()), 0, true, true); + } + } } #include "fileview.moc" --- branches/extragear/kde3/network/ktorrent/plugins/infowidget/fileview.h #681803:681804 @@ -44,6 +44,7 @@ void contextItem(int id); void showContextMenu(KListView* ,QListViewItem* item,const QPoint & p); void refreshFileTree(kt::TorrentInterface* tc); + void onDoubleClicked(QListViewItem* item,const QPoint & ,int ); private: void fillFileTree(); |