complete tabs and trailing whitespace formatting on frontend
authorkoda
Sat, 26 Jan 2013 23:56:10 +0100
changeset 8440 ea4d6a7a2937
parent 8439 3850c4bfe6b5
child 8441 a00b0fa0dbd7
complete tabs and trailing whitespace formatting on frontend
QTfrontend/util/FileEngine.cpp
QTfrontend/util/platform/M3InstallController.m
QTfrontend/util/platform/NSWorkspace_RBAdditions.m
QTfrontend/util/platform/xfire_license.txt
QTfrontend/util/platform/xfiregameclient.cpp
--- a/QTfrontend/util/FileEngine.cpp	Sat Jan 26 22:59:48 2013 +0400
+++ b/QTfrontend/util/FileEngine.cpp	Sat Jan 26 23:56:10 2013 +0100
@@ -1,380 +1,380 @@
-/* borrowed from https://github.com/skhaz/qt-physfs-wrapper
- * TODO: add copyright header, determine license
- */
-
-#include "hwpacksmounter.h"
-#include "FileEngine.h"
-
-
-const QString FileEngineHandler::scheme = "physfs:/";
-
-FileEngine::FileEngine(const QString& filename)
-    : m_handle(NULL)
-    , m_size(0)
-    , m_flags(0)
-    , m_bufferSet(false)
-    , m_readWrite(false)
-{
-    setFileName(filename);
-}
-
-FileEngine::~FileEngine()
-{
-    close();
-}
-
-bool FileEngine::open(QIODevice::OpenMode openMode)
-{
-    close();
-
-    if ((openMode & QIODevice::ReadWrite) == QIODevice::ReadWrite) {
-        m_handle = PHYSFS_openAppend(m_fileName.toUtf8().constData());
-        if(m_handle)
-        {
-            m_readWrite = true;
-            seek(0);
-        }
-    }
-
-    else if (openMode & QIODevice::WriteOnly) {
-        m_handle = PHYSFS_openWrite(m_fileName.toUtf8().constData());
-        m_flags = QAbstractFileEngine::WriteOwnerPerm | QAbstractFileEngine::WriteUserPerm | QAbstractFileEngine::FileType;
-    }
-
-    else if (openMode & QIODevice::ReadOnly) {
-        m_handle = PHYSFS_openRead(m_fileName.toUtf8().constData());
-    }
-
-    else if (openMode & QIODevice::Append) {
-        m_handle = PHYSFS_openAppend(m_fileName.toUtf8().constData());
-    }
-
-    else {
-        qWarning("[PHYSFS] Bad file open mode: %d", (int)openMode);
-    }
-
-    if (!m_handle) {
-        qWarning("[PHYSFS] Failed to open %s, reason: %s", m_fileName.toUtf8().constData(), PHYSFS_getLastError());
-        return false;
-    }
-
-    return true;
-}
-
-bool FileEngine::close()
-{
-    if (isOpened()) {
-        int result = PHYSFS_close(m_handle);
-        m_handle = NULL;
-        return result != 0;
-    }
-
-    return true;
-}
-
-bool FileEngine::flush()
-{
-    return PHYSFS_flush(m_handle) != 0;
-}
-
-qint64 FileEngine::size() const
-{
-    return m_size;
-}
-
-qint64 FileEngine::pos() const
-{
-    return PHYSFS_tell(m_handle);
-}
-
-bool FileEngine::setSize(qint64 size)
-{
-    if(size == 0)
-    {
-        m_size = 0;
-        return open(QIODevice::WriteOnly);
-    }
-    else
-        return false;
-}
-
-bool FileEngine::seek(qint64 pos)
-{
-    bool ok = PHYSFS_seek(m_handle, pos) != 0;
-
-    return ok;
-}
-
-bool FileEngine::isSequential() const
-{
-    return false;
-}
-
-bool FileEngine::remove()
-{
-    return PHYSFS_delete(m_fileName.toUtf8().constData()) != 0;
-}
-
-bool FileEngine::mkdir(const QString &dirName, bool createParentDirectories) const
-{
-    Q_UNUSED(createParentDirectories);
-
-    return PHYSFS_mkdir(dirName.toUtf8().constData()) != 0;
-}
-
-bool FileEngine::rmdir(const QString &dirName, bool recurseParentDirectories) const
-{
-    Q_UNUSED(recurseParentDirectories);
-
-    return PHYSFS_delete(dirName.toUtf8().constData()) != 0;
-}
-
-bool FileEngine::caseSensitive() const
-{
-    return true;
-}
-
-bool FileEngine::isRelativePath() const
-{
-    return false;
-}
-
-QAbstractFileEngineIterator * FileEngine::beginEntryList(QDir::Filters filters, const QStringList &filterNames)
-{
-    return new FileEngineIterator(filters, filterNames, entryList(filters, filterNames));
-}
-
-QStringList FileEngine::entryList(QDir::Filters filters, const QStringList &filterNames) const
-{
-    Q_UNUSED(filters);
-
-    QString file;
-    QStringList result;
-    char **files = PHYSFS_enumerateFiles(m_fileName.toUtf8().constData());
-
-    for (char **i = files; *i != NULL; i++) {
-        file = QString::fromUtf8(*i);
-
-        if (filterNames.isEmpty() || QDir::match(filterNames, file)) {
-            result << file;
-        }
-    }
-
-    PHYSFS_freeList(files);
-
-    return result;
-}
-
-QAbstractFileEngine::FileFlags FileEngine::fileFlags(FileFlags type) const
-{
-    return type & m_flags;
-}
-
-QString FileEngine::fileName(FileName file) const
-{
-    switch(file)
-    {
-        case QAbstractFileEngine::AbsolutePathName:
-        {
-            QString s(PHYSFS_getWriteDir());
-            return s;
-        }
-        case QAbstractFileEngine::BaseName:
-        {
-            int l = m_fileName.lastIndexOf('/');
-            QString s = m_fileName.mid(l + 1);
-            return s;
-        }
-        case QAbstractFileEngine::DefaultName:
-        case QAbstractFileEngine::AbsoluteName:
-        default:
-        {
-            QString s = "physfs:/" + m_fileName;
-            return s;
-        }
-    }
-}
-
-QDateTime FileEngine::fileTime(FileTime time) const
-{
-    switch (time)
-    {
-        case QAbstractFileEngine::ModificationTime:
-        default:
-            return m_date;
-            break;
-    };
-}
-
-void FileEngine::setFileName(const QString &file)
-{
-    if(file.startsWith(FileEngineHandler::scheme))
-        m_fileName = file.mid(FileEngineHandler::scheme.size());
-    else
-        m_fileName = file;
-    PHYSFS_Stat stat;
-    if (PHYSFS_stat(m_fileName.toUtf8().constData(), &stat) != 0) {        
-        m_size = stat.filesize;
-        m_date = QDateTime::fromTime_t(stat.modtime);
-//        m_flags |= QAbstractFileEngine::WriteOwnerPerm;
-        m_flags |= QAbstractFileEngine::ReadOwnerPerm;
-        m_flags |= QAbstractFileEngine::ReadUserPerm;
-        m_flags |= QAbstractFileEngine::ExistsFlag;
-        m_flags |= QAbstractFileEngine::LocalDiskFlag;
-
-        switch (stat.filetype)
-        {
-            case PHYSFS_FILETYPE_REGULAR:
-                m_flags |= QAbstractFileEngine::FileType;
-                break;
-            case PHYSFS_FILETYPE_DIRECTORY:
-                m_flags |= QAbstractFileEngine::DirectoryType;
-                break;
-            case PHYSFS_FILETYPE_SYMLINK:
-                m_flags |= QAbstractFileEngine::LinkType;
-                break;
-            default: ;
-        }
-    }
-}
-
-bool FileEngine::atEnd() const
-{
-    return PHYSFS_eof(m_handle) != 0;
-}
-
-qint64 FileEngine::read(char *data, qint64 maxlen)
-{
-    if(m_readWrite)
-    {
-        if(pos() == 0)
-            open(QIODevice::ReadOnly);
-        else
-            return -1;
-    }
-
-    qint64 len = PHYSFS_readBytes(m_handle, data, maxlen);
-    return len;
-}
-
-qint64 FileEngine::readLine(char *data, qint64 maxlen)
-{
-    if(!m_bufferSet)
-    {
-        PHYSFS_setBuffer(m_handle, 4096);
-        m_bufferSet = true;
-    }
-
-    qint64 bytesRead = 0;
-    while(PHYSFS_readBytes(m_handle, data, 1)
-          && maxlen
-          && (*data == '\n'))
-    {
-        ++data;
-        --maxlen;
-        ++bytesRead;
-    }
-
-    return bytesRead;
-}
-
-qint64 FileEngine::write(const char *data, qint64 len)
-{
-    return PHYSFS_writeBytes(m_handle, data, len);
-}
-
-bool FileEngine::isOpened() const
-{
-    return m_handle != NULL;
-}
-
-QFile::FileError FileEngine::error() const
-{
-    return QFile::UnspecifiedError;
-}
-
-QString FileEngine::errorString() const
-{
-    return PHYSFS_getLastError();
-}
-
-bool FileEngine::supportsExtension(Extension extension) const
-{
-    return
-            (extension == QAbstractFileEngine::AtEndExtension)
-            || (extension == QAbstractFileEngine::FastReadLineExtension)
-            ;
-}
-
-
-FileEngineHandler::FileEngineHandler(char *argv0)
-{
-    PHYSFS_init(argv0);
-}
-
-FileEngineHandler::~FileEngineHandler()
-{
-    PHYSFS_deinit();
-}
-
-QAbstractFileEngine* FileEngineHandler::create(const QString &filename) const
-{
-    if (filename.startsWith(scheme))
-        return new FileEngine(filename);
-    else
-        return NULL;
-}
-
-void FileEngineHandler::mount(const QString &path)
-{
-    PHYSFS_mount(path.toUtf8().constData(), NULL, 1);
-}
-
-void FileEngineHandler::mount(const QString & path, const QString & mountPoint)
-{
-    PHYSFS_mount(path.toUtf8().constData(), mountPoint.toUtf8().constData(), 1);
-}
-
-void FileEngineHandler::setWriteDir(const QString &path)
-{
-    PHYSFS_setWriteDir(path.toUtf8().constData());
-}
-
-void FileEngineHandler::mountPacks()
-{
-    hedgewarsMountPackages();
-}
-
-
-FileEngineIterator::FileEngineIterator(QDir::Filters filters, const QStringList &nameFilters, const QStringList &entries)
-    : QAbstractFileEngineIterator(filters, nameFilters)
-{
-    m_entries = entries;
-
-    /* heck.. docs are unclear on this
-     * QDirIterator puts iterator before first entry
-     * but QAbstractFileEngineIterator example puts iterator on first entry
-     * though QDirIterator approach seems to be the right one
-     */
-
-    m_index = -1;
-}
-
-bool FileEngineIterator::hasNext() const
-{
-    return m_index < m_entries.size() - 1;
-}
-
-QString FileEngineIterator::next()
-{
-   if (!hasNext())
-       return QString();
-
-   ++m_index;
-   return currentFilePath();
-}
-
-QString FileEngineIterator::currentFileName() const
-{
-    return m_entries.at(m_index);
-}
+/* borrowed from https://github.com/skhaz/qt-physfs-wrapper
+ * TODO: add copyright header, determine license
+ */
+
+#include "hwpacksmounter.h"
+#include "FileEngine.h"
+
+
+const QString FileEngineHandler::scheme = "physfs:/";
+
+FileEngine::FileEngine(const QString& filename)
+    : m_handle(NULL)
+    , m_size(0)
+    , m_flags(0)
+    , m_bufferSet(false)
+    , m_readWrite(false)
+{
+    setFileName(filename);
+}
+
+FileEngine::~FileEngine()
+{
+    close();
+}
+
+bool FileEngine::open(QIODevice::OpenMode openMode)
+{
+    close();
+
+    if ((openMode & QIODevice::ReadWrite) == QIODevice::ReadWrite) {
+        m_handle = PHYSFS_openAppend(m_fileName.toUtf8().constData());
+        if(m_handle)
+        {
+            m_readWrite = true;
+            seek(0);
+        }
+    }
+
+    else if (openMode & QIODevice::WriteOnly) {
+        m_handle = PHYSFS_openWrite(m_fileName.toUtf8().constData());
+        m_flags = QAbstractFileEngine::WriteOwnerPerm | QAbstractFileEngine::WriteUserPerm | QAbstractFileEngine::FileType;
+    }
+
+    else if (openMode & QIODevice::ReadOnly) {
+        m_handle = PHYSFS_openRead(m_fileName.toUtf8().constData());
+    }
+
+    else if (openMode & QIODevice::Append) {
+        m_handle = PHYSFS_openAppend(m_fileName.toUtf8().constData());
+    }
+
+    else {
+        qWarning("[PHYSFS] Bad file open mode: %d", (int)openMode);
+    }
+
+    if (!m_handle) {
+        qWarning("[PHYSFS] Failed to open %s, reason: %s", m_fileName.toUtf8().constData(), PHYSFS_getLastError());
+        return false;
+    }
+
+    return true;
+}
+
+bool FileEngine::close()
+{
+    if (isOpened()) {
+        int result = PHYSFS_close(m_handle);
+        m_handle = NULL;
+        return result != 0;
+    }
+
+    return true;
+}
+
+bool FileEngine::flush()
+{
+    return PHYSFS_flush(m_handle) != 0;
+}
+
+qint64 FileEngine::size() const
+{
+    return m_size;
+}
+
+qint64 FileEngine::pos() const
+{
+    return PHYSFS_tell(m_handle);
+}
+
+bool FileEngine::setSize(qint64 size)
+{
+    if(size == 0)
+    {
+        m_size = 0;
+        return open(QIODevice::WriteOnly);
+    }
+    else
+        return false;
+}
+
+bool FileEngine::seek(qint64 pos)
+{
+    bool ok = PHYSFS_seek(m_handle, pos) != 0;
+
+    return ok;
+}
+
+bool FileEngine::isSequential() const
+{
+    return false;
+}
+
+bool FileEngine::remove()
+{
+    return PHYSFS_delete(m_fileName.toUtf8().constData()) != 0;
+}
+
+bool FileEngine::mkdir(const QString &dirName, bool createParentDirectories) const
+{
+    Q_UNUSED(createParentDirectories);
+
+    return PHYSFS_mkdir(dirName.toUtf8().constData()) != 0;
+}
+
+bool FileEngine::rmdir(const QString &dirName, bool recurseParentDirectories) const
+{
+    Q_UNUSED(recurseParentDirectories);
+
+    return PHYSFS_delete(dirName.toUtf8().constData()) != 0;
+}
+
+bool FileEngine::caseSensitive() const
+{
+    return true;
+}
+
+bool FileEngine::isRelativePath() const
+{
+    return false;
+}
+
+QAbstractFileEngineIterator * FileEngine::beginEntryList(QDir::Filters filters, const QStringList &filterNames)
+{
+    return new FileEngineIterator(filters, filterNames, entryList(filters, filterNames));
+}
+
+QStringList FileEngine::entryList(QDir::Filters filters, const QStringList &filterNames) const
+{
+    Q_UNUSED(filters);
+
+    QString file;
+    QStringList result;
+    char **files = PHYSFS_enumerateFiles(m_fileName.toUtf8().constData());
+
+    for (char **i = files; *i != NULL; i++) {
+        file = QString::fromUtf8(*i);
+
+        if (filterNames.isEmpty() || QDir::match(filterNames, file)) {
+            result << file;
+        }
+    }
+
+    PHYSFS_freeList(files);
+
+    return result;
+}
+
+QAbstractFileEngine::FileFlags FileEngine::fileFlags(FileFlags type) const
+{
+    return type & m_flags;
+}
+
+QString FileEngine::fileName(FileName file) const
+{
+    switch(file)
+    {
+        case QAbstractFileEngine::AbsolutePathName:
+        {
+            QString s(PHYSFS_getWriteDir());
+            return s;
+        }
+        case QAbstractFileEngine::BaseName:
+        {
+            int l = m_fileName.lastIndexOf('/');
+            QString s = m_fileName.mid(l + 1);
+            return s;
+        }
+        case QAbstractFileEngine::DefaultName:
+        case QAbstractFileEngine::AbsoluteName:
+        default:
+        {
+            QString s = "physfs:/" + m_fileName;
+            return s;
+        }
+    }
+}
+
+QDateTime FileEngine::fileTime(FileTime time) const
+{
+    switch (time)
+    {
+        case QAbstractFileEngine::ModificationTime:
+        default:
+            return m_date;
+            break;
+    };
+}
+
+void FileEngine::setFileName(const QString &file)
+{
+    if(file.startsWith(FileEngineHandler::scheme))
+        m_fileName = file.mid(FileEngineHandler::scheme.size());
+    else
+        m_fileName = file;
+    PHYSFS_Stat stat;
+    if (PHYSFS_stat(m_fileName.toUtf8().constData(), &stat) != 0) {
+        m_size = stat.filesize;
+        m_date = QDateTime::fromTime_t(stat.modtime);
+//        m_flags |= QAbstractFileEngine::WriteOwnerPerm;
+        m_flags |= QAbstractFileEngine::ReadOwnerPerm;
+        m_flags |= QAbstractFileEngine::ReadUserPerm;
+        m_flags |= QAbstractFileEngine::ExistsFlag;
+        m_flags |= QAbstractFileEngine::LocalDiskFlag;
+
+        switch (stat.filetype)
+        {
+            case PHYSFS_FILETYPE_REGULAR:
+                m_flags |= QAbstractFileEngine::FileType;
+                break;
+            case PHYSFS_FILETYPE_DIRECTORY:
+                m_flags |= QAbstractFileEngine::DirectoryType;
+                break;
+            case PHYSFS_FILETYPE_SYMLINK:
+                m_flags |= QAbstractFileEngine::LinkType;
+                break;
+            default: ;
+        }
+    }
+}
+
+bool FileEngine::atEnd() const
+{
+    return PHYSFS_eof(m_handle) != 0;
+}
+
+qint64 FileEngine::read(char *data, qint64 maxlen)
+{
+    if(m_readWrite)
+    {
+        if(pos() == 0)
+            open(QIODevice::ReadOnly);
+        else
+            return -1;
+    }
+
+    qint64 len = PHYSFS_readBytes(m_handle, data, maxlen);
+    return len;
+}
+
+qint64 FileEngine::readLine(char *data, qint64 maxlen)
+{
+    if(!m_bufferSet)
+    {
+        PHYSFS_setBuffer(m_handle, 4096);
+        m_bufferSet = true;
+    }
+
+    qint64 bytesRead = 0;
+    while(PHYSFS_readBytes(m_handle, data, 1)
+          && maxlen
+          && (*data == '\n'))
+    {
+        ++data;
+        --maxlen;
+        ++bytesRead;
+    }
+
+    return bytesRead;
+}
+
+qint64 FileEngine::write(const char *data, qint64 len)
+{
+    return PHYSFS_writeBytes(m_handle, data, len);
+}
+
+bool FileEngine::isOpened() const
+{
+    return m_handle != NULL;
+}
+
+QFile::FileError FileEngine::error() const
+{
+    return QFile::UnspecifiedError;
+}
+
+QString FileEngine::errorString() const
+{
+    return PHYSFS_getLastError();
+}
+
+bool FileEngine::supportsExtension(Extension extension) const
+{
+    return
+            (extension == QAbstractFileEngine::AtEndExtension)
+            || (extension == QAbstractFileEngine::FastReadLineExtension)
+            ;
+}
+
+
+FileEngineHandler::FileEngineHandler(char *argv0)
+{
+    PHYSFS_init(argv0);
+}
+
+FileEngineHandler::~FileEngineHandler()
+{
+    PHYSFS_deinit();
+}
+
+QAbstractFileEngine* FileEngineHandler::create(const QString &filename) const
+{
+    if (filename.startsWith(scheme))
+        return new FileEngine(filename);
+    else
+        return NULL;
+}
+
+void FileEngineHandler::mount(const QString &path)
+{
+    PHYSFS_mount(path.toUtf8().constData(), NULL, 1);
+}
+
+void FileEngineHandler::mount(const QString & path, const QString & mountPoint)
+{
+    PHYSFS_mount(path.toUtf8().constData(), mountPoint.toUtf8().constData(), 1);
+}
+
+void FileEngineHandler::setWriteDir(const QString &path)
+{
+    PHYSFS_setWriteDir(path.toUtf8().constData());
+}
+
+void FileEngineHandler::mountPacks()
+{
+    hedgewarsMountPackages();
+}
+
+
+FileEngineIterator::FileEngineIterator(QDir::Filters filters, const QStringList &nameFilters, const QStringList &entries)
+    : QAbstractFileEngineIterator(filters, nameFilters)
+{
+    m_entries = entries;
+
+    /* heck.. docs are unclear on this
+     * QDirIterator puts iterator before first entry
+     * but QAbstractFileEngineIterator example puts iterator on first entry
+     * though QDirIterator approach seems to be the right one
+     */
+
+    m_index = -1;
+}
+
+bool FileEngineIterator::hasNext() const
+{
+    return m_index < m_entries.size() - 1;
+}
+
+QString FileEngineIterator::next()
+{
+   if (!hasNext())
+       return QString();
+
+   ++m_index;
+   return currentFilePath();
+}
+
+QString FileEngineIterator::currentFileName() const
+{
+    return m_entries.at(m_index);
+}
--- a/QTfrontend/util/platform/M3InstallController.m	Sat Jan 26 22:59:48 2013 +0400
+++ b/QTfrontend/util/platform/M3InstallController.m	Sat Jan 26 23:56:10 2013 +0100
@@ -37,61 +37,61 @@
 
 - (id) init {
         if ((self = [super init])) {
-		NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
-		NSString *title = [NSString stringWithFormat:NSLocalizedString(@"%@ is currently running from a disk image", @"AppName is currently running from a disk image"), appName];
-		NSString *body = [NSString stringWithFormat:NSLocalizedString(@"Would you like to install %@ in your applications folder before quitting?", @"Would you like to install App Name in your applications folder before quitting?"), appName];
-		alert = [[NSAlert alertWithMessageText:title
-								 defaultButton:NSLocalizedString(@"Install", @"Install")
-							   alternateButton:NSLocalizedString(@"Don't Install", @"Don't Install")
-								   otherButton:nil
-					 informativeTextWithFormat:body] retain];
-		//[alert setShowsSuppressionButton:YES];
-	}
-	return self;
+        NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
+        NSString *title = [NSString stringWithFormat:NSLocalizedString(@"%@ is currently running from a disk image", @"AppName is currently running from a disk image"), appName];
+        NSString *body = [NSString stringWithFormat:NSLocalizedString(@"Would you like to install %@ in your applications folder before quitting?", @"Would you like to install App Name in your applications folder before quitting?"), appName];
+        alert = [[NSAlert alertWithMessageText:title
+                                 defaultButton:NSLocalizedString(@"Install", @"Install")
+                               alternateButton:NSLocalizedString(@"Don't Install", @"Don't Install")
+                                   otherButton:nil
+                     informativeTextWithFormat:body] retain];
+        //[alert setShowsSuppressionButton:YES];
+    }
+    return self;
 }
 
 - (void)displayInstaller {
-	NSString *imageFilePath = [[[NSWorkspace sharedWorkspace] propertiesForPath:[[NSBundle mainBundle] bundlePath]] objectForKey:NSWorkspace_RBimagefilepath];
-	if (imageFilePath && ![imageFilePath isEqualToString:[NSString stringWithFormat:@"/Users/.%@/%@.sparseimage", NSUserName(), NSUserName()]] && ![[NSUserDefaults standardUserDefaults] boolForKey:@"M3DontAskInstallAgain"]) {
-		NSInteger returnValue = [alert runModal];
-		if (returnValue == NSAlertDefaultReturn) {
-			[self installApp];
-		}
-		if ([[alert suppressionButton] state] == NSOnState) {
-			[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"M3DontAskInstallAgain"];
-		}
-	}
+    NSString *imageFilePath = [[[NSWorkspace sharedWorkspace] propertiesForPath:[[NSBundle mainBundle] bundlePath]] objectForKey:NSWorkspace_RBimagefilepath];
+    if (imageFilePath && ![imageFilePath isEqualToString:[NSString stringWithFormat:@"/Users/.%@/%@.sparseimage", NSUserName(), NSUserName()]] && ![[NSUserDefaults standardUserDefaults] boolForKey:@"M3DontAskInstallAgain"]) {
+        NSInteger returnValue = [alert runModal];
+        if (returnValue == NSAlertDefaultReturn) {
+            [self installApp];
+        }
+        if ([[alert suppressionButton] state] == NSOnState) {
+            [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"M3DontAskInstallAgain"];
+        }
+    }
 }
 
 - (void)installApp {
-	NSString *appsPath = [[NSString stringWithString:@"/Applications"] stringByAppendingPathComponent:[[[NSBundle mainBundle] bundlePath] lastPathComponent]];
-	NSString *userAppsPath = [[[NSString stringWithString:@"~/Applications"] stringByAppendingPathComponent:[[[NSBundle mainBundle] bundlePath] lastPathComponent]] stringByExpandingTildeInPath];
-	NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
+    NSString *appsPath = [[NSString stringWithString:@"/Applications"] stringByAppendingPathComponent:[[[NSBundle mainBundle] bundlePath] lastPathComponent]];
+    NSString *userAppsPath = [[[NSString stringWithString:@"~/Applications"] stringByAppendingPathComponent:[[[NSBundle mainBundle] bundlePath] lastPathComponent]] stringByExpandingTildeInPath];
+    NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
 
-	//Delete the app that is installed
-	if ([[NSFileManager defaultManager] fileExistsAtPath:appsPath]) {
-		[[NSFileManager defaultManager] removeFileAtPath:appsPath handler:nil];
-	}
-	//Delete the app that is installed
-	if ([[NSFileManager defaultManager] copyPath:[[NSBundle mainBundle] bundlePath] toPath:appsPath
-										  handler:nil]) {
-		NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"%@ installed successfully", @"App Name installed successfully"), appName],
-						[NSString stringWithFormat:NSLocalizedString(@"%@ was installed in /Applications", @"App Name was installed in /Applications"), appName],
-						NSLocalizedString(@"Quit", @"Quit"), nil, nil);
-	} else {
-		if ([[NSFileManager defaultManager] fileExistsAtPath:userAppsPath]) {
-			[[NSFileManager defaultManager] removeFileAtPath:userAppsPath handler:nil];
-		}
-		if ([[NSFileManager defaultManager] copyPath:[[NSBundle mainBundle] bundlePath] toPath:userAppsPath
-												handler:nil]) {
-		NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"%@ installed successfully", @"AppName installed successfully"), appName],
-				[NSString stringWithFormat:NSLocalizedString(@"%@ was installed in %@", @"App Name was installed in %@"), appName, [[NSString stringWithString:@"~/Applications"] stringByExpandingTildeInPath]],
-						NSLocalizedString(@"Quit", @"Quit"), nil, nil);
-		} else {
-			NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"Could not install %@", @"Could not install App Name"), appName],
-							NSLocalizedString(@"An error occurred when installing", @"An error occurred when installing"), NSLocalizedString(@"Quit", @"Quit"), nil, nil);
-		}
-	}
+    //Delete the app that is installed
+    if ([[NSFileManager defaultManager] fileExistsAtPath:appsPath]) {
+        [[NSFileManager defaultManager] removeFileAtPath:appsPath handler:nil];
+    }
+    //Delete the app that is installed
+    if ([[NSFileManager defaultManager] copyPath:[[NSBundle mainBundle] bundlePath] toPath:appsPath
+                                          handler:nil]) {
+        NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"%@ installed successfully", @"App Name installed successfully"), appName],
+                        [NSString stringWithFormat:NSLocalizedString(@"%@ was installed in /Applications", @"App Name was installed in /Applications"), appName],
+                        NSLocalizedString(@"Quit", @"Quit"), nil, nil);
+    } else {
+        if ([[NSFileManager defaultManager] fileExistsAtPath:userAppsPath]) {
+            [[NSFileManager defaultManager] removeFileAtPath:userAppsPath handler:nil];
+        }
+        if ([[NSFileManager defaultManager] copyPath:[[NSBundle mainBundle] bundlePath] toPath:userAppsPath
+                                                handler:nil]) {
+        NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"%@ installed successfully", @"AppName installed successfully"), appName],
+                [NSString stringWithFormat:NSLocalizedString(@"%@ was installed in %@", @"App Name was installed in %@"), appName, [[NSString stringWithString:@"~/Applications"] stringByExpandingTildeInPath]],
+                        NSLocalizedString(@"Quit", @"Quit"), nil, nil);
+        } else {
+            NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"Could not install %@", @"Could not install App Name"), appName],
+                            NSLocalizedString(@"An error occurred when installing", @"An error occurred when installing"), NSLocalizedString(@"Quit", @"Quit"), nil, nil);
+        }
+    }
 }
 
 @end
