Compare commits

..

1 Commits

Author SHA1 Message Date
Christophe Dumez
3d9a128283 Tagged v2.6.7 release 2011-02-26 19:24:37 +00:00
18 changed files with 109 additions and 126 deletions

View File

@@ -1,16 +1,3 @@
* Sun Mar 13 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.9
- BUGFIX: Fix column hiding/showing in transfer list
* Sun Mar 13 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.8
- BUGFIX: 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)

View File

@@ -1,7 +1,7 @@
[Desktop Entry] [Desktop Entry]
Categories=Qt;Network;P2P; Categories=Qt;Network;P2P;
Comment=V2.6.9 Comment=V2.6.7
Exec=qbittorrent %U Exec=qbittorrent %f
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;x-scheme-handler/magnet; MimeType=application/x-bittorrent;
Name=qBittorrent Name=qBittorrent
Name[ko]=큐비토런트 Name[ko]=큐비토런트
Terminal=false Terminal=false

View File

@@ -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.9</string> <string>2.6.7</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>

View File

@@ -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")) {
if(restoreGeometry(settings.value("geometry").toByteArray())) 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()) {

View File

@@ -799,13 +799,3 @@ 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;
}

View File

@@ -123,8 +123,6 @@ 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);

View File

@@ -49,8 +49,6 @@
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);
@@ -79,6 +77,8 @@ 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,12 +262,42 @@ 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"));
header()->restoreState(settings.value("TorrentProperties/Peers/PeerListState").toByteArray()); QList<int> contentColsWidths = misc::intListfromStringList(settings.value(QString::fromUtf8("TorrentProperties/Peers/peersColsWidth")).toStringList());
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"));
settings.setValue("TorrentProperties/Peers/PeerListState", header()->saveState()); QStringList contentColsWidths;
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) {

View File

@@ -60,9 +60,8 @@ 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);
loadFilesListState();
setupUi(this);
// 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"));
@@ -124,7 +123,6 @@ 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;
@@ -267,18 +265,16 @@ 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) {
@@ -297,6 +293,11 @@ 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;

View File

@@ -93,10 +93,6 @@ 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;

View File

@@ -47,7 +47,6 @@
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);
@@ -72,6 +71,7 @@ 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,12 +368,21 @@ 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"));
if(!header()->restoreState(settings.value("TorrentProperties/Trackers/TrackerListState").toByteArray())) { QList<int> contentColsWidths = misc::intListfromStringList(settings.value(QString::fromUtf8("TorrentProperties/Trackers/trackersColsWidth")).toStringList());
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"));
settings.setValue("TorrentProperties/Trackers/TrackerListState", header()->saveState()); QStringList contentColsWidths;
for(int i=0; i<columnCount(); ++i) {
contentColsWidths << QString::number(columnWidth(i));
}
settings.setValue(QString::fromUtf8("TorrentProperties/Trackers/trackersColsWidth"), contentColsWidths);
} }

View File

