mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 23:47:23 -06:00
Compare commits
13 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1858de2d6 | ||
|
|
414685910b | ||
|
|
d61b9c5d4d | ||
|
|
cf86a1cecd | ||
|
|
a3f3287e24 | ||
|
|
6e18d780ba | ||
|
|
7dde763fc6 | ||
|
|
8c85ffca5f | ||
|
|
321e568d86 | ||
|
|
e0649a7e78 | ||
|
|
4cd3233cd0 | ||
|
|
c554528afe | ||
|
|
7ab7f4b0fc |
@@ -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
|
* Sun Sep 26 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.2
|
||||||
- BUGFIX: Fix display of torrent content in addition dialog
|
- BUGFIX: Fix display of torrent content in addition dialog
|
||||||
- BUGFIX: Really fix manual editing of save path in torrent addition dialog
|
- BUGFIX: Really fix manual editing of save path in torrent addition dialog
|
||||||
|
|||||||
22
src/GUI.cpp
22
src/GUI.cpp
@@ -71,6 +71,7 @@
|
|||||||
void qt_mac_set_dock_menu(QMenu *menu);
|
void qt_mac_set_dock_menu(QMenu *menu);
|
||||||
#endif
|
#endif
|
||||||
#include "lineedit.h"
|
#include "lineedit.h"
|
||||||
|
#include "sessionapplication.h"
|
||||||
|
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
@@ -88,6 +89,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
|||||||
ui_locked = Preferences::isUILocked();
|
ui_locked = Preferences::isUILocked();
|
||||||
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
|
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
|
||||||
displaySpeedInTitle = Preferences::speedInTitleBar();
|
displaySpeedInTitle = Preferences::speedInTitleBar();
|
||||||
|
// Clean exit on log out
|
||||||
|
connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()));
|
||||||
// Setting icons
|
// Setting icons
|
||||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
|
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
|
||||||
actionOpen->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/open.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")));
|
actionSet_global_download_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/download.png")));
|
||||||
actionDocumentation->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/qb_question.png")));
|
actionDocumentation->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/qb_question.png")));
|
||||||
actionLock_qBittorrent->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/encrypted32.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..."));
|
QAction *defineUiLockPasswdAct = lockMenu->addAction(tr("Set the password..."));
|
||||||
connect(defineUiLockPasswdAct, SIGNAL(triggered()), this, SLOT(defineUILockPassword()));
|
connect(defineUiLockPasswdAct, SIGNAL(triggered()), this, SLOT(defineUILockPassword()));
|
||||||
actionLock_qBittorrent->setMenu(lockMenu);
|
actionLock_qBittorrent->setMenu(lockMenu);
|
||||||
@@ -248,6 +251,16 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GUI::deleteBTSession() {
|
||||||
|
guiUpdater->stop();
|
||||||
|
status_bar->stopTimer();
|
||||||
|
if(BTSession) {
|
||||||
|
delete BTSession;
|
||||||
|
BTSession = 0;
|
||||||
|
}
|
||||||
|
QTimer::singleShot(0, this, SLOT(close()));
|
||||||
|
}
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
GUI::~GUI() {
|
GUI::~GUI() {
|
||||||
qDebug("GUI destruction");
|
qDebug("GUI destruction");
|
||||||
@@ -258,7 +271,9 @@ GUI::~GUI() {
|
|||||||
#endif
|
#endif
|
||||||
// Async deletion of Bittorrent session as early as possible
|
// Async deletion of Bittorrent session as early as possible
|
||||||
// in order to speed up exit
|
// in order to speed up exit
|
||||||
session_proxy sp = BTSession->asyncDeletion();
|
session_proxy sp;
|
||||||
|
if(BTSession)
|
||||||
|
sp = BTSession->asyncDeletion();
|
||||||
// Some saving
|
// Some saving
|
||||||
properties->saveSettings();
|
properties->saveSettings();
|
||||||
disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(tab_changed(int)));
|
disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(tab_changed(int)));
|
||||||
@@ -269,6 +284,7 @@ GUI::~GUI() {
|
|||||||
delete search_filter;
|
delete search_filter;
|
||||||
delete transferList;
|
delete transferList;
|
||||||
delete guiUpdater;
|
delete guiUpdater;
|
||||||
|
delete lockMenu;
|
||||||
if(createTorrentDlg)
|
if(createTorrentDlg)
|
||||||
delete createTorrentDlg;
|
delete createTorrentDlg;
|
||||||
if(console)
|
if(console)
|
||||||
@@ -662,7 +678,7 @@ void GUI::closeEvent(QCloseEvent *e) {
|
|||||||
e->accept();
|
e->accept();
|
||||||
return;
|
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(e->spontaneous() || force_exit) {
|
||||||
if(!isVisible())
|
if(!isVisible())
|
||||||
show();
|
show();
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ public slots:
|
|||||||
void downloadFromURLList(const QStringList& urls);
|
void downloadFromURLList(const QStringList& urls);
|
||||||
void updateAltSpeedsBtn(bool alternative);
|
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 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:
|
protected slots:
|
||||||
// GUI related slots
|
// GUI related slots
|
||||||
@@ -170,6 +171,7 @@ private:
|
|||||||
QAction *prioSeparator2;
|
QAction *prioSeparator2;
|
||||||
QSplitter *hSplitter;
|
QSplitter *hSplitter;
|
||||||
QSplitter *vSplitter;
|
QSplitter *vSplitter;
|
||||||
|
QMenu *lockMenu;
|
||||||
// Search
|
// Search
|
||||||
QPointer<SearchEngine> searchEngine;
|
QPointer<SearchEngine> searchEngine;
|
||||||
// RSS
|
// RSS
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Categories=Qt;Network;P2P;
|
Categories=Qt;Network;P2P;
|
||||||
Comment=V2.4.2
|
Comment=V2.4.4
|
||||||
Exec=qbittorrent %f
|
Exec=qbittorrent %f
|
||||||
GenericName=Bittorrent client
|
GenericName=Bittorrent client
|
||||||
GenericName[ar]=العميل Bittorrent
|
GenericName[ar]=العميل Bittorrent
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
@@ -47,7 +47,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>2.4.2</string>
|
<string>2.4.4</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ Bittorrent::~Bittorrent() {
|
|||||||
#endif
|
#endif
|
||||||
saveSessionState();
|
saveSessionState();
|
||||||
saveFastResumeData();
|
saveFastResumeData();
|
||||||
|
qDebug("Deleting the session");
|
||||||
// Delete session
|
// Delete session
|
||||||
session_proxy sp = s->abort();
|
session_proxy sp = s->abort();
|
||||||
delete s;
|
delete s;
|
||||||
@@ -1541,6 +1542,7 @@ void Bittorrent::saveTempFastResumeData() {
|
|||||||
// Only save fast resume data for unfinished and unpaused torrents (Optimization)
|
// Only save fast resume data for unfinished and unpaused torrents (Optimization)
|
||||||
// Called periodically and on exit
|
// Called periodically and on exit
|
||||||
void Bittorrent::saveFastResumeData() {
|
void Bittorrent::saveFastResumeData() {
|
||||||
|
qDebug("Saving fast resume data...");
|
||||||
// Stop listening for alerts
|
// Stop listening for alerts
|
||||||
resumeDataTimer.stop();
|
resumeDataTimer.stop();
|
||||||
timerAlerts->stop();
|
timerAlerts->stop();
|
||||||
|
|||||||
@@ -270,6 +270,7 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
|
|||||||
// Backup in case install fails
|
// Backup in case install fails
|
||||||
QFile::copy(dest_path, dest_path+".bak");
|
QFile::copy(dest_path, dest_path+".bak");
|
||||||
misc::safeRemove(dest_path);
|
misc::safeRemove(dest_path);
|
||||||
|
misc::safeRemove(dest_path+"c");
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
// Copy the plugin
|
// Copy the plugin
|
||||||
|
|||||||
20
src/main.cpp
20
src/main.cpp
@@ -38,11 +38,7 @@
|
|||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QSplashScreen>
|
#include <QSplashScreen>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#ifdef Q_WS_MAC
|
#include "sessionapplication.h"
|
||||||
#include "qmacapplication.h"
|
|
||||||
#else
|
|
||||||
#include "qtsingleapplication.h"
|
|
||||||
#endif
|
|
||||||
#include "GUI.h"
|
#include "GUI.h"
|
||||||
#include "ico.h"
|
#include "ico.h"
|
||||||
#else
|
#else
|
||||||
@@ -160,15 +156,11 @@ void useStyle(QString style){
|
|||||||
int main(int argc, char *argv[]){
|
int main(int argc, char *argv[]){
|
||||||
// Create Application
|
// Create Application
|
||||||
QString uid = misc::getUserIDString();
|
QString uid = misc::getUserIDString();
|
||||||
#ifdef DISABLE_GUI
|
#ifdef DISABLE_GUI
|
||||||
QtSingleCoreApplication app("qBittorrent-"+uid, argc, argv);
|
QtSingleCoreApplication app("qBittorrent-"+uid, argc, argv);
|
||||||
#else
|
#else
|
||||||
#ifndef Q_WS_MAC
|
SessionApplication app("qBittorrent-"+uid, argc, argv);
|
||||||
QtSingleApplication app("qBittorrent-"+uid, argc, argv);
|
#endif
|
||||||
#else
|
|
||||||
QMacApplication app("qBittorrent-"+uid, argc, argv);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Check if qBittorrent is already running for this user
|
// Check if qBittorrent is already running for this user
|
||||||
if(app.isRunning()) {
|
if(app.isRunning()) {
|
||||||
@@ -178,7 +170,7 @@ int main(int argc, char *argv[]){
|
|||||||
for (int a = 1; a < argc; ++a) {
|
for (int a = 1; a < argc; ++a) {
|
||||||
QString p = QString::fromLocal8Bit(argv[a]);
|
QString p = QString::fromLocal8Bit(argv[a]);
|
||||||
if(p.startsWith("--")) continue;
|
if(p.startsWith("--")) continue;
|
||||||
message += argv[a];
|
message += p;
|
||||||
if (a < argc-1)
|
if (a < argc-1)
|
||||||
message += "|";
|
message += "|";
|
||||||
}
|
}
|
||||||
|
|||||||
14
src/misc.cpp
14
src/misc.cpp
@@ -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) {
|
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;
|
if(old_label == new_label) return save_path;
|
||||||
qDebug("UpdateLabelInSavePath(%s, %s, %s)", qPrintable(save_path), qPrintable(old_label), qPrintable(new_label));
|
qDebug("UpdateLabelInSavePath(%s, %s, %s)", qPrintable(save_path), qPrintable(old_label), qPrintable(new_label));
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <boost/date_time/posix_time/conversion.hpp>
|
#include <boost/date_time/posix_time/conversion.hpp>
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QDir>
|
||||||
|
|
||||||
#include <libtorrent/torrent_info.hpp>
|
#include <libtorrent/torrent_info.hpp>
|
||||||
#include <libtorrent/torrent_handle.hpp>
|
#include <libtorrent/torrent_handle.hpp>
|
||||||
@@ -75,6 +76,8 @@ public:
|
|||||||
return QString(o.str().c_str());
|
return QString(o.str().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void chmod644(const QDir& folder);
|
||||||
|
|
||||||
static inline QString removeLastPathPart(QString path) {
|
static inline QString removeLastPathPart(QString path) {
|
||||||
if(path.isEmpty()) return path;
|
if(path.isEmpty()) return path;
|
||||||
path = path.replace("\\", "/");
|
path = path.replace("\\", "/");
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#VERSION: 1.04
|
#VERSION: 1.06
|
||||||
#AUTHORS: Christophe Dumez (chris@qbittorrent.org)
|
#AUTHORS: Christophe Dumez (chris@qbittorrent.org)
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@@ -72,6 +72,8 @@ class torrentdownloads(object):
|
|||||||
self.current_item = None
|
self.current_item = None
|
||||||
self.results = results
|
self.results = results
|
||||||
self.what = what.upper().split('+')
|
self.what = what.upper().split('+')
|
||||||
|
if len(self.what) == 0:
|
||||||
|
self.what = None
|
||||||
|
|
||||||
def start_a(self, attr):
|
def start_a(self, attr):
|
||||||
params = dict(attr)
|
params = dict(attr)
|
||||||
@@ -113,8 +115,9 @@ class torrentdownloads(object):
|
|||||||
self.current_item['leech'] = 0
|
self.current_item['leech'] = 0
|
||||||
# Search should use AND operator as a default
|
# Search should use AND operator as a default
|
||||||
tmp = self.current_item['name'].upper();
|
tmp = self.current_item['name'].upper();
|
||||||
for w in self.what:
|
if self.what is not None:
|
||||||
if tmp.find(w) < 0: return
|
for w in self.what:
|
||||||
|
if tmp.find(w) < 0: return
|
||||||
prettyPrinter(self.current_item)
|
prettyPrinter(self.current_item)
|
||||||
self.results.append('a')
|
self.results.append('a')
|
||||||
|
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ btjunkie: 2.21
|
|||||||
mininova: 1.40
|
mininova: 1.40
|
||||||
piratebay: 1.30
|
piratebay: 1.30
|
||||||
vertor: 1.0
|
vertor: 1.0
|
||||||
torrentdownloads: 1.04
|
torrentdownloads: 1.06
|
||||||
|
|||||||
@@ -484,8 +484,10 @@ void SearchEngine::updateNova() {
|
|||||||
// Copy search plugin files (if necessary)
|
// Copy search plugin files (if necessary)
|
||||||
QString filePath = search_dir.absoluteFilePath("nova2.py");
|
QString filePath = search_dir.absoluteFilePath("nova2.py");
|
||||||
if(getPluginVersion(":/search_engine/nova2.py") > getPluginVersion(filePath)) {
|
if(getPluginVersion(":/search_engine/nova2.py") > getPluginVersion(filePath)) {
|
||||||
if(QFile::exists(filePath))
|
if(QFile::exists(filePath)) {
|
||||||
misc::safeRemove(filePath);
|
misc::safeRemove(filePath);
|
||||||
|
misc::safeRemove(filePath+"c");
|
||||||
|
}
|
||||||
QFile::copy(":/search_engine/nova2.py", filePath);
|
QFile::copy(":/search_engine/nova2.py", filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,6 +495,7 @@ void SearchEngine::updateNova() {
|
|||||||
if(getPluginVersion(":/search_engine/nova2dl.py") > getPluginVersion(filePath)) {
|
if(getPluginVersion(":/search_engine/nova2dl.py") > getPluginVersion(filePath)) {
|
||||||
if(QFile::exists(filePath)){
|
if(QFile::exists(filePath)){
|
||||||
misc::safeRemove(filePath);
|
misc::safeRemove(filePath);
|
||||||
|
misc::safeRemove(filePath+"c");
|
||||||
}
|
}
|
||||||
QFile::copy(":/search_engine/nova2dl.py", filePath);
|
QFile::copy(":/search_engine/nova2dl.py", filePath);
|
||||||
}
|
}
|
||||||
@@ -501,6 +504,7 @@ void SearchEngine::updateNova() {
|
|||||||
if(getPluginVersion(":/search_engine/novaprinter.py") > getPluginVersion(filePath)) {
|
if(getPluginVersion(":/search_engine/novaprinter.py") > getPluginVersion(filePath)) {
|
||||||
if(QFile::exists(filePath)){
|
if(QFile::exists(filePath)){
|
||||||
misc::safeRemove(filePath);
|
misc::safeRemove(filePath);
|
||||||
|
misc::safeRemove(filePath+"c");
|
||||||
}
|
}
|
||||||
QFile::copy(":/search_engine/novaprinter.py", filePath);
|
QFile::copy(":/search_engine/novaprinter.py", filePath);
|
||||||
}
|
}
|
||||||
@@ -509,6 +513,7 @@ void SearchEngine::updateNova() {
|
|||||||
if(getPluginVersion(":/search_engine/helpers.py") > getPluginVersion(filePath)) {
|
if(getPluginVersion(":/search_engine/helpers.py") > getPluginVersion(filePath)) {
|
||||||
if(QFile::exists(filePath)){
|
if(QFile::exists(filePath)){
|
||||||
misc::safeRemove(filePath);
|
misc::safeRemove(filePath);
|
||||||
|
misc::safeRemove(filePath+"c");
|
||||||
}
|
}
|
||||||
QFile::copy(":/search_engine/helpers.py", filePath);
|
QFile::copy(":/search_engine/helpers.py", filePath);
|
||||||
}
|
}
|
||||||
@@ -530,6 +535,7 @@ void SearchEngine::updateNova() {
|
|||||||
if(QFile::exists(dest_file)) {
|
if(QFile::exists(dest_file)) {
|
||||||
qDebug("Removing old %s", qPrintable(dest_file));
|
qDebug("Removing old %s", qPrintable(dest_file));
|
||||||
misc::safeRemove(dest_file);
|
misc::safeRemove(dest_file);
|
||||||
|
misc::safeRemove(dest_file+"c");
|
||||||
}
|
}
|
||||||
qDebug("%s copied to %s", qPrintable(shipped_file), qPrintable(dest_file));
|
qDebug("%s copied to %s", qPrintable(shipped_file), qPrintable(dest_file));
|
||||||
QFile::copy(shipped_file, 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
|
// Slot called when search is Finished
|
||||||
|
|||||||
39
src/sessionapplication.h
Normal file
39
src/sessionapplication.h
Normal 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
|
||||||
@@ -12,13 +12,13 @@ CONFIG += qt \
|
|||||||
|
|
||||||
# Update this VERSION for each release
|
# Update this VERSION for each release
|
||||||
os2 {
|
os2 {
|
||||||
DEFINES += VERSION=\'\"v2.4.2\"\'
|
DEFINES += VERSION=\'\"v2.4.4\"\'
|
||||||
} else {
|
} else {
|
||||||
DEFINES += VERSION=\\\"v2.4.2\\\"
|
DEFINES += VERSION=\\\"v2.4.4\\\"
|
||||||
}
|
}
|
||||||
DEFINES += VERSION_MAJOR=2
|
DEFINES += VERSION_MAJOR=2
|
||||||
DEFINES += VERSION_MINOR=4
|
DEFINES += VERSION_MINOR=4
|
||||||
DEFINES += VERSION_BUGFIX=2
|
DEFINES += VERSION_BUGFIX=4
|
||||||
|
|
||||||
# NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL
|
# NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL
|
||||||
DEFINES += VERSION_TYPE=NORMAL
|
DEFINES += VERSION_TYPE=NORMAL
|
||||||
@@ -342,7 +342,8 @@ contains(DEFINES, DISABLE_GUI) {
|
|||||||
advancedsettings.h \
|
advancedsettings.h \
|
||||||
cookiesdlg.h \
|
cookiesdlg.h \
|
||||||
rsssettings.h \
|
rsssettings.h \
|
||||||
hidabletabwidget.h
|
hidabletabwidget.h \
|
||||||
|
sessionapplication.h
|
||||||
|
|
||||||
macx {
|
macx {
|
||||||
HEADERS += qmacapplication.h
|
HEADERS += qmacapplication.h
|
||||||
|
|||||||
@@ -170,6 +170,10 @@ public slots:
|
|||||||
bar->insertWidget(1, new QLabel(tr("qBittorrent needs to be restarted")));
|
bar->insertWidget(1, new QLabel(tr("qBittorrent needs to be restarted")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void stopTimer() {
|
||||||
|
refreshTimer->stop();
|
||||||
|
}
|
||||||
|
|
||||||
void refreshStatusBar() {
|
void refreshStatusBar() {
|
||||||
// Update connection status
|
// Update connection status
|
||||||
session_status sessionStatus = BTSession->getSessionStatus();
|
session_status sessionStatus = BTSession->getSessionStatus();
|
||||||
|
|||||||
@@ -120,9 +120,13 @@ void torrentAdditionDialog::saveSettings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void torrentAdditionDialog::renameTorrentNameInModel(QString file_path) {
|
void torrentAdditionDialog::renameTorrentNameInModel(QString file_path) {
|
||||||
|
file_path = file_path.trimmed();
|
||||||
|
if(file_path.isEmpty()) return;
|
||||||
file_path = file_path.replace("\\", "/");
|
file_path = file_path.replace("\\", "/");
|
||||||
// Rename in torrent files model too
|
// 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() {
|
void torrentAdditionDialog::limitDialogWidth() {
|
||||||
|
|||||||
@@ -584,10 +584,17 @@ inline QString TransferListWidget::getHashFromRow(int row) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline QModelIndex TransferListWidget::mapToSource(const QModelIndex &index) 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 {
|
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)));
|
return nameFilterModel->mapFromSource(statusFilterModel->mapFromSource(labelFilterModel->mapFromSource(index)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1426,6 +1433,7 @@ void TransferListWidget::loadLastSortedColumn() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TransferListWidget::currentChanged(const QModelIndex& current, const QModelIndex&) {
|
void TransferListWidget::currentChanged(const QModelIndex& current, const QModelIndex&) {
|
||||||
|
qDebug("CURRENT CHANGED");
|
||||||
QTorrentHandle h;
|
QTorrentHandle h;
|
||||||
if(current.isValid()) {
|
if(current.isValid()) {
|
||||||
const int row = mapToSource(current).row();
|
const int row = mapToSource(current).row();
|
||||||
|
|||||||
Reference in New Issue
Block a user