--- a/QTfrontend/util/platform/NSWorkspace_RBAdditions.m	Sat Jan 26 22:59:48 2013 +0400
+++ b/QTfrontend/util/platform/NSWorkspace_RBAdditions.m	Sat Jan 26 23:56:10 2013 +0100
@@ -24,20 +24,20 @@
 // like one or the other nil, or one containing the other already.
 
 static NSString* AddPart(NSString* first,NSString* second) {
-	if (!second) {
-		return first;
-	}
-	second = [second stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
-	if (first) {
-		if ([first rangeOfString:second options:NSCaseInsensitiveSearch].location==NSNotFound) {
-			if ([second rangeOfString:first options:NSCaseInsensitiveSearch].location==NSNotFound) {
-				return [NSString stringWithFormat:@"%@; %@",first,second];
-			}
-			return second;
-		}
-		return first;
-	}
-	return second;
+    if (!second) {
+        return first;
+    }
+    second = [second stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
+    if (first) {
+        if ([first rangeOfString:second options:NSCaseInsensitiveSearch].location==NSNotFound) {
+            if ([second rangeOfString:first options:NSCaseInsensitiveSearch].location==NSNotFound) {
+                return [NSString stringWithFormat:@"%@; %@",first,second];
+            }
+            return second;
+        }
+        return first;
+    }
+    return second;
 }
 
 // This static functions recurses "upwards" over the IO registry. Returns strings that are concatenated
@@ -50,119 +50,119 @@
 // YMMV, and it may stop working in any new version of Mac OS X.
 
 static NSString* CheckParents(io_object_t thing,NSString* part,NSMutableDictionary* dict) {
-	NSString* result = part;
+    NSString* result = part;
     io_iterator_t parentsIterator = 0;
     kern_return_t kernResult = IORegistryEntryGetParentIterator(thing,kIOServicePlane,&parentsIterator);
     if ((kernResult==KERN_SUCCESS)&&parentsIterator) {
-		io_object_t nextParent = 0;
-		while ((nextParent = IOIteratorNext(parentsIterator))) {
-			NSDictionary* props = nil;
-			NSString* image = nil;
-			NSString* partition = nil;
-			NSString* connection = nil;
-			kernResult = IORegistryEntryCreateCFProperties(nextParent,(CFMutableDictionaryRef*)&props,kCFAllocatorDefault,0);
-			if (IOObjectConformsTo(nextParent,"IOApplePartitionScheme")) {
-				partition = [props objectForKey:@"Content Mask"];
-			} else if (IOObjectConformsTo(nextParent,"IOMedia")) {
-				partition = [props objectForKey:@"Content"];
-			} else if (IOObjectConformsTo(nextParent,"IODiskImageBlockStorageDeviceOutKernel")) {
-				NSData* data = nil;
+        io_object_t nextParent = 0;
+        while ((nextParent = IOIteratorNext(parentsIterator))) {
+            NSDictionary* props = nil;
+            NSString* image = nil;
+            NSString* partition = nil;
+            NSString* connection = nil;
+            kernResult = IORegistryEntryCreateCFProperties(nextParent,(CFMutableDictionaryRef*)&props,kCFAllocatorDefault,0);
+            if (IOObjectConformsTo(nextParent,"IOApplePartitionScheme")) {
+                partition = [props objectForKey:@"Content Mask"];
+            } else if (IOObjectConformsTo(nextParent,"IOMedia")) {
+                partition = [props objectForKey:@"Content"];
+            } else if (IOObjectConformsTo(nextParent,"IODiskImageBlockStorageDeviceOutKernel")) {
+                NSData* data = nil;
                                 if ((data = [[props objectForKey:@"Protocol Characteristics"] objectForKey:@"Virtual Interface Location Path"])) {
-					image = [[[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:NSUTF8StringEncoding] autorelease];
-				}
-			} else if (IOObjectConformsTo(nextParent,"IOHDIXHDDriveInKernel")) {
-				image = [props objectForKey:@"KDIURLPath"];
-			}
-			NSDictionary* subdict;
+                    image = [[[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:NSUTF8StringEncoding] autorelease];
+                }
+            } else if (IOObjectConformsTo(nextParent,"IOHDIXHDDriveInKernel")) {
+                image = [props objectForKey:@"KDIURLPath"];
+            }
+            NSDictionary* subdict;
                         if ((subdict = [props objectForKey:@"Protocol Characteristics"])) {
-				connection = [subdict objectForKey:@"Physical Interconnect"];
-			} else {
-				connection = [props objectForKey:@"Physical Interconnect"];
-			}
-			if (connection) {
-				[dict setObject:AddPart([dict objectForKey:NSWorkspace_RBconnectiontype],connection) forKey:NSWorkspace_RBconnectiontype];
-			}
-			if (partition) {
-				[dict setObject:partition forKey:NSWorkspace_RBpartitionscheme];
-			}
-			if (image) {
-				[dict setObject:image forKey:NSWorkspace_RBimagefilepath];
-			}
-			NSString* value;
+                connection = [subdict objectForKey:@"Physical Interconnect"];
+            } else {
+                connection = [props objectForKey:@"Physical Interconnect"];
+            }
+            if (connection) {
+                [dict setObject:AddPart([dict objectForKey:NSWorkspace_RBconnectiontype],connection) forKey:NSWorkspace_RBconnectiontype];
+            }
+            if (partition) {
+                [dict setObject:partition forKey:NSWorkspace_RBpartitionscheme];
+            }
+            if (image) {
+                [dict setObject:image forKey:NSWorkspace_RBimagefilepath];
+            }
+            NSString* value;
                         if ((subdict = [props objectForKey:@"Device Characteristics"])) {
                                 if ((value = [subdict objectForKey:@"Product Name"])) {
-					result = AddPart(result,value);
-				}
+                    result = AddPart(result,value);
+                }
                                 if ((value = [subdict objectForKey:@"Product Revision Level"])) {
-					result = AddPart(result,value);
-				}
+                    result = AddPart(result,value);
+                }
                                 if ((value = [subdict objectForKey:@"Vendor Name"])) {
-					result = AddPart(result,value);
-				}
-			}
+                    result = AddPart(result,value);
+                }
+            }
                         if ((value = [props objectForKey:@"USB Serial Number"])) {
-				result = AddPart(result,value);
-			}
+                result = AddPart(result,value);
+            }
                         if ((value = [props objectForKey:@"USB Vendor Name"])) {
-				result = AddPart(result,value);
-			}
-			NSString* cls = [(NSString*)IOObjectCopyClass(nextParent) autorelease];
-			if (![cls isEqualToString:@"IOPCIDevice"]) {
+                result = AddPart(result,value);
+            }
+            NSString* cls = [(NSString*)IOObjectCopyClass(nextParent) autorelease];
+            if (![cls isEqualToString:@"IOPCIDevice"]) {
 
 // Uncomment the following line to have the device tree dumped to the console.
-//				NSLog(@"=================================> %@:%@\n",cls,props);
+//              NSLog(@"=================================> %@:%@\n",cls,props);
 
-				result = CheckParents(nextParent,result,dict);
-			}
-			IOObjectRelease(nextParent);
-		}
+                result = CheckParents(nextParent,result,dict);
+            }
+            IOObjectRelease(nextParent);
+        }
     }
     if (parentsIterator) {
-		IOObjectRelease(parentsIterator);
+        IOObjectRelease(parentsIterator);
     }
