mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Fix crash in torrent addition dialog when save path does not exist (closes #425227)
- Fix downloading from URL (broken in v1.5.0)
This commit is contained in:
parent
095dfe5b9e
commit
37158a32ad
4 changed files with 19 additions and 5 deletions
10
src/misc.h
10
src/misc.h
|
@ -99,11 +99,17 @@ public:
|
|||
}
|
||||
|
||||
|
||||
static unsigned long long freeDiskSpaceOnPath(QString path) {
|
||||
static long long freeDiskSpaceOnPath(QString path) {
|
||||
if(path.isEmpty()) return -1;
|
||||
QDir dir_path(path);
|
||||
if(!dir_path.exists()) {
|
||||
if(!dir_path.cdUp()) return -1;
|
||||
}
|
||||
Q_ASSERT(dir_path.exists());
|
||||
#ifndef Q_WS_WIN
|
||||
unsigned long long available;
|
||||
struct statfs stats;
|
||||
int ret = statfs ((path+"/.").toLocal8Bit().data(), &stats) ;
|
||||
int ret = statfs ((dir_path.path()+"/.").toLocal8Bit().data(), &stats) ;
|
||||
if(ret == 0) {
|
||||
available = ((unsigned long long)stats.f_bavail) *
|
||||
((unsigned long long)stats.f_bsize) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue