mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 16:07:23 -06:00
Compare commits
13 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7089fc0687 | ||
|
|
f9064d8b00 | ||
|
|
01df76915c | ||
|
|
52f6b008f4 | ||
|
|
abeed2c6f0 | ||
|
|
01fcf82b0c | ||
|
|
92c70bc878 | ||
|
|
1c313c7c06 | ||
|
|
ed4ca7b769 | ||
|
|
795a3a01c2 | ||
|
|
f31f067bbf | ||
|
|
10905eb04b | ||
|
|
8637996a99 |
10
Changelog
10
Changelog
@@ -1,3 +1,13 @@
|
|||||||
|
* Sn Mar 13 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.8
|
||||||
|
- BUFIX: Fix compilation with libtorrent v0.14.x
|
||||||
|
- BUGFIX: Fix issues when writing on NTFS (Linux, Mac)
|
||||||
|
- BUGFIX: Fix root folder being cut off if the torrent comes from a scanned folder (Christian Kandeler)
|
||||||
|
- BUGFIX: Improve folder removal behavior
|
||||||
|
- BUGFIX: Make sure the .unwanted folder is deleted on soft torrent removal
|
||||||
|
- BUGFIX: Indicate support for Magnet links in desktop file (Fisiu)
|
||||||
|
- BUGFIX: Do not report torrent being checked as queued
|
||||||
|
- BUGFIX: Improve lists columns state saving
|
||||||
|
|
||||||
* Sat Feb 26 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.7
|
* Sat Feb 26 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.7
|
||||||
- BUGFIX: Encoding fixes (Windows)
|
- BUGFIX: Encoding fixes (Windows)
|
||||||
- BUGFIX: Fix "append label to save path" (Windows)
|
- BUGFIX: Fix "append label to save path" (Windows)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Categories=Qt;Network;P2P;
|
Categories=Qt;Network;P2P;
|
||||||
Comment=V2.6.7
|
Comment=V2.6.8
|
||||||
Exec=qbittorrent %f
|
Exec=qbittorrent %U
|
||||||
GenericName=BitTorrent client
|
GenericName=BitTorrent client
|
||||||
GenericName[ar]=العميل BitTorrent
|
GenericName[ar]=العميل BitTorrent
|
||||||
GenericName[bg]=Торент клиент
|
GenericName[bg]=Торент клиент
|
||||||
@@ -31,7 +31,7 @@ GenericName[uk]=BitTorrent-клієнт
|
|||||||
GenericName[zh]=BitTorrent之用户
|
GenericName[zh]=BitTorrent之用户
|
||||||
GenericName[zh_TW]=BitTorrent客戶端
|
GenericName[zh_TW]=BitTorrent客戶端
|
||||||
Icon=qbittorrent
|
Icon=qbittorrent
|
||||||
MimeType=application/x-bittorrent;
|
MimeType=application/x-bittorrent;x-scheme-handler/magnet;
|
||||||
Name=qBittorrent
|
Name=qBittorrent
|
||||||
Name[ko]=큐비토런트
|
Name[ko]=큐비토런트
|
||||||
Terminal=false
|
Terminal=false
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>2.6.7</string>
|
<string>2.6.8</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
|
|||||||
@@ -461,8 +461,8 @@ void MainWindow::readSettings() {
|
|||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
settings.beginGroup(QString::fromUtf8("MainWindow"));
|
settings.beginGroup(QString::fromUtf8("MainWindow"));
|
||||||
if(settings.contains("geometry")) {
|
if(settings.contains("geometry")) {
|
||||||
restoreGeometry(settings.value("geometry").toByteArray());
|
if(restoreGeometry(settings.value("geometry").toByteArray()))
|
||||||
m_posInitialized = true;
|
m_posInitialized = true;
|
||||||
}
|
}
|
||||||
const QByteArray splitterState = settings.value("vsplitterState").toByteArray();
|
const QByteArray splitterState = settings.value("vsplitterState").toByteArray();
|
||||||
if(splitterState.isEmpty()) {
|
if(splitterState.isEmpty()) {
|
||||||
|
|||||||
10
src/misc.cpp
10
src/misc.cpp
@@ -799,3 +799,13 @@ QString misc::fileName(QString file_path)
|
|||||||
return file_path;
|
return file_path;
|
||||||
return file_path.mid(slash_index+1);
|
return file_path.mid(slash_index+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool misc::removeEmptyFolder(const QString &dirpath)
|
||||||
|
{
|
||||||
|
QDir savedir(dirpath);
|
||||||
|
const QString dirname = savedir.dirName();
|
||||||
|
if(savedir.exists() && savedir.cdUp()) {
|
||||||
|
return savedir.rmdir(dirname);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ public:
|
|||||||
return MyFile.remove();
|
return MyFile.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool removeEmptyFolder(const QString &dirpath);
|
||||||
|
|
||||||
static quint64 computePathSize(QString path);
|
static quint64 computePathSize(QString path);
|
||||||
|
|
||||||
static QString truncateRootFolder(boost::intrusive_ptr<libtorrent::torrent_info> t);
|
static QString truncateRootFolder(boost::intrusive_ptr<libtorrent::torrent_info> t);
|
||||||
|
|||||||
@@ -49,6 +49,8 @@
|
|||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
PeerListWidget::PeerListWidget(PropertiesWidget *parent): QTreeView(parent), properties(parent), display_flags(false) {
|
PeerListWidget::PeerListWidget(PropertiesWidget *parent): QTreeView(parent), properties(parent), display_flags(false) {
|
||||||
|
// Load settings
|
||||||
|
loadSettings();
|
||||||
// Visual settings
|
// Visual settings
|
||||||
setRootIsDecorated(false);
|
setRootIsDecorated(false);
|
||||||
setItemsExpandable(false);
|
setItemsExpandable(false);
|
||||||
@@ -77,8 +79,6 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent): QTreeView(parent), pro
|
|||||||
setItemDelegate(listDelegate);
|
setItemDelegate(listDelegate);
|
||||||
// Enable sorting
|
// Enable sorting
|
||||||
setSortingEnabled(true);
|
setSortingEnabled(true);
|
||||||
// Load settings
|
|
||||||
loadSettings();
|
|
||||||
// IP to Hostname resolver
|
// IP to Hostname resolver
|
||||||
updatePeerHostNameResolutionState();
|
updatePeerHostNameResolutionState();
|
||||||
// SIGNAL/SLOT
|
// SIGNAL/SLOT
|
||||||
@@ -262,42 +262,12 @@ void PeerListWidget::clear() {
|
|||||||
|
|
||||||
void PeerListWidget::loadSettings() {
|
void PeerListWidget::loadSettings() {
|
||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
QList<int> contentColsWidths = misc::intListfromStringList(settings.value(QString::fromUtf8("TorrentProperties/Peers/peersColsWidth")).toStringList());
|
header()->restoreState(settings.value("TorrentProperties/Peers/PeerListState").toByteArray());
|
||||||
if(!contentColsWidths.empty()) {
|
|
||||||
for(int i=0; i<contentColsWidths.size(); ++i) {
|
|
||||||
setColumnWidth(i, contentColsWidths.at(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Load sorted column
|
|
||||||
QString sortedCol = settings.value(QString::fromUtf8("TorrentProperties/Peers/PeerListSortedCol"), QString()).toString();
|
|
||||||
if(!sortedCol.isEmpty()) {
|
|
||||||
Qt::SortOrder sortOrder;
|
|
||||||
if(sortedCol.endsWith(QString::fromUtf8("d")))
|
|
||||||
sortOrder = Qt::DescendingOrder;
|
|
||||||
else
|
|
||||||
sortOrder = Qt::AscendingOrder;
|
|
||||||
sortedCol.chop(1);
|
|
||||||
int index = sortedCol.toInt();
|
|
||||||
sortByColumn(index, sortOrder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerListWidget::saveSettings() const {
|
void PeerListWidget::saveSettings() const {
|
||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
QStringList contentColsWidths;
|
settings.setValue("TorrentProperties/Peers/PeerListState", header()->saveState());
|
||||||
for(int i=0; i<listModel->columnCount(); ++i) {
|
|
||||||
contentColsWidths << QString::number(columnWidth(i));
|
|
||||||
}
|
|
||||||
settings.setValue(QString::fromUtf8("TorrentProperties/Peers/peersColsWidth"), contentColsWidths);
|
|
||||||
// Save sorted column
|
|
||||||
Qt::SortOrder sortOrder = header()->sortIndicatorOrder();
|
|
||||||
QString sortOrderLetter;
|
|
||||||
if(sortOrder == Qt::AscendingOrder)
|
|
||||||
sortOrderLetter = QString::fromUtf8("a");
|
|
||||||
else
|
|
||||||
sortOrderLetter = QString::fromUtf8("d");
|
|
||||||
int index = header()->sortIndicatorSection();
|
|
||||||
settings.setValue(QString::fromUtf8("TorrentProperties/Peers/PeerListSortedCol"), QVariant(QString::number(index)+sortOrderLetter));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerListWidget::loadPeers(const QTorrentHandle &h, bool force_hostname_resolution) {
|
void PeerListWidget::loadPeers(const QTorrentHandle &h, bool force_hostname_resolution) {
|
||||||
|
|||||||
@@ -60,8 +60,9 @@ using namespace libtorrent;
|
|||||||
|
|
||||||
PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, TransferListWidget *transferList):
|
PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, TransferListWidget *transferList):
|
||||||
QWidget(parent), transferList(transferList), main_window(main_window) {
|
QWidget(parent), transferList(transferList), main_window(main_window) {
|
||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
loadFilesListState();
|
||||||
|
|
||||||
// Icons
|
// Icons
|
||||||
deleteWS_button->setIcon(IconProvider::instance()->getIcon("list-remove"));
|
deleteWS_button->setIcon(IconProvider::instance()->getIcon("list-remove"));
|
||||||
addWS_button->setIcon(IconProvider::instance()->getIcon("list-add"));
|
addWS_button->setIcon(IconProvider::instance()->getIcon("list-add"));
|
||||||
@@ -123,6 +124,7 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, Tra
|
|||||||
}
|
}
|
||||||
|
|
||||||
PropertiesWidget::~PropertiesWidget() {
|
PropertiesWidget::~PropertiesWidget() {
|
||||||
|
saveFilesListState();
|
||||||
delete refreshTimer;
|
delete refreshTimer;
|
||||||
delete trackerList;
|
delete trackerList;
|
||||||
delete peersList;
|
delete peersList;
|
||||||
@@ -265,16 +267,18 @@ void PropertiesWidget::loadTorrentInfos(const QTorrentHandle &_h) {
|
|||||||
loadDynamicData();
|
loadDynamicData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PropertiesWidget::loadFilesListState() {
|
||||||
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
|
filesList->header()->restoreState(settings.value("TorrentProperties/FilesListState").toByteArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
void PropertiesWidget::saveFilesListState() {
|
||||||
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
|
settings.setValue("TorrentProperties/FilesListState", filesList->header()->saveState());
|
||||||
|
}
|
||||||
|
|
||||||
void PropertiesWidget::readSettings() {
|
void PropertiesWidget::readSettings() {
|
||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
QList<int> contentColsWidths = misc::intListfromStringList(settings.value(QString::fromUtf8("TorrentProperties/filesColsWidth")).toStringList());
|
|
||||||
if(contentColsWidths.empty()) {
|
|
||||||
filesList->header()->resizeSection(0, 300);
|
|
||||||
} else {
|
|
||||||
for(int i=0; i<contentColsWidths.size(); ++i) {
|
|
||||||
filesList->setColumnWidth(i, contentColsWidths.at(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Restore splitter sizes
|
// Restore splitter sizes
|
||||||
QStringList sizes_str = settings.value(QString::fromUtf8("TorrentProperties/SplitterSizes"), QString()).toString().split(",");
|
QStringList sizes_str = settings.value(QString::fromUtf8("TorrentProperties/SplitterSizes"), QString()).toString().split(",");
|
||||||
if(sizes_str.size() == 2) {
|
if(sizes_str.size() == 2) {
|
||||||
@@ -293,11 +297,6 @@ void PropertiesWidget::readSettings() {
|
|||||||
void PropertiesWidget::saveSettings() {
|
void PropertiesWidget::saveSettings() {
|
||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
settings.setValue("TorrentProperties/Visible", state==VISIBLE);
|
settings.setValue("TorrentProperties/Visible", state==VISIBLE);
|
||||||
QStringList contentColsWidths;
|
|
||||||
for(int i=0; i<PropListModel->columnCount(); ++i) {
|
|
||||||
contentColsWidths << QString::number(filesList->columnWidth(i));
|
|
||||||
}
|
|
||||||
settings.setValue(QString::fromUtf8("TorrentProperties/filesColsWidth"), contentColsWidths);
|
|
||||||
// Splitter sizes
|
// Splitter sizes
|
||||||
QSplitter *hSplitter = static_cast<QSplitter*>(parentWidget());
|
QSplitter *hSplitter = static_cast<QSplitter*>(parentWidget());
|
||||||
QList<int> sizes;
|
QList<int> sizes;
|
||||||
|
|||||||
@@ -93,6 +93,10 @@ public slots:
|
|||||||
void openDoubleClickedFile(QModelIndex);
|
void openDoubleClickedFile(QModelIndex);
|
||||||
void updateSavePath(const QTorrentHandle& h);
|
void updateSavePath(const QTorrentHandle& h);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void loadFilesListState();
|
||||||
|
void saveFilesListState();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TransferListWidget *transferList;
|
TransferListWidget *transferList;
|
||||||
MainWindow *main_window;
|
MainWindow *main_window;
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), properties(properties) {
|
TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), properties(properties) {
|
||||||
|
loadSettings();
|
||||||
// Graphical settings
|
// Graphical settings
|
||||||
setRootIsDecorated(false);
|
setRootIsDecorated(false);
|
||||||
setAllColumnsShowFocus(true);
|
setAllColumnsShowFocus(true);
|
||||||
@@ -71,7 +72,6 @@ TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), propertie
|
|||||||
lsd_item = new QTreeWidgetItem(QStringList("** "+tr("[LSD]")+" **"));
|
lsd_item = new QTreeWidgetItem(QStringList("** "+tr("[LSD]")+" **"));
|
||||||
insertTopLevelItem(2, lsd_item);
|
insertTopLevelItem(2, lsd_item);
|
||||||
setRowColor(2, QColor("grey"));
|
setRowColor(2, QColor("grey"));
|
||||||
loadSettings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TrackerList::~TrackerList() {
|
TrackerList::~TrackerList() {
|
||||||
@@ -368,21 +368,12 @@ void TrackerList::showTrackerListMenu(QPoint) {
|
|||||||
|
|
||||||
void TrackerList::loadSettings() {
|
void TrackerList::loadSettings() {
|
||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
QList<int> contentColsWidths = misc::intListfromStringList(settings.value(QString::fromUtf8("TorrentProperties/Trackers/trackersColsWidth")).toStringList());
|
if(!header()->restoreState(settings.value("TorrentProperties/Trackers/TrackerListState").toByteArray())) {
|
||||||
if(!contentColsWidths.empty()) {
|
|
||||||
for(int i=0; i<contentColsWidths.size(); ++i) {
|
|
||||||
setColumnWidth(i, contentColsWidths.at(i));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
setColumnWidth(0, 300);
|
setColumnWidth(0, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackerList::saveSettings() const {
|
void TrackerList::saveSettings() const {
|
||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
QStringList contentColsWidths;
|
settings.setValue("TorrentProperties/Trackers/TrackerListState", header()->saveState());
|
||||||
for(int i=0; i<columnCount(); ++i) {
|
|
||||||
contentColsWidths << QString::number(columnWidth(i));
|
|
||||||
}
|
|
||||||
settings.setValue(QString::fromUtf8("TorrentProperties/Trackers/trackersColsWidth"), contentColsWidths);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -389,8 +389,13 @@ void QBtSession::configureSession() {
|
|||||||
sessionSettings.cache_size = pref.diskCacheSize()*64;
|
sessionSettings.cache_size = pref.diskCacheSize()*64;
|
||||||
qDebug() << "Using a disk cache size of" << pref.diskCacheSize() << "MiB";
|
qDebug() << "Using a disk cache size of" << pref.diskCacheSize() << "MiB";
|
||||||
// Disable OS cache to avoid memory problems (uTorrent behavior)
|
// Disable OS cache to avoid memory problems (uTorrent behavior)
|
||||||
|
#ifdef Q_WS_WIN
|
||||||
|
#if LIBTORRENT_VERSION_MINOR > 14
|
||||||
|
// Fixes huge memory usage on Windows 7 (especially when checking files)
|
||||||
sessionSettings.disk_io_write_mode = session_settings::disable_os_cache_for_aligned_files;
|
sessionSettings.disk_io_write_mode = session_settings::disable_os_cache_for_aligned_files;
|
||||||
sessionSettings.disk_io_read_mode = session_settings::disable_os_cache_for_aligned_files;
|
sessionSettings.disk_io_read_mode = session_settings::disable_os_cache_for_aligned_files;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
// Queueing System
|
// Queueing System
|
||||||
if(pref.isQueueingSystemEnabled()) {
|
if(pref.isQueueingSystemEnabled()) {
|
||||||
sessionSettings.active_downloads = pref.getMaxActiveDownloads();
|
sessionSettings.active_downloads = pref.getMaxActiveDownloads();
|
||||||
@@ -2113,22 +2118,21 @@ void QBtSession::readAlerts() {
|
|||||||
#endif
|
#endif
|
||||||
if(!hash.isEmpty()) {
|
if(!hash.isEmpty()) {
|
||||||
if(savePathsToRemove.contains(hash)) {
|
if(savePathsToRemove.contains(hash)) {
|
||||||
QDir().rmpath(savePathsToRemove.take(hash));
|
const QString dirpath = savePathsToRemove.take(hash);
|
||||||
|
qDebug() << "Removing save path: " << dirpath << "...";
|
||||||
|
bool ok = misc::removeEmptyFolder(dirpath);
|
||||||
|
Q_UNUSED(ok);
|
||||||
|
qDebug() << "Folder was removed: " << ok;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// XXX: Fallback
|
// Fallback
|
||||||
QStringList hashes_deleted;
|
qDebug() << "hash is empty, use fallback to remove save path";
|
||||||
foreach(const QString& key, savePathsToRemove.keys()) {
|
foreach(const QString& key, savePathsToRemove.keys()) {
|
||||||
// Attempt to delete
|
// Attempt to delete
|
||||||
QDir().rmpath(savePathsToRemove[key]);
|
if(misc::removeEmptyFolder(savePathsToRemove[key])) {
|
||||||
if(!QDir(savePathsToRemove[key]).exists()) {
|
savePathsToRemove.remove(key);
|
||||||
hashes_deleted << key;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Clean up
|
|
||||||
foreach(const QString& key, hashes_deleted) {
|
|
||||||
savePathsToRemove.remove(key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (storage_moved_alert* p = dynamic_cast<storage_moved_alert*>(a.get())) {
|
else if (storage_moved_alert* p = dynamic_cast<storage_moved_alert*>(a.get())) {
|
||||||
@@ -2409,12 +2413,12 @@ QString QBtSession::getSavePath(QString hash, bool fromScanDir, QString filePath
|
|||||||
qDebug("SavePath got from persistant data is %s", qPrintable(savePath));
|
qDebug("SavePath got from persistant data is %s", qPrintable(savePath));
|
||||||
bool append_root_folder = false;
|
bool append_root_folder = false;
|
||||||
if(savePath.isEmpty()) {
|
if(savePath.isEmpty()) {
|
||||||
if(fromScanDir && m_scanFolders->downloadInTorrentFolder(filePath))
|
if(fromScanDir && m_scanFolders->downloadInTorrentFolder(filePath)) {
|
||||||
savePath = QFileInfo(filePath).dir().path();
|
savePath = QFileInfo(filePath).dir().path();
|
||||||
else {
|
} else {
|
||||||
savePath = defaultSavePath;
|
savePath = defaultSavePath;
|
||||||
append_root_folder = true;
|
|
||||||
}
|
}
|
||||||
|
append_root_folder = true;
|
||||||
}
|
}
|
||||||
if(!fromScanDir && appendLabelToSavePath) {
|
if(!fromScanDir && appendLabelToSavePath) {
|
||||||
const QString label = TorrentPersistentData::getLabel(hash);
|
const QString label = TorrentPersistentData::getLabel(hash);
|
||||||
|
|||||||
@@ -325,12 +325,10 @@ QStringList QTorrentHandle::uneeded_files_path() const {
|
|||||||
QDir saveDir(save_path());
|
QDir saveDir(save_path());
|
||||||
QStringList res;
|
QStringList res;
|
||||||
std::vector<int> fp = torrent_handle::file_priorities();
|
std::vector<int> fp = torrent_handle::file_priorities();
|
||||||
vector<size_type> progress;
|
|
||||||
torrent_handle::file_progress(progress);
|
|
||||||
torrent_info::file_iterator fi = torrent_handle::get_torrent_info().begin_files();
|
torrent_info::file_iterator fi = torrent_handle::get_torrent_info().begin_files();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while(fi != torrent_handle::get_torrent_info().end_files()) {
|
while(fi != torrent_handle::get_torrent_info().end_files()) {
|
||||||
if(fp[i] == 0 && progress[i] < filesize_at(i))
|
if(fp[i] == 0)
|
||||||
res << QDir::cleanPath(saveDir.absoluteFilePath(filepath(*fi)));
|
res << QDir::cleanPath(saveDir.absoluteFilePath(filepath(*fi)));
|
||||||
fi++;
|
fi++;
|
||||||
++i;
|
++i;
|
||||||
|
|||||||
@@ -57,9 +57,13 @@ TorrentModelItem::State TorrentModelItem::state() const
|
|||||||
return m_torrent.is_seed() ? STATE_PAUSED_UP : STATE_PAUSED_DL;
|
return m_torrent.is_seed() ? STATE_PAUSED_UP : STATE_PAUSED_DL;
|
||||||
}
|
}
|
||||||
if(m_torrent.is_queued()) {
|
if(m_torrent.is_queued()) {
|
||||||
m_icon = QIcon(":/Icons/skin/queued.png");
|
if(m_torrent.state() != torrent_status::queued_for_checking
|
||||||
m_fgColor = QColor("grey");
|
&& m_torrent.state() != torrent_status::checking_resume_data
|
||||||
return m_torrent.is_seed() ? STATE_QUEUED_UP : STATE_QUEUED_DL;
|
&& m_torrent.state() != torrent_status::checking_files) {
|
||||||
|
m_icon = QIcon(":/Icons/skin/queued.png");
|
||||||
|
m_fgColor = QColor("grey");
|
||||||
|
return m_torrent.is_seed() ? STATE_QUEUED_UP : STATE_QUEUED_DL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Other states
|
// Other states
|
||||||
switch(m_torrent.state()) {
|
switch(m_torrent.state()) {
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) :
|
|||||||
const Preferences pref;
|
const Preferences pref;
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
loadFilesListState();
|
||||||
// Icons
|
// Icons
|
||||||
CancelButton->setIcon(IconProvider::instance()->getIcon("dialog-cancel"));
|
CancelButton->setIcon(IconProvider::instance()->getIcon("dialog-cancel"));
|
||||||
OkButton->setIcon(IconProvider::instance()->getIcon("list-add"));
|
OkButton->setIcon(IconProvider::instance()->getIcon("list-add"));
|
||||||
@@ -123,6 +124,7 @@ torrentAdditionDialog::~torrentAdditionDialog() {
|
|||||||
void torrentAdditionDialog::closeEvent(QCloseEvent *event)
|
void torrentAdditionDialog::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
saveFilesListState();
|
||||||
saveSettings();
|
saveSettings();
|
||||||
QDialog::closeEvent(event);
|
QDialog::closeEvent(event);
|
||||||
}
|
}
|
||||||
@@ -130,14 +132,12 @@ void torrentAdditionDialog::closeEvent(QCloseEvent *event)
|
|||||||
void torrentAdditionDialog::readSettings() {
|
void torrentAdditionDialog::readSettings() {
|
||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
restoreGeometry(settings.value("TorrentAdditionDlg/dimensions").toByteArray());
|
restoreGeometry(settings.value("TorrentAdditionDlg/dimensions").toByteArray());
|
||||||
torrentContentList->header()->resizeSection(0, 200); //Default
|
|
||||||
torrentContentList->header()->restoreState(settings.value("TorrentAdditionDlg/contentHeaderState").toByteArray());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void torrentAdditionDialog::saveSettings() {
|
void torrentAdditionDialog::saveSettings() {
|
||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
settings.setValue("TorrentAdditionDlg/dimensions", saveGeometry());
|
settings.setValue("TorrentAdditionDlg/dimensions", saveGeometry());
|
||||||
settings.setValue("TorrentAdditionDlg/contentHeaderState", torrentContentList->header()->saveState());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void torrentAdditionDialog::renameTorrentNameInModel(QString file_path) {
|
void torrentAdditionDialog::renameTorrentNameInModel(QString file_path) {
|
||||||
@@ -146,6 +146,18 @@ void torrentAdditionDialog::renameTorrentNameInModel(QString file_path) {
|
|||||||
PropListModel->setData(PropListModel->index(0, 0), new_name);
|
PropListModel->setData(PropListModel->index(0, 0), new_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void torrentAdditionDialog::loadFilesListState() {
|
||||||
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
|
if(!torrentContentList->header()->restoreState(settings.value("TorrentAdditionDlg/ContentHeaderState").toByteArray())) {
|
||||||
|
torrentContentList->header()->resizeSection(0, 200); //Default
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void torrentAdditionDialog::saveFilesListState() {
|
||||||
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
|
settings.setValue("TorrentAdditionDlg/ContentHeaderState", torrentContentList->header()->saveState());
|
||||||
|
}
|
||||||
|
|
||||||
void torrentAdditionDialog::limitDialogWidth() {
|
void torrentAdditionDialog::limitDialogWidth() {
|
||||||
int scrn = 0;
|
int scrn = 0;
|
||||||
const QWidget *w = this->window();
|
const QWidget *w = this->window();
|
||||||
|
|||||||
@@ -46,8 +46,6 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
|
|||||||
public:
|
public:
|
||||||
torrentAdditionDialog(QWidget *parent);
|
torrentAdditionDialog(QWidget *parent);
|
||||||
~torrentAdditionDialog();
|
~torrentAdditionDialog();
|
||||||
void readSettings();
|
|
||||||
void saveSettings();
|
|
||||||
void showLoadMagnetURI(QString magnet_uri);
|
void showLoadMagnetURI(QString magnet_uri);
|
||||||
void showLoad(QString filePath, QString from_url=QString::null);
|
void showLoad(QString filePath, QString from_url=QString::null);
|
||||||
QString getCurrentTruncatedSavePath(QString* root_folder_or_file_name = 0) const;
|
QString getCurrentTruncatedSavePath(QString* root_folder_or_file_name = 0) const;
|
||||||
@@ -74,6 +72,12 @@ public slots:
|
|||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void readSettings();
|
||||||
|
void saveSettings();
|
||||||
|
void loadFilesListState();
|
||||||
|
void saveFilesListState();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString fileName;
|
QString fileName;
|
||||||
QString hash;
|
QString hash;
|
||||||
|
|||||||
@@ -64,6 +64,10 @@ using namespace libtorrent;
|
|||||||
|
|
||||||
TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window, QBtSession *_BTSession):
|
TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window, QBtSession *_BTSession):
|
||||||
QTreeView(parent), BTSession(_BTSession), main_window(main_window) {
|
QTreeView(parent), BTSession(_BTSession), main_window(main_window) {
|
||||||
|
|
||||||
|
// Load settings
|
||||||
|
loadSettings();
|
||||||
|
|
||||||
// Create and apply delegate
|
// Create and apply delegate
|
||||||
listDelegate = new TransferListDelegate(this);
|
listDelegate = new TransferListDelegate(this);
|
||||||
setItemDelegate(listDelegate);
|
setItemDelegate(listDelegate);
|
||||||
@@ -119,9 +123,6 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window,
|
|||||||
connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayListMenu(const QPoint&)));
|
connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayListMenu(const QPoint&)));
|
||||||
header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(header(), SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayDLHoSMenu(const QPoint&)));
|
connect(header(), SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayDLHoSMenu(const QPoint&)));
|
||||||
|
|
||||||
// Load settings
|
|
||||||
loadSettings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TransferListWidget::~TransferListWidget() {
|
TransferListWidget::~TransferListWidget() {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
os2 {
|
os2 {
|
||||||
DEFINES += VERSION=\'\"v2.6.7\"\'
|
DEFINES += VERSION=\'\"v2.6.8\"\'
|
||||||
} else {
|
} else {
|
||||||
DEFINES += VERSION=\\\"v2.6.7\\\"
|
DEFINES += VERSION=\\\"v2.6.8\\\"
|
||||||
}
|
}
|
||||||
DEFINES += VERSION_MAJOR=2
|
DEFINES += VERSION_MAJOR=2
|
||||||
DEFINES += VERSION_MINOR=6
|
DEFINES += VERSION_MINOR=6
|
||||||
DEFINES += VERSION_BUGFIX=7
|
DEFINES += VERSION_BUGFIX=8
|
||||||
|
|
||||||
# NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL
|
# NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL
|
||||||
DEFINES += VERSION_TYPE=NORMAL
|
DEFINES += VERSION_TYPE=NORMAL
|
||||||
|
|||||||
Reference in New Issue
Block a user