-	return result;
+    return result;
 }
 
 // This formats the (partially undocumented) AFPXMountInfo info into a string.
 
 /*
 static NSString* FormatAFPURL(AFPXVolMountInfoPtr mountInfo,NSString** devdesc) {
-	UInt8* work = ((UInt8*)mountInfo)+mountInfo->serverNameOffset;
-	if (devdesc) {
-		*devdesc = [[[NSString alloc] initWithBytes:&work[1] length:work[0] encoding:NSUTF8StringEncoding] autorelease];
-	}
-	work = ((UInt8*)mountInfo)+mountInfo->volNameOffset;
-	NSString* volname = [[[NSString alloc] initWithBytes:&work[1] length:work[0] encoding:NSUTF8StringEncoding] autorelease];
-	work = ((UInt8*)mountInfo)+mountInfo->alternateAddressOffset;
-	AFPAlternateAddress* afpa = (AFPAlternateAddress*)work;
-	AFPTagData* afpta = (AFPTagData*)(&afpa->fAddressList);
-	NSString* ip = nil;
-	NSString* dns = nil;
-	int i = afpa->fAddressCount;
-	while ((i-->0)) {
-		switch (afpta->fType) {
-			case kAFPTagTypeIP:
-				if (!ip) {
-					ip = [[[NSString alloc] initWithBytes:&afpta->fData[0] length:afpta->fLength-2 encoding:NSUTF8StringEncoding] autorelease];
-				}
-				break;
-			case kAFPTagTypeIPPort:
-				ip = [NSString stringWithFormat:@"%u.%u.%u.%u:%u",afpta->fData[0],afpta->fData[1],afpta->fData[2],afpta->fData[3],OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[4])];
-				break;
-			case kAFPTagTypeDNS:
-				dns = [[[NSString alloc] initWithBytes:&afpta->fData[0] length:afpta->fLength-2 encoding:NSUTF8StringEncoding] autorelease];
-				break;
-			case 0x07:
-				ip = [NSString stringWithFormat:@"[%x:%x:%x:%x:%x:%x:%x:%x]",OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[0]),
-					OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[2]),OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[4]),
-					OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[6]),OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[8]),
-					OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[10]),OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[12]),
-					OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[14])];
-				break;
-		}
-		afpta = (AFPTagData*)((char*)afpta+afpta->fLength);
-	}
-	return [NSString stringWithFormat:@"afp://%@/%@",dns?:(ip?:@""),volname];
+    UInt8* work = ((UInt8*)mountInfo)+mountInfo->serverNameOffset;
+    if (devdesc) {
+        *devdesc = [[[NSString alloc] initWithBytes:&work[1] length:work[0] encoding:NSUTF8StringEncoding] autorelease];
+    }
+    work = ((UInt8*)mountInfo)+mountInfo->volNameOffset;
+    NSString* volname = [[[NSString alloc] initWithBytes:&work[1] length:work[0] encoding:NSUTF8StringEncoding] autorelease];
+    work = ((UInt8*)mountInfo)+mountInfo->alternateAddressOffset;
+    AFPAlternateAddress* afpa = (AFPAlternateAddress*)work;
+    AFPTagData* afpta = (AFPTagData*)(&afpa->fAddressList);
+    NSString* ip = nil;
+    NSString* dns = nil;
+    int i = afpa->fAddressCount;
+    while ((i-->0)) {
+        switch (afpta->fType) {
+            case kAFPTagTypeIP:
+                if (!ip) {
+                    ip = [[[NSString alloc] initWithBytes:&afpta->fData[0] length:afpta->fLength-2 encoding:NSUTF8StringEncoding] autorelease];
+                }
+                break;
+            case kAFPTagTypeIPPort:
+                ip = [NSString stringWithFormat:@"%u.%u.%u.%u:%u",afpta->fData[0],afpta->fData[1],afpta->fData[2],afpta->fData[3],OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[4])];
+                break;
+            case kAFPTagTypeDNS:
+                dns = [[[NSString alloc] initWithBytes:&afpta->fData[0] length:afpta->fLength-2 encoding:NSUTF8StringEncoding] autorelease];
+                break;
+            case 0x07:
+                ip = [NSString stringWithFormat:@"[%x:%x:%x:%x:%x:%x:%x:%x]",OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[0]),
+                    OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[2]),OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[4]),
+                    OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[6]),OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[8]),
+                    OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[10]),OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[12]),
+                    OSSwapBigToHostInt16(*(UInt16*)&afpta->fData[14])];
+                break;
+        }
+        afpta = (AFPTagData*)((char*)afpta+afpta->fLength);
+    }
+    return [NSString stringWithFormat:@"afp://%@/%@",dns?:(ip?:@""),volname];
 }
 */
 
