Browse Source

Various Mac related fixes (Thanks Mirco Chinelli)

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
c31b5f1f97
  1. 4
      src/GUI.cpp
  2. BIN
      src/Icons/qbittorrent_mac.icns
  3. 45
      src/Info.plist
  4. 5
      src/misc.cpp
  5. 3
      src/qmacapplication.cpp
  6. 5
      src/qmacapplication.h
  7. 13
      src/src.pro

4
src/GUI.cpp

@ -223,6 +223,10 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis @@ -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();

BIN
src/Icons/qbittorrent_mac.icns

Binary file not shown.

45
src/Info.plist

@ -0,0 +1,45 @@ @@ -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>

5
src/misc.cpp

@ -116,7 +116,10 @@ QString misc::QDesktopServicesCacheLocation() { @@ -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

3
src/qmacapplication.cpp

@ -28,8 +28,6 @@ @@ -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) { @@ -52,4 +50,3 @@ bool QMacApplication::event(QEvent * event) {
}
}
#endif

5
src/qmacapplication.h

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

13
src/src.pro

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

Loading…
Cancel
Save