Compare commits

..

13 Commits

Author SHA1 Message Date
Christophe Dumez
d1858de2d6 Tagged v2.4.4 release 2010-10-01 21:04:05 +00:00
Christophe Dumez
414685910b Fix to last commit 2010-10-01 20:52:53 +00:00
Christophe Dumez
d61b9c5d4d Bump to v2.4.4 2010-10-01 20:22:20 +00:00
Christophe Dumez
cf86a1cecd BUGFIX: Fix possible search engine plugin update 2010-10-01 20:19:17 +00:00
Christophe Dumez
a3f3287e24 Clean program exit on system shutdown/log out 2010-10-01 20:05:54 +00:00
Christophe Dumez
6e18d780ba Updated Changelog 2010-09-28 16:57:31 +00:00
Christophe Dumez
7dde763fc6 Fix wrong mapping to source model 2010-09-28 16:56:49 +00:00
Christophe Dumez
8c85ffca5f Fix tiny memory leak 2010-09-27 20:47:26 +00:00
Christophe Dumez
321e568d86 TorrentDownloads performance improvement 2010-09-27 19:48:58 +00:00
Christophe Dumez
e0649a7e78 Bump to v2.4.3 2010-09-27 17:49:33 +00:00
Christophe Dumez
4cd3233cd0 Better fix for encoding issue 2010-09-27 17:36:42 +00:00
Christophe Dumez
c554528afe BUGFIX: Fix possible crash when changing the save path in addition dialog 2010-09-27 17:35:34 +00:00
Christophe Dumez
7ab7f4b0fc BUGFIX: Fix encoding issue in command line parameters processing 2010-09-27 17:19:27 +00:00
19 changed files with 138 additions and 30 deletions

View File

@@ -1,3 +1,12 @@
* Fri Oct 1 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.4
- BUGFIX: Clean program exit on system shutdown/logout
- BUGFIX: Fix possible search engine plugin update
* Tue Sep 28 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.3
- BUGFIX: Fix encoding issue in command line parameters processing
- BUGFIX: Fix possible crash when changing the save path in addition dialog
- BUGFIX: Fix wrong mapping to source model
* Sun Sep 26 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.2
- BUGFIX: Fix display of torrent content in addition dialog
- BUGFIX: Really fix manual editing of save path in torrent addition dialog

View File