@@ -172,92 +172,92 @@
 // This assumes that the length of path is less than PATH_MAX (currently 1024 characters).
 
 - (NSDictionary*)propertiesForPath:(NSString*)path {
-	const char* ccpath = (const char*)[path fileSystemRepresentation];
-	NSMutableDictionary* result = nil;
-	struct statfs fs;
-	if (!statfs(ccpath,&fs)) {
-		NSString* from = [NSString stringWithUTF8String:fs.f_mntfromname];
-		result = [NSMutableDictionary dictionaryWithObjectsAndKeys:
-			[NSString stringWithUTF8String:fs.f_fstypename],NSWorkspace_RBfstypename,
-			[NSString stringWithUTF8String:fs.f_mntonname],NSWorkspace_RBmntonname,
-			nil];
-		if (strncmp(fs.f_mntfromname,"/dev/",5)==0) {
+    const char* ccpath = (const char*)[path fileSystemRepresentation];
+    NSMutableDictionary* result = nil;
+    struct statfs fs;
+    if (!statfs(ccpath,&fs)) {
+        NSString* from = [NSString stringWithUTF8String:fs.f_mntfromname];
+        result = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+            [NSString stringWithUTF8String:fs.f_fstypename],NSWorkspace_RBfstypename,
+            [NSString stringWithUTF8String:fs.f_mntonname],NSWorkspace_RBmntonname,
+            nil];
+        if (strncmp(fs.f_mntfromname,"/dev/",5)==0) {
 // For a local volume,get the IO registry tree and search it for further info.
-			mach_port_t masterPort = 0;
-			io_iterator_t mediaIterator = 0;
-			kern_return_t kernResult = IOMasterPort(bootstrap_port,&masterPort);
-			if (kernResult==KERN_SUCCESS) {
-				CFMutableDictionaryRef classesToMatch = IOBSDNameMatching(masterPort,0,&fs.f_mntfromname[5]);
-				if (classesToMatch) {
-					kernResult = IOServiceGetMatchingServices(masterPort,classesToMatch,&mediaIterator);
-					if ((kernResult==KERN_SUCCESS)&&mediaIterator) {
-						io_object_t firstMedia = 0;
-						while ((firstMedia = IOIteratorNext(mediaIterator))) {
-							NSString* stuff = CheckParents(firstMedia,nil,result);
-							if (stuff) {
-								[result setObject:stuff forKey:NSWorkspace_RBdeviceinfo];
-							}
-							IOObjectRelease(firstMedia);
-						}
-					}
-				}
-			}
-			if (mediaIterator) {
-				IOObjectRelease(mediaIterator);
-			}
-			if (masterPort) {
-				mach_port_deallocate(mach_task_self(),masterPort);
-			}
-		}
-		//Don't need this for disk images, gets around warnings for some deprecated functions
+            mach_port_t masterPort = 0;
+            io_iterator_t mediaIterator = 0;
+            kern_return_t kernResult = IOMasterPort(bootstrap_port,&masterPort);
+            if (kernResult==KERN_SUCCESS) {
+                CFMutableDictionaryRef classesToMatch = IOBSDNameMatching(masterPort,0,&fs.f_mntfromname[5]);
+                if (classesToMatch) {
+                    kernResult = IOServiceGetMatchingServices(masterPort,classesToMatch,&mediaIterator);
+                    if ((kernResult==KERN_SUCCESS)&&mediaIterator) {
+                        io_object_t firstMedia = 0;
+                        while ((firstMedia = IOIteratorNext(mediaIterator))) {
+                            NSString* stuff = CheckParents(firstMedia,nil,result);
+                            if (stuff) {
+                                [result setObject:stuff forKey:NSWorkspace_RBdeviceinfo];
+                            }
+                            IOObjectRelease(firstMedia);
+                        }
+                    }
+                }
+            }
+            if (mediaIterator) {
+                IOObjectRelease(mediaIterator);
+            }
+            if (masterPort) {
+                mach_port_deallocate(mach_task_self(),masterPort);
+            }
+        }
+        //Don't need this for disk images, gets around warnings for some deprecated functions
 
-		/* else {
+        /* else {
 // For a network volume, get the volume reference number and use to get the server URL.
-			FSRef ref;
-			if (FSPathMakeRef((const UInt8*)ccpath,&ref,NULL)==noErr) {
-				FSCatalogInfo info;
-				if (FSGetCatalogInfo(&ref,kFSCatInfoVolume,&info,NULL,NULL,NULL)==noErr) {
-					ParamBlockRec pb;
-					UInt16 vmisize = 0;
-					VolumeMountInfoHeaderPtr mountInfo = NULL;
-					pb.ioParam.ioCompletion = NULL;
-					pb.ioParam.ioNamePtr = NULL;
-					pb.ioParam.ioVRefNum = info.volume;
-					pb.ioParam.ioBuffer = (Ptr)&vmisize;
-					pb.ioParam.ioReqCount = sizeof(vmisize);
-					if ((PBGetVolMountInfoSize(&pb)==noErr)&&vmisize) {
-						mountInfo = (VolumeMountInfoHeaderPtr)malloc(vmisize);
-						if (mountInfo) {
-							pb.ioParam.ioBuffer = (Ptr)mountInfo;
-							pb.ioParam.ioReqCount = vmisize;
-							if (PBGetVolMountInfo(&pb)==noErr) {
-								NSString* url = nil;
-								switch (mountInfo->media) {
-								case AppleShareMediaType:
-									url = FormatAFPURL((AFPXVolMountInfoPtr)mountInfo,&from);
-									break;
-								case 'http':
-									url = from;
-									break;
-								case 'crbm':
-								case 'nfs_':
-								case 'cifs':
-									url = [NSString stringWithUTF8String:(char*)mountInfo+sizeof(VolumeMountInfoHeader)+sizeof(OSType)];
-									break;
-								}
-								if (url) {
-									[result setObject:url forKey:NSWorkspace_RBserverURL];
-								}
-							}
-						}
-						free(mountInfo);
-					}
-				}
-			}
-		}*/
-		[result setObject:from forKey:NSWorkspace_RBmntfromname];
-	}
-	return result;
+            FSRef ref;
+            if (FSPathMakeRef((const UInt8*)ccpath,&ref,NULL)==noErr) {
+                FSCatalogInfo info;
+                if (FSGetCatalogInfo(&ref,kFSCatInfoVolume,&info,NULL,NULL,NULL)==noErr) {
+                    ParamBlockRec pb;
+                    UInt16 vmisize = 0;
+                    VolumeMountInfoHeaderPtr mountInfo = NULL;
+                    pb.ioParam.ioCompletion = NULL;
+                    pb.ioParam.ioNamePtr = NULL;
+                    pb.ioParam.ioVRefNum = info.volume;
+                    pb.ioParam.ioBuffer = (Ptr)&vmisize;
+                    pb.ioParam.ioReqCount = sizeof(vmisize);
+                    if ((PBGetVolMountInfoSize(&pb)==noErr)&&vmisize) {
+                        mountInfo = (VolumeMountInfoHeaderPtr)malloc(vmisize);
+                        if (mountInfo) {
+                            pb.ioParam.ioBuffer = (Ptr)mountInfo;
+                            pb.ioParam.ioReqCount = vmisize;
+                            if (PBGetVolMountInfo(&pb)==noErr) {
+                                NSString* url = nil;
+                                switch (mountInfo->media) {
+                                case AppleShareMediaType:
+                                    url = FormatAFPURL((AFPXVolMountInfoPtr)mountInfo,&from);
+                                    break;
+                                case 'http':
+                                    url = from;
+                                    break;
+                                case 'crbm':
+                                case 'nfs_':
+                                case 'cifs':
+                                    url = [NSString stringWithUTF8String:(char*)mountInfo+sizeof(VolumeMountInfoHeader)+sizeof(OSType)];
+                                    break;
+                                }
+                                if (url) {
+                                    [result setObject:url forKey:NSWorkspace_RBserverURL];
+                                }
+                            }
+                        }
+                        free(mountInfo);
+                    }
+                }
+            }
+        }*/
+        [result setObject:from forKey:NSWorkspace_RBmntfromname];
+    }
+    return result;
 }
 
 @end
