Browse Source

Merge pull request #1925 from diger/haiku

Fix Qt5 support
adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
6a6e562f60
  1. 8
      src/filesystemwatcher.h
  2. 4
      src/fs_utils.cpp
  3. 4
      src/main.cpp

8
src/filesystemwatcher.h

@ -16,7 +16,7 @@
#include <sys/param.h> #include <sys/param.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <string.h> #include <string.h>
#elif !defined Q_WS_HAIKU #elif !defined Q_OS_HAIKU
#include <sys/vfs.h> #include <sys/vfs.h>
#endif #endif
#endif #endif
@ -56,7 +56,7 @@ private:
QHash<QString, int> m_partialTorrents; QHash<QString, int> m_partialTorrents;
QPointer<QTimer> m_partialTorrentTimer; QPointer<QTimer> m_partialTorrentTimer;
#if !defined Q_WS_WIN && !defined Q_WS_HAIKU #if !defined Q_OS_WIN && !defined Q_OS_HAIKU
private: private:
static bool isNetworkFileSystem(QString path) { static bool isNetworkFileSystem(QString path) {
QString file = path; QString file = path;
@ -145,7 +145,7 @@ public:
} }
void addPath(const QString & path) { void addPath(const QString & path) {
#if !defined Q_WS_WIN && !defined Q_WS_HAIKU #if !defined Q_OS_WIN && !defined Q_OS_HAIKU
QDir dir(path); QDir dir(path);
if (!dir.exists()) if (!dir.exists())
return; return;
@ -167,7 +167,7 @@ public:
qDebug("FS Watching is watching %s in normal mode", qPrintable(path)); qDebug("FS Watching is watching %s in normal mode", qPrintable(path));
QFileSystemWatcher::addPath(path); QFileSystemWatcher::addPath(path);
scanLocalFolder(path); scanLocalFolder(path);
#if !defined Q_WS_WIN && !defined Q_WS_HAIKU #if !defined Q_OS_WIN && !defined Q_OS_HAIKU
} }
#endif #endif
} }

4
src/fs_utils.cpp

@ -52,7 +52,7 @@
#if defined(Q_OS_MAC) || defined(Q_OS_FREEBSD) #if defined(Q_OS_MAC) || defined(Q_OS_FREEBSD)
#include <sys/param.h> #include <sys/param.h>
#include <sys/mount.h> #include <sys/mount.h>
#elif defined(Q_WS_HAIKU) #elif defined(Q_OS_HAIKU)
#include <kernel/fs_info.h> #include <kernel/fs_info.h>
#else #else
#include <sys/vfs.h> #include <sys/vfs.h>
@ -293,7 +293,7 @@ long long fsutils::freeDiskSpaceOnPath(QString path) {
#ifndef Q_OS_WIN #ifndef Q_OS_WIN
unsigned long long available; unsigned long long available;
#ifdef Q_WS_HAIKU #ifdef Q_OS_HAIKU
const QString statfs_path = dir_path.path()+"/."; const QString statfs_path = dir_path.path()+"/.";
dev_t device = dev_for_path (qPrintable(statfs_path)); dev_t device = dev_for_path (qPrintable(statfs_path));
if (device >= 0) { if (device >= 0) {

4
src/main.cpp

@ -156,7 +156,7 @@ void sigtermHandler(int) {
void sigsegvHandler(int) { void sigsegvHandler(int) {
signal(SIGABRT, 0); signal(SIGABRT, 0);
signal(SIGSEGV, 0); signal(SIGSEGV, 0);
#if !defined Q_WS_WIN && !defined Q_WS_HAIKU #if !defined Q_OS_WIN && !defined Q_OS_HAIKU
std::cerr << "\n\n*************************************************************\n"; std::cerr << "\n\n*************************************************************\n";
std::cerr << "Catching SIGSEGV, please report a bug at http://bug.qbittorrent.org\nand provide the following backtrace:\n"; std::cerr << "Catching SIGSEGV, please report a bug at http://bug.qbittorrent.org\nand provide the following backtrace:\n";
std::cerr << "qBittorrent version: " << VERSION << std::endl; std::cerr << "qBittorrent version: " << VERSION << std::endl;
@ -173,7 +173,7 @@ void sigsegvHandler(int) {
void sigabrtHandler(int) { void sigabrtHandler(int) {
signal(SIGABRT, 0); signal(SIGABRT, 0);
signal(SIGSEGV, 0); signal(SIGSEGV, 0);
#if !defined Q_WS_WIN && !defined Q_WS_HAIKU #if !defined Q_OS_WIN && !defined Q_OS_HAIKU
std::cerr << "\n\n*************************************************************\n"; std::cerr << "\n\n*************************************************************\n";
std::cerr << "Catching SIGABRT, please report a bug at http://bug.qbittorrent.org\nand provide the following backtrace:\n"; std::cerr << "Catching SIGABRT, please report a bug at http://bug.qbittorrent.org\nand provide the following backtrace:\n";
std::cerr << "qBittorrent version: " << VERSION << std::endl; std::cerr << "qBittorrent version: " << VERSION << std::endl;

Loading…
Cancel
Save