@@ -71,6 +71,7 @@
void qt_mac_set_dock_menu(QMenu *menu);
#endif
#include "lineedit.h"
#include "sessionapplication.h"
using namespace libtorrent;
@@ -88,6 +89,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
ui_locked = Preferences::isUILocked();
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
displaySpeedInTitle = Preferences::speedInTitleBar();
// Clean exit on log out
connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()));
// Setting icons
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
actionOpen->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/open.png")));
@@ -110,7 +113,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
actionSet_global_download_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/download.png")));
actionDocumentation->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/qb_question.png")));
actionLock_qBittorrent->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/encrypted32.png")));
QMenu *lockMenu = new QMenu();
lockMenu = new QMenu();
QAction *defineUiLockPasswdAct = lockMenu->addAction(tr("Set the password..."));
connect(defineUiLockPasswdAct, SIGNAL(triggered()), this, SLOT(defineUILockPassword()));
actionLock_qBittorrent->setMenu(lockMenu);
@@ -248,6 +251,16 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
#endif
}
void GUI::deleteBTSession() {
guiUpdater->stop();
status_bar->stopTimer();
if(BTSession) {
delete BTSession;
BTSession = 0;
}
QTimer::singleShot(0, this, SLOT(close()));
}
// Destructor
GUI::~GUI() {
qDebug("GUI destruction");
@@ -258,7 +271,9 @@ GUI::~GUI() {
#endif
// Async deletion of Bittorrent session as early as possible
// in order to speed up exit
session_proxy sp = BTSession->asyncDeletion();
session_proxy sp;
if(BTSession)
sp = BTSession->asyncDeletion();
// Some saving
properties->saveSettings();
disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(tab_changed(int)));
@@ -269,6 +284,7 @@ GUI::~GUI() {
delete search_filter;
delete transferList;
delete guiUpdater;
delete lockMenu;
if(createTorrentDlg)
delete createTorrentDlg;
if(console)
@@ -662,7 +678,7 @@ void GUI::closeEvent(QCloseEvent *e) {
e->accept();
return;
}
if(settings.value(QString::fromUtf8("Preferences/General/ExitConfirm"), true).toBool() && BTSession->hasActiveTorrents()) {
if(settings.value(QString::fromUtf8("Preferences/General/ExitConfirm"), true).toBool() && BTSession && BTSession->hasActiveTorrents()) {
if(e->spontaneous() || force_exit) {
if(!isVisible())
show();

View File

@@ -80,6 +80,7 @@ public slots:
void downloadFromURLList(const QStringList& urls);
void updateAltSpeedsBtn(bool alternative);
void updateNbTorrents(unsigned int nb_downloading, unsigned int nb_seeding, unsigned int nb_active, unsigned int nb_inactive, unsigned int nb_paused);
void deleteBTSession();
protected slots:
// GUI related slots
@@ -170,6 +171,7 @@ private:
QAction *prioSeparator2;
QSplitter *hSplitter;
QSplitter *vSplitter;
QMenu *lockMenu;
// Search
QPointer<SearchEngine> searchEngine;
// RSS

View File

@@ -1,6 +1,6 @@
[Desktop Entry]
Categories=Qt;Network;P2P;
Comment=V2.4.2
Comment=V2.4.4
Exec=qbittorrent %f
GenericName=Bittorrent client
GenericName[ar]=العميل Bittorrent

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View File

@@ -47,7 +47,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>2.4.2</string>
<string>2.4.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>

View File

@@ -165,6 +165,7 @@ Bittorrent::~Bittorrent() {
#endif
saveSessionState();
saveFastResumeData();
qDebug("Deleting the session");
// Delete session
session_proxy sp = s->abort();
delete s;
@@ -1541,6 +1542,7 @@ void Bittorrent::saveTempFastResumeData() {
// Only save fast resume data for unfinished and unpaused torrents (Optimization)
// Called periodically and on exit
void Bittorrent::saveFastResumeData() {
qDebug("Saving fast resume data...");
// Stop listening for alerts
resumeDataTimer.stop();
timerAlerts->stop();

View File

@@ -270,6 +270,7 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
// Backup in case install fails
QFile::copy(dest_path, dest_path+".bak");
misc::safeRemove(dest_path);
misc::safeRemove(dest_path+"c");
update = true;
}
// Copy the plugin

View File

@@ -38,11 +38,7 @@
#include <QStyle>
#include <QSplashScreen>
#include <QPushButton>
#ifdef Q_WS_MAC
#include "qmacapplication.h"
#else
#include "qtsingleapplication.h"
#endif
#include "sessionapplication.h"
#include "GUI.h"
#include "ico.h"
#else
@@ -160,15 +156,11 @@ void useStyle(QString style){
int main(int argc, char *argv[]){
// Create Application
QString uid = misc::getUserIDString();
#ifdef DISABLE_GUI
#ifdef DISABLE_GUI
QtSingleCoreApplication app("qBittorrent-"+uid, argc, argv);
#else
#ifndef Q_WS_MAC
QtSingleApplication app("qBittorrent-"+uid, argc, argv);
#else
QMacApplication app("qBittorrent-"+uid, argc, argv);
#endif
#endif
#else
SessionApplication app("qBittorrent-"+uid, argc, argv);
#endif
// Check if qBittorrent is already running for this user
if(app.isRunning()) {
@@ -178,7 +170,7 @@ int main(int argc, char *argv[]){
for (int a = 1; a < argc; ++a) {
QString p = QString::fromLocal8Bit(argv[a]);
if(p.startsWith("--")) continue;
message += argv[a];
message += p;
if (a < argc-1)
message += "|";
}

View File

@@ -363,6 +363,20 @@ void misc::copyDir(QString src_path, QString dst_path) {
}
}
void misc::chmod644(const QDir& folder) {
qDebug("chmod644(%s)", qPrintable(folder.absolutePath()));
if(!folder.exists()) return;
foreach(const QFileInfo &fi, folder.entryInfoList(QDir::Dirs|QDir::Files|QDir::NoSymLinks)) {
if(fi.fileName().startsWith(".")) continue;
if(fi.isDir()) {
misc::chmod644(QDir(fi.absoluteFilePath()));
} else {
QFile f(fi.absoluteFilePath());
f.setPermissions(f.permissions()|QFile::ReadUser|QFile::WriteUser|QFile::ReadGroup|QFile::ReadOther);
}
}
}
QString misc::updateLabelInSavePath(const QString& defaultSavePath, QString save_path, const QString old_label, const QString new_label) {
if(old_label == new_label) return save_path;
qDebug("UpdateLabelInSavePath(%s, %s, %s)", qPrintable(save_path), qPrintable(old_label), qPrintable(new_label));

View File

@@ -40,6 +40,7 @@
#include <boost/date_time/posix_time/conversion.hpp>
#include <QPoint>
#include <QFile>
#include <QDir>
#include <libtorrent/torrent_info.hpp>
#include <libtorrent/torrent_handle.hpp>
@@ -75,6 +76,8 @@ public:
return QString(o.str().c_str());
}
static void chmod644(const QDir& folder);
static inline QString removeLastPathPart(QString path) {
if(path.isEmpty()) return path;
path = path.replace("\\", "/");

View File

@@ -1,4 +1,4 @@
#VERSION: 1.04
#VERSION: 1.06
#AUTHORS: Christophe Dumez (chris@qbittorrent.org)
# Redistribution and use in source and binary forms, with or without
@@ -72,6 +72,8 @@ class torrentdownloads(object):
self.current_item = None
self.results = results
self.what = what.upper().split('+')
if len(self.what) == 0:
self.what = None
def start_a(self, attr):
params = dict(attr)
@@ -113,8 +115,9 @@ class torrentdownloads(object):
self.current_item['leech'] = 0
# Search should use AND operator as a default
tmp = self.current_item['name'].upper();
for w in self.what:
if tmp.find(w) < 0: return
if self.what is not None:
for w in self.what:
if tmp.find(w) < 0: return
prettyPrinter(self.current_item)
self.results.append('a')

View File

@@ -4,4 +4,4 @@ btjunkie: 2.21
mininova: 1.40
piratebay: 1.30
vertor: 1.0
torrentdownloads: 1.04
torrentdownloads: 1.06

View File

@@ -484,8 +484,10 @@ void SearchEngine::updateNova() {
// Copy search plugin files (if necessary)
QString filePath = search_dir.absoluteFilePath("nova2.py");
if(getPluginVersion(":/search_engine/nova2.py") > getPluginVersion(filePath)) {
if(QFile::exists(filePath))
if(QFile::exists(filePath)) {
misc::safeRemove(filePath);
misc::safeRemove(filePath+"c");
}
QFile::copy(":/search_engine/nova2.py", filePath);
}
@@ -493,6 +495,7 @@ void SearchEngine::updateNova() {
if(getPluginVersion(":/search_engine/nova2dl.py") > getPluginVersion(filePath)) {
if(QFile::exists(filePath)){
misc::safeRemove(filePath);
misc::safeRemove(filePath+"c");
}
QFile::copy(":/search_engine/nova2dl.py", filePath);
}
@@ -501,6 +504,7 @@ void SearchEngine::updateNova() {
if(getPluginVersion(":/search_engine/novaprinter.py") > getPluginVersion(filePath)) {
if(QFile::exists(filePath)){
misc::safeRemove(filePath);
misc::safeRemove(filePath+"c");
}
QFile::copy(":/search_engine/novaprinter.py", filePath);
}
@@ -509,6 +513,7 @@ void SearchEngine::updateNova() {
if(getPluginVersion(":/search_engine/helpers.py") > getPluginVersion(filePath)) {
if(QFile::exists(filePath)){
misc::safeRemove(filePath);
misc::safeRemove(filePath+"c");
}
QFile::copy(":/search_engine/helpers.py", filePath);
}
@@ -530,6 +535,7 @@ void SearchEngine::updateNova() {
if(QFile::exists(dest_file)) {
qDebug("Removing old %s", qPrintable(dest_file));
misc::safeRemove(dest_file);
misc::safeRemove(dest_file+"c");
}
qDebug("%s copied to %s", qPrintable(shipped_file), qPrintable(dest_file));
QFile::copy(shipped_file, dest_file);
@@ -543,6 +549,10 @@ void SearchEngine::updateNova() {
}
}
}
#ifndef Q_WS_WIN
// Fix permissions
misc::chmod644(QDir(misc::searchEngineLocation()));
#endif
}
// Slot called when search is Finished

39
src/sessionapplication.h Normal file
View File

@@ -0,0 +1,39 @@
#ifndef SESSIONAPPLICATION_H
#define SESSIONAPPLICATION_H
#ifdef Q_WS_MAC
#include "qmacapplication.h"
#else
#include "qtsingleapplication.h"
#endif
#include <QSessionManager>
class SessionApplication :
#ifdef Q_WS_MAC
public QMacApplication
#else
public QtSingleApplication
#endif
{
Q_OBJECT
public:
SessionApplication(const QString &id, int &argc, char **argv) :
#ifdef Q_WS_MAC
QMacApplication(id, argc, argv)
#else
QtSingleApplication(id, argc, argv)
#endif
{}
void commitData(QSessionManager & manager) {
Q_UNUSED(manager);
emit sessionIsShuttingDown();
}
signals:
void sessionIsShuttingDown();
};
#endif // SESSIONAPPLICATION_H

View File

@@ -12,13 +12,13 @@ CONFIG += qt \
# Update this VERSION for each release
os2 {
DEFINES += VERSION=\'\"v2.4.2\"\'
DEFINES += VERSION=\'\"v2.4.4\"\'
} else {
DEFINES += VERSION=\\\"v2.4.2\\\"
DEFINES += VERSION=\\\"v2.4.4\\\"
}
DEFINES += VERSION_MAJOR=2
DEFINES += VERSION_MINOR=4
DEFINES += VERSION_BUGFIX=2
DEFINES += VERSION_BUGFIX=4
# NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL
DEFINES += VERSION_TYPE=NORMAL
@@ -342,7 +342,8 @@ contains(DEFINES, DISABLE_GUI) {
advancedsettings.h \
cookiesdlg.h \
rsssettings.h \
hidabletabwidget.h
hidabletabwidget.h \
sessionapplication.h
macx {
HEADERS += qmacapplication.h

View File

@@ -170,6 +170,10 @@ public slots:
bar->insertWidget(1, new QLabel(tr("qBittorrent needs to be restarted")));
}
void stopTimer() {
refreshTimer->stop();
}
void refreshStatusBar() {
// Update connection status
session_status sessionStatus = BTSession->getSessionStatus();

View File

@@ -120,9 +120,13 @@ void torrentAdditionDialog::saveSettings() {
}
void torrentAdditionDialog::renameTorrentNameInModel(QString file_path) {
file_path = file_path.trimmed();
if(file_path.isEmpty()) return;
file_path = file_path.replace("\\", "/");
// Rename in torrent files model too
PropListModel->setData(PropListModel->index(0, 0), file_path.split("/", QString::SkipEmptyParts).last());
QStringList parts = file_path.split("/", QString::SkipEmptyParts);
if(!parts.empty())
PropListModel->setData(PropListModel->index(0, 0), parts.last());
}
void torrentAdditionDialog::limitDialogWidth() {

View File

@@ -584,10 +584,17 @@ inline QString TransferListWidget::getHashFromRow(int row) const {
}
inline QModelIndex TransferListWidget::mapToSource(const QModelIndex &index) const {
return labelFilterModel->mapToSource(statusFilterModel->mapToSource(nameFilterModel->mapToSource(index)));
Q_ASSERT(index.isValid());
if(index.model() == nameFilterModel)
return labelFilterModel->mapToSource(statusFilterModel->mapToSource(nameFilterModel->mapToSource(index)));
if(index.model() == statusFilterModel)
return labelFilterModel->mapToSource(statusFilterModel->mapToSource(index));
return labelFilterModel->mapToSource(index);
}
inline QModelIndex TransferListWidget::mapFromSource(const QModelIndex &index) const {
Q_ASSERT(index.isValid());
Q_ASSERT(index.model() == labelFilterModel);
return nameFilterModel->mapFromSource(statusFilterModel->mapFromSource(labelFilterModel->mapFromSource(index)));
}
@@ -1426,6 +1433,7 @@ void TransferListWidget::loadLastSortedColumn() {
}
void TransferListWidget::currentChanged(const QModelIndex& current, const QModelIndex&) {
qDebug("CURRENT CHANGED");
QTorrentHandle h;
if(current.isValid()) {
const int row = mapToSource(current).row();