--- a/QTfrontend/util/platform/xfire_license.txt	Sat Jan 26 22:59:48 2013 +0400
+++ b/QTfrontend/util/platform/xfire_license.txt	Sat Jan 26 23:56:10 2013 +0100
@@ -1,6 +1,6 @@
 Terms and Conditions
 AGREEMENT BETWEEN USER AND XFIRE INC.
-This is a legal agreement between you and Xfire Inc. ("Xfire") with respect to your access and use of the Xfire Service, which may also include Xfire software, content and related documentation and information (collectively, the "Service"). You must accept without modification all of the terms, conditions, and notices contained in these Terms of Use in order to access and/or use the Service (collectively, the "Terms of Use" or "Agreement"). If you do not accept these Terms of Use in their entirety, you may not access or use the Service. 
+This is a legal agreement between you and Xfire Inc. ("Xfire") with respect to your access and use of the Xfire Service, which may also include Xfire software, content and related documentation and information (collectively, the "Service"). You must accept without modification all of the terms, conditions, and notices contained in these Terms of Use in order to access and/or use the Service (collectively, the "Terms of Use" or "Agreement"). If you do not accept these Terms of Use in their entirety, you may not access or use the Service.
 
 Portions of the Service may be governed by posted guidelines, rules, or other terms and conditions. All such guidelines, rules, terms and conditions are hereby incorporated by reference into these Terms of Use. In the event of a conflict between such other guidelines, rules, terms and conditions and these Terms of Use, the Terms of Use shall control, except that the Xfire Service Privacy Policy, referenced below, supersedes any conflicting language in these Terms of Use and/or any other guidelines, rules, terms and conditions published in connection with the Service with respect to the subject matter covered by such privacy policy.
 