@@ -389,13 +389,8 @@ 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();
@@ -2118,21 +2113,22 @@ void QBtSession::readAlerts() {
#endif #endif
if(!hash.isEmpty()) { if(!hash.isEmpty()) {
if(savePathsToRemove.contains(hash)) { if(savePathsToRemove.contains(hash)) {
const QString dirpath = savePathsToRemove.take(hash); QDir().rmpath(savePathsToRemove.take(hash));
qDebug() << "Removing save path: " << dirpath << "...";
bool ok = misc::removeEmptyFolder(dirpath);
Q_UNUSED(ok);
qDebug() << "Folder was removed: " << ok;
} }
} else { } else {
// Fallback // XXX: Fallback
qDebug() << "hash is empty, use fallback to remove save path"; QStringList hashes_deleted;
foreach(const QString& key, savePathsToRemove.keys()) { foreach(const QString& key, savePathsToRemove.keys()) {
// Attempt to delete // Attempt to delete
if(misc::removeEmptyFolder(savePathsToRemove[key])) { QDir().rmpath(savePathsToRemove[key]);
savePathsToRemove.remove(key); if(!QDir(savePathsToRemove[key]).exists()) {
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())) {
@@ -2413,12 +2409,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);

View File

@@ -325,10 +325,12 @@ 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) if(fp[i] == 0 && progress[i] < filesize_at(i))
res << QDir::cleanPath(saveDir.absoluteFilePath(filepath(*fi))); res << QDir::cleanPath(saveDir.absoluteFilePath(filepath(*fi)));
fi++; fi++;
++i; ++i;

View File

@@ -57,13 +57,9 @@ 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()) {
if(m_torrent.state() != torrent_status::queued_for_checking m_icon = QIcon(":/Icons/skin/queued.png");
&& m_torrent.state() != torrent_status::checking_resume_data m_fgColor = QColor("grey");
&& m_torrent.state() != torrent_status::checking_files) { return m_torrent.is_seed() ? STATE_QUEUED_UP : STATE_QUEUED_DL;
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()) {

View File

@@ -62,7 +62,6 @@ 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"));
@@ -124,7 +123,6 @@ 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);
} }
@@ -132,12 +130,14 @@ 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,18 +146,6 @@ 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();

View File

@@ -46,6 +46,8 @@ 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;
@@ -72,12 +74,6 @@ 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;

View File

@@ -64,10 +64,6 @@ 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
bool column_loaded = loadSettings();
// Create and apply delegate // Create and apply delegate
listDelegate = new TransferListDelegate(this); listDelegate = new TransferListDelegate(this);
setItemDelegate(listDelegate); setItemDelegate(listDelegate);
@@ -106,17 +102,15 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window,
setDragDropMode(QAbstractItemView::DragOnly); setDragDropMode(QAbstractItemView::DragOnly);
// Default hidden columns // Default hidden columns
if(!column_loaded) { setColumnHidden(TorrentModelItem::TR_PRIORITY, true);
setColumnHidden(TorrentModelItem::TR_PRIORITY, true); setColumnHidden(TorrentModelItem::TR_ADD_DATE, true);
setColumnHidden(TorrentModelItem::TR_ADD_DATE, true); setColumnHidden(TorrentModelItem::TR_SEED_DATE, true);
setColumnHidden(TorrentModelItem::TR_SEED_DATE, true); setColumnHidden(TorrentModelItem::TR_UPLIMIT, true);
setColumnHidden(TorrentModelItem::TR_UPLIMIT, true); setColumnHidden(TorrentModelItem::TR_DLLIMIT, true);
setColumnHidden(TorrentModelItem::TR_DLLIMIT, true); setColumnHidden(TorrentModelItem::TR_TRACKER, true);
setColumnHidden(TorrentModelItem::TR_TRACKER, true); setColumnHidden(TorrentModelItem::TR_AMOUNT_DOWNLOADED, true);
setColumnHidden(TorrentModelItem::TR_AMOUNT_DOWNLOADED, true); setColumnHidden(TorrentModelItem::TR_AMOUNT_LEFT, true);
setColumnHidden(TorrentModelItem::TR_AMOUNT_LEFT, true); setColumnHidden(TorrentModelItem::TR_TIME_ELAPSED, true);
setColumnHidden(TorrentModelItem::TR_TIME_ELAPSED, true);
}
setContextMenuPolicy(Qt::CustomContextMenu); setContextMenuPolicy(Qt::CustomContextMenu);
@@ -125,6 +119,9 @@ 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() {
@@ -875,13 +872,10 @@ void TransferListWidget::saveSettings()
settings.setValue("TransferList/HeaderState", header()->saveState()); settings.setValue("TransferList/HeaderState", header()->saveState());
} }
bool TransferListWidget::loadSettings() void TransferListWidget::loadSettings()
{ {
QIniSettings settings("qBittorrent", "qBittorrent"); QIniSettings settings("qBittorrent", "qBittorrent");
bool ok = header()->restoreState(settings.value("TransferList/HeaderState").toByteArray()); header()->resizeSection(0, 200); // Default
if(!ok) { header()->restoreState(settings.value("TransferList/HeaderState").toByteArray());
header()->resizeSection(0, 200); // Default
}
return ok;
} }

View File

@@ -88,7 +88,7 @@ protected:
QModelIndex mapFromSource(const QModelIndex &index) const; QModelIndex mapFromSource(const QModelIndex &index) const;
QStringList getCustomLabels() const; QStringList getCustomLabels() const;
void saveSettings(); void saveSettings();
bool loadSettings(); void loadSettings();
QStringList getSelectedTorrentsHashes() const; QStringList getSelectedTorrentsHashes() const;
protected slots: protected slots:

View File

@@ -1,11 +1,11 @@
os2 { os2 {
DEFINES += VERSION=\'\"v2.6.9\"\' DEFINES += VERSION=\'\"v2.6.7\"\'
} else { } else {
DEFINES += VERSION=\\\"v2.6.9\\\" DEFINES += VERSION=\\\"v2.6.7\\\"
} }
DEFINES += VERSION_MAJOR=2 DEFINES += VERSION_MAJOR=2
DEFINES += VERSION_MINOR=6 DEFINES += VERSION_MINOR=6
DEFINES += VERSION_BUGFIX=9 DEFINES += VERSION_BUGFIX=7
# NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL # NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL
DEFINES += VERSION_TYPE=NORMAL DEFINES += VERSION_TYPE=NORMAL