mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-30 16:34:16 +00:00
Various Mac related fixes (Thanks Mirco Chinelli)
This commit is contained in:
parent
11fe685a6b
commit
c31b5f1f97
@ -223,6 +223,10 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||||||
GUI::~GUI() {
|
GUI::~GUI() {
|
||||||
qDebug("GUI destruction");
|
qDebug("GUI destruction");
|
||||||
hide();
|
hide();
|
||||||
|
#ifdef Q_WS_MAC
|
||||||
|
// Workaround to avoid bug http://bugreports.qt.nokia.com/browse/QTBUG-7305
|
||||||
|
setUnifiedTitleAndToolBarOnMac(true);
|
||||||
|
#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 = BTSession->asyncDeletion();
|
||||||
|
BIN
src/Icons/qbittorrent_mac.icns
Normal file
BIN
src/Icons/qbittorrent_mac.icns
Normal file
Binary file not shown.
45
src/Info.plist
Normal file
45
src/Info.plist
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDocumentTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeExtensions</key>
|
||||||
|
<array>
|
||||||
|
<string>torrent</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeIconFile</key>
|
||||||
|
<string>qbittorrentDocument</string>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>BitTorrent Document</string>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
<key>LSHandlerRank</key>
|
||||||
|
<string>Owner</string>
|
||||||
|
<key>LSItemContentTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>org.bitorrent.torrent</string>
|
||||||
|
</array>
|
||||||
|
<key>LSIsAppleDefaultForType</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string>qbittorrent_mac.icns</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleGetInfoString</key>
|
||||||
|
<string>2.2.8</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>qbittorrent</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>com.yourcompany.qbittorrent</string>
|
||||||
|
<key>NOTE</key>
|
||||||
|
<string>This file was generated by Qt/QMake.</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -116,7 +116,10 @@ QString misc::QDesktopServicesCacheLocation() {
|
|||||||
OSErr err = FSFindFolder(kUserDomain, kCachedDataFolderType, false, &ref);
|
OSErr err = FSFindFolder(kUserDomain, kCachedDataFolderType, false, &ref);
|
||||||
if (err)
|
if (err)
|
||||||
return QString();
|
return QString();
|
||||||
QString path = getFullPath(ref);
|
QString path;
|
||||||
|
QByteArray ba(2048, 0);
|
||||||
|
if (FSRefMakePath(&ref, reinterpret_cast<UInt8 *>(ba.data()), ba.size()) == noErr)
|
||||||
|
path = QString::fromUtf8(ba).normalized(QString::NormalizationForm_C);
|
||||||
path += QLatin1Char('/') + qApp->applicationName();
|
path += QLatin1Char('/') + qApp->applicationName();
|
||||||
return path;
|
return path;
|
||||||
#else
|
#else
|
||||||
|
@ -28,8 +28,6 @@
|
|||||||
* Contact : chris@qbittorrent.org
|
* Contact : chris@qbittorrent.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
|
||||||
|
|
||||||
#include <QFileOpenEvent>
|
#include <QFileOpenEvent>
|
||||||
#include "qmacapplication.h"
|
#include "qmacapplication.h"
|
||||||
|
|
||||||
@ -52,4 +50,3 @@ bool QMacApplication::event(QEvent * event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
#ifndef QMACAPPLICATION_H
|
#ifndef QMACAPPLICATION_H
|
||||||
#define QMACAPPLICATION_H
|
#define QMACAPPLICATION_H
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
|
||||||
|
|
||||||
#include "qtsingleapplication.h"
|
#include "qtsingleapplication.h"
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
@ -47,9 +45,6 @@ signals:
|
|||||||
protected:
|
protected:
|
||||||
bool event(QEvent *);
|
bool event(QEvent *);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // QMACAPPLICATION_H
|
#endif // QMACAPPLICATION_H
|
||||||
|
13
src/src.pro
13
src/src.pro
@ -67,6 +67,19 @@ contains(DEBUG_MODE, 0) {
|
|||||||
message(Release build!)
|
message(Release build!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Mac specific configuration
|
||||||
|
macx {
|
||||||
|
PREFIX = /usr/local
|
||||||
|
BINDIR = /usr/local/bin
|
||||||
|
DATADIR = /usr/local/share
|
||||||
|
|
||||||
|
INCLUDEPATH += /usr/local/include/libtorrent /usr/include/openssl /usr/include /opt/local/include/boost /opt/local/include
|
||||||
|
LIBS += -ltorrent-rasterbar -lcrypto -L/opt/local/lib -lboost_system-mt -lboost_filesystem-mt -lboost_thread-mt -framework Cocoa
|
||||||
|
|
||||||
|
ICON = Icons/qbittorrent_mac.icns
|
||||||
|
QMAKE_INFO_PLIST = Info.plist
|
||||||
|
}
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
!win32 {
|
!win32 {
|
||||||
# Binary
|
# Binary
|
||||||
|
Loading…
x
Reference in New Issue
Block a user