@@ -20,29 +20,29 @@
 You agree to use the Service only to send, receive, and transfer appropriate messages and material. By way of example, and not as a limitation, you agree that when using the Service, you will not:
 
 
-• Use the Service in connection with surveys, contests, pyramid schemes, chain letters, junk email, spamming or any duplicative, bulk or unsolicited messages (commercial or otherwise). 
+• Use the Service in connection with surveys, contests, pyramid schemes, chain letters, junk email, spamming or any duplicative, bulk or unsolicited messages (commercial or otherwise).
 
-• Defame, abuse, harass, stalk, threaten or otherwise violate the legal rights (such as rights of privacy and publicity) of others. 
+• Defame, abuse, harass, stalk, threaten or otherwise violate the legal rights (such as rights of privacy and publicity) of others.
 
-• Create a false identity for the purpose of misleading others. 
+• Create a false identity for the purpose of misleading others.
 
-• Publish, transfer, distribute or disseminate any inappropriate, profane, defamatory, obscene, indecent or unlawful topic, name, material or information. 
+• Publish, transfer, distribute or disseminate any inappropriate, profane, defamatory, obscene, indecent or unlawful topic, name, material or information.
 
-• Transfer, stream, or otherwise make available, files or other material that contain images, photographs, software or other material protected by intellectual property laws, including, by way of example, and not as limitation, copyright or trademark laws (or by rights of privacy or publicity) unless you own or control the rights thereto or have received all necessary consents to do the same. 
+• Transfer, stream, or otherwise make available, files or other material that contain images, photographs, software or other material protected by intellectual property laws, including, by way of example, and not as limitation, copyright or trademark laws (or by rights of privacy or publicity) unless you own or control the rights thereto or have received all necessary consents to do the same.
 
