Various Mac related fixes (Thanks Mirco Chinelli)

This commit is contained in:
Christophe Dumez 2010-06-09 15:13:52 +00:00
parent 11fe685a6b
commit c31b5f1f97
7 changed files with 66 additions and 9 deletions

View file

@ -223,6 +223,10 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
GUI::~GUI() {
qDebug("GUI destruction");
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
// in order to speed up exit
session_proxy sp = BTSession->asyncDeletion();

Binary file not shown.

45
src/Info.plist Normal file
View 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>

View file

@ -116,7 +116,10 @@ QString misc::QDesktopServicesCacheLocation() {
OSErr err = FSFindFolder(kUserDomain, kCachedDataFolderType, false, &ref);
if (err)
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();
return path;
#else

View file

@ -28,8 +28,6 @@
* Contact : chris@qbittorrent.org
*/
#ifdef Q_WS_MAC
#include <QFileOpenEvent>
#include "qmacapplication.h"
@ -52,4 +50,3 @@ bool QMacApplication::event(QEvent * event) {
}
}
#endif

View file

@ -30,8 +30,6 @@
#ifndef QMACAPPLICATION_H
#define QMACAPPLICATION_H
#ifdef Q_WS_MAC
#include "qtsingleapplication.h"
#include <QStringList>
@ -47,9 +45,6 @@ signals:
protected:
bool event(QEvent *);
};
#endif
#endif // QMACAPPLICATION_H

View file

@ -67,6 +67,19 @@ contains(DEBUG_MODE, 0) {
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
!win32 {
# Binary