File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616#include < sys/param.h>
1717#include < sys/mount.h>
1818#include < string.h>
19- #else
19+ #elif !defined Q_WS_HAIKU
2020#include < sys/vfs.h>
2121#endif
2222#endif
@@ -56,7 +56,7 @@ class FileSystemWatcher: public QFileSystemWatcher {
5656 QHash<QString, int > m_partialTorrents;
5757 QPointer<QTimer> m_partialTorrentTimer;
5858
59- #ifndef Q_OS_WIN
59+ #if !defined Q_WS_WIN && !defined Q_WS_HAIKU
6060private:
6161 static bool isNetworkFileSystem (QString path) {
6262 QString file = path;
@@ -145,7 +145,7 @@ class FileSystemWatcher: public QFileSystemWatcher {
145145 }
146146
147147 void addPath (const QString & path) {
148- #ifndef Q_OS_WIN
148+ #if !defined Q_WS_WIN && !defined Q_WS_HAIKU
149149 QDir dir (path);
150150 if (!dir.exists ())
151151 return ;
@@ -167,7 +167,7 @@ class FileSystemWatcher: public QFileSystemWatcher {
167167 qDebug (" FS Watching is watching %s in normal mode" , qPrintable (path));
168168 QFileSystemWatcher::addPath (path);
169169 scanLocalFolder (path);
170- #ifndef Q_OS_WIN
170+ #if !defined Q_WS_WIN && !defined Q_WS_HAIKU
171171 }
172172#endif
173173 }
Original file line number Diff line number Diff line change 5252#if defined(Q_OS_MAC) || defined(Q_OS_FREEBSD)
5353#include < sys/param.h>
5454#include < sys/mount.h>
55+ #elif defined(Q_WS_HAIKU)
56+ #include < kernel/fs_info.h>
5557#else
5658#include < sys/vfs.h>
5759#endif
@@ -289,6 +291,18 @@ long long fsutils::freeDiskSpaceOnPath(QString path) {
289291
290292#ifndef Q_OS_WIN
291293 unsigned long long available;
294+ #ifdef Q_WS_HAIKU
295+ const QString statfs_path = dir_path.path ()+" /." ;
296+ dev_t device = dev_for_path (qPrintable (statfs_path));
297+ if (device >= 0 ) {
298+ fs_info info;
299+ if (fs_stat_dev (device, &info)==B_OK ){
300+ available = ((unsigned long long )(info.free_blocks *info.block_size ));
301+ return available;
302+ }
303+ }
304+ return -1 ;
305+ #else
292306 struct statfs stats;
293307 const QString statfs_path = dir_path.path ()+" /." ;
294308 const int ret = statfs (qPrintable (statfs_path), &stats) ;
@@ -299,6 +313,7 @@ long long fsutils::freeDiskSpaceOnPath(QString path) {
299313 } else {
300314 return -1 ;
301315 }
316+ #endif
302317#else
303318 typedef BOOL (WINAPI *GetDiskFreeSpaceEx_t)(LPCTSTR ,
304319 PULARGE_INTEGER ,
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ void sigtermHandler(int) {
156156void sigsegvHandler (int ) {
157157 signal (SIGABRT , 0 );
158158 signal (SIGSEGV , 0 );
159- #ifndef Q_OS_WIN
159+ #if !defined Q_WS_WIN && !defined Q_WS_HAIKU
160160 std::cerr << " \n\n *************************************************************\n " ;
161161 std::cerr << " Catching SIGSEGV, please report a bug at http://bug.qbittorrent.org\n and provide the following backtrace:\n " ;
162162 std::cerr << " qBittorrent version: " << VERSION << std::endl;
@@ -173,7 +173,7 @@ void sigsegvHandler(int) {
173173void sigabrtHandler (int ) {
174174 signal (SIGABRT , 0 );
175175 signal (SIGSEGV , 0 );
176- #ifndef Q_OS_WIN
176+ #if !defined Q_WS_WIN && !defined Q_WS_HAIKU
177177 std::cerr << " \n\n *************************************************************\n " ;
178178 std::cerr << " Catching SIGABRT, please report a bug at http://bug.qbittorrent.org\n and provide the following backtrace:\n " ;
179179 std::cerr << " qBittorrent version: " << VERSION << std::endl;
Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ exists($$OUT_PWD/../conf.pri) {
1515}
1616
1717QMAKE_CXXFLAGS += -Wformat -Wformat-security
18- QMAKE_LFLAGS_APP += -rdynamic
18+ !haiku {
19+ QMAKE_LFLAGS_APP += -rdynamic
20+ }
1921
2022# Man page
2123nox {
You can’t perform that action at this time.
0 commit comments