-• Use any material or information, including images or photographs, which is made available through the Service in any manner that infringes any copyright, trademark, patent, trade secret, or other proprietary right of any party. 
+• Use any material or information, including images or photographs, which is made available through the Service in any manner that infringes any copyright, trademark, patent, trade secret, or other proprietary right of any party.
 
-• Transfer, stream or otherwise make available, files or other material that contain viruses, Trojan horses, worms, time bombs, cancelbots, corrupted files, or any other similar software or programs that may damage the operation of another's computer or property of another. 
+• Transfer, stream or otherwise make available, files or other material that contain viruses, Trojan horses, worms, time bombs, cancelbots, corrupted files, or any other similar software or programs that may damage the operation of another's computer or property of another.
 
-• Download any file or other material transferred by another user of the Service that you know, or reasonably should know, cannot be legally distributed in such manner. 
+• Download any file or other material transferred by another user of the Service that you know, or reasonably should know, cannot be legally distributed in such manner.
 
-• Use, download or otherwise copy, or provide (whether or not for a fee) to a person or entity any directory of users of the Service or other user or usage information or any portion thereof. 
+• Use, download or otherwise copy, or provide (whether or not for a fee) to a person or entity any directory of users of the Service or other user or usage information or any portion thereof.
 
-• Falsify or delete any author attributions, legal or other proper notices or proprietary designations or labels of the origin or source of software or other material contained in a file that is transferred. 
+• Falsify or delete any author attributions, legal or other proper notices or proprietary designations or labels of the origin or source of software or other material contained in a file that is transferred.
 
-• Violate any code of conduct or other guidelines which may be applicable to the Service. 
+• Violate any code of conduct or other guidelines which may be applicable to the Service.
 
-• Use any portion of the Service to harvest or otherwise collect information about others, including e-mail addresses. 
+• Use any portion of the Service to harvest or otherwise collect information about others, including e-mail addresses.
 
 Xfire reserves the right at all times to monitor communications on the Service and disclose any information Xfire deems necessary to (i) ensure your compliance with this Agreement; (ii) satisfy any applicable law, regulation or legal process; or (iii) protect the rights, property, and interests of Xfire, its employees or the public. Xfire also reserves the right to edit, refuse to transfer or to remove any information or materials, in whole or in part, in Xfire's sole discretion.
 
--- a/QTfrontend/util/platform/xfiregameclient.cpp	Sat Jan 26 22:59:48 2013 +0400
+++ b/QTfrontend/util/platform/xfiregameclient.cpp	Sat Jan 26 23:56:10 2013 +0100
@@ -34,88 +34,88 @@
 
 int XfireIsLoaded()
 {
-	HelperInit();
-	if (ptr_XfireSetCustomGameDataA &&
-		ptr_XfireSetCustomGameDataW &&
-		ptr_XfireSetCustomGameDataUTF8)
-		return 1;
-	return 0;
+    HelperInit();
+    if (ptr_XfireSetCustomGameDataA &&
+        ptr_XfireSetCustomGameDataW &&
+        ptr_XfireSetCustomGameDataUTF8)
+        return 1;
+    return 0;
 }
 
 int XfireSetCustomGameDataA(int num_keys, const char **keys, const char **values)
 {
-	HelperInit();
-	if (ptr_XfireSetCustomGameDataA)
-		return ptr_XfireSetCustomGameDataA(num_keys, keys, values);
-	return 1;
+    HelperInit();
+    if (ptr_XfireSetCustomGameDataA)
+        return ptr_XfireSetCustomGameDataA(num_keys, keys, values);
+    return 1;
 }
 
 int XfireSetCustomGameDataW(int num_keys, const wchar_t **keys, const wchar_t **values)
 {
-	HelperInit();
-	if (ptr_XfireSetCustomGameDataW)
-		return ptr_XfireSetCustomGameDataW(num_keys, keys, values);
-	return 1;
+    HelperInit();
+    if (ptr_XfireSetCustomGameDataW)
+        return ptr_XfireSetCustomGameDataW(num_keys, keys, values);
+    return 1;
 }
 
 int XfireSetCustomGameDataUTF8(int num_keys, const char **keys, const char **values)
 {
-	HelperInit();
-	if (ptr_XfireSetCustomGameDataUTF8)
-		return ptr_XfireSetCustomGameDataUTF8(num_keys, keys, values);
-	return 1;
+    HelperInit();
+    if (ptr_XfireSetCustomGameDataUTF8)
+        return ptr_XfireSetCustomGameDataUTF8(num_keys, keys, values);
+    return 1;
 }
 
 /* ------------------------------------------------------------------------- */
 static void HelperInit()
 {
-	if (!ptr_XfireSetCustomGameDataA ||
-		!ptr_XfireSetCustomGameDataW ||
-		!ptr_XfireSetCustomGameDataUTF8)
-	{
-		HMODULE toucan_dll = HelperGetToucanDLL();
-		if (toucan_dll)
-		{
-			ptr_XfireSetCustomGameDataA = (XfireSetCustomGameDataAFunction)::GetProcAddress(toucan_dll, "ToucanSendGameClientDataA_V1");
-			ptr_XfireSetCustomGameDataW = (XfireSetCustomGameDataWFunction)::GetProcAddress(toucan_dll, "ToucanSendGameClientDataW_V1");
-			ptr_XfireSetCustomGameDataUTF8 = (XfireSetCustomGameDataUTF8Function)::GetProcAddress(toucan_dll, "ToucanSendGameClientDataUTF8_V1");
-		}
-	}
+    if (!ptr_XfireSetCustomGameDataA ||
+        !ptr_XfireSetCustomGameDataW ||
+        !ptr_XfireSetCustomGameDataUTF8)
+    {
+        HMODULE toucan_dll = HelperGetToucanDLL();
+        if (toucan_dll)
+        {
+            ptr_XfireSetCustomGameDataA = (XfireSetCustomGameDataAFunction)::GetProcAddress(toucan_dll, "ToucanSendGameClientDataA_V1");
+            ptr_XfireSetCustomGameDataW = (XfireSetCustomGameDataWFunction)::GetProcAddress(toucan_dll, "ToucanSendGameClientDataW_V1");
+            ptr_XfireSetCustomGameDataUTF8 = (XfireSetCustomGameDataUTF8Function)::GetProcAddress(toucan_dll, "ToucanSendGameClientDataUTF8_V1");
+        }
+    }
 }
 
 
 static HMODULE HelperGetToucanDLL()
 {
-	if (g_toucan_dll)
-		return g_toucan_dll;
+    if (g_toucan_dll)
+        return g_toucan_dll;
 
-	/*
-	** We need to enumerate the DLLs loaded to find toucan dll.
-	** This is done because the toucan dll changes with each update.
-	** The toucan dll has the following format. "xfire_toucan_{BUILD_NUMBER}.dll"
-	** We simply try to find a dll w/ the prefix "xfire_toucan"
-	*/
-	HANDLE snapshot_handle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
-	if (snapshot_handle != INVALID_HANDLE_VALUE)
-	{
-		MODULEENTRY32 module_entry;
-		module_entry.dwSize = sizeof(MODULEENTRY32);
+    /*
+    ** We need to enumerate the DLLs loaded to find toucan dll.
+    ** This is done because the toucan dll changes with each update.
+    ** The toucan dll has the following format. "xfire_toucan_{BUILD_NUMBER}.dll"
+    ** We simply try to find a dll w/ the prefix "xfire_toucan"
+    */
+    HANDLE snapshot_handle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
+    if (snapshot_handle != INVALID_HANDLE_VALUE)
+    {
+        MODULEENTRY32 module_entry;
+        module_entry.dwSize = sizeof(MODULEENTRY32);
 
-		BOOL result = Module32First(snapshot_handle, &module_entry);
-		char module_name[] = "xfire_toucan";
-		DWORD module_name_len = sizeof(module_name)-1;
-		while (result)
-		{
-			if (CompareStringA(LOCALE_USER_DEFAULT, NORM_IGNORECASE, module_entry.szModule, module_name_len, module_name, module_name_len) == CSTR_EQUAL)
-			{
-				g_toucan_dll = module_entry.hModule;
-				break;
-			}
-			result = Module32Next(snapshot_handle, &module_entry);
-		}
+        BOOL result = Module32First(snapshot_handle, &module_entry);
+        char module_name[] = "xfire_toucan";
+        DWORD module_name_len = sizeof(module_name)-1;
+        while (result)
+        {
+            if (CompareStringA(LOCALE_USER_DEFAULT, NORM_IGNORECASE, module_entry.szModule, module_name_len, module_name, module_name_len) == CSTR_EQUAL)
+            {
+                g_toucan_dll = module_entry.hModule;
+                break;
+            }
+            result = Module32Next(snapshot_handle, &module_entry);
+        }
 
-		CloseHandle(snapshot_handle);
-	}
+        CloseHandle(snapshot_handle);
+    }
 
-	return g_toucan_dll;
+    return g_toucan_dll;
 }