<commit_before>#include "PlatformInterface.h"

#include "Utils.h"
#include "ZulipApplication.h"
#include "ZulipWindow.h"

#include <QDir>
#include <QTimer>

#import <Foundation/Foundation.h>
#import <Sparkle/SUUpdater.h>
#import <Growl/GrowlApplicationBridge.h>

#if defined(LION) || defined(MOUNTAIN_LION)
#define SET_LION_FULLSCREEN NSWindowCollectionBehaviorFullScreenPrimary
#define LION_FULLSCREEN_ENTER_NOTIFICATION_VALUE NSWindowWillEnterFullScreenNotification
#define LION_FULLSCREEN_EXIT_NOTIFICATION_VALUE NSWindowDidExitFullScreenNotification
#else
#define SET_LION_FULLSCREEN (NSUInteger)(1 << 7) // Defined as NSWindowCollectionBehaviorFullScreenPrimary in lion's NSWindow.h
#define LION_FULLSCREEN_ENTER_NOTIFICATION_VALUE @"NSWindowWillEnterFullScreenNotification"
#define LION_FULLSCREEN_EXIT_NOTIFICATION_VALUE @"NSWindowDidExitFullScreenNotification"
#endif

@interface ZGrowlDelegate : NSObject <GrowlApplicationBridgeDelegate>
- (void) growlNotificationWasClicked:(id)clickContext;
@end

@implementation ZGrowlDelegate
- (void) growlNotificationWasClicked:(id)clickContext {
    APP->mainWindow()->trayClicked();
}
@end

class PlatformInterfacePrivate : public QObject {
    Q_OBJECT
public:
    PlatformInterfacePrivate(PlatformInterface *qq) : q(qq) {
        QDir binDir(QApplication::applicationDirPath());
        binDir.cdUp();
        binDir.cd("Resources");

        const QString file = binDir.absoluteFilePath("zulip.wav");
        sound = [[NSSound alloc] initWithContentsOfFile:fromQString(file)
                                            byReference:NO];

#ifdef DEBUG
        [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES]
                                                                                            forKey:@"WebKitDeveloperExtras"]];
#endif

        QTimer::singleShot(0, this, SLOT(enableFullscreen()));
    }

    ~PlatformInterfacePrivate() {
        [sound release];
    }

public slots:
    void enableFullscreen() {
        // We don't support anything below leopard, so if it's not [snow] leopard it must be lion
        // Can't check for lion as Qt 4.7 doesn't have the enum val, not checking for Unknown as it will be lion
        // on 4.8
        if ( QSysInfo::MacintoshVersion != QSysInfo::MV_SNOWLEOPARD &&
             QSysInfo::MacintoshVersion != QSysInfo::MV_LEOPARD   )
        {
            ZulipWindow *w = APP->mainWindow();

            if (!w)
                return;
<commit_msg>Fix typo and enable Web Inspector on os x debug builds<commit_after>#include "PlatformInterface.h"

#include "Utils.h"
#include "Config.h"
#include "ZulipApplication.h"
#include "ZulipWindow.h"

#include <QDir>
#include <QTimer>

#import <Foundation/Foundation.h>
#import <Sparkle/SUUpdater.h>
#import <Growl/GrowlApplicationBridge.h>

#if defined(LION) || defined(MOUNTAIN_LION)
#define SET_LION_FULLSCREEN NSWindowCollectionBehaviorFullScreenPrimary
#define LION_FULLSCREEN_ENTER_NOTIFICATION_VALUE NSWindowWillEnterFullScreenNotification
#define LION_FULLSCREEN_EXIT_NOTIFICATION_VALUE NSWindowDidExitFullScreenNotification
#else
#define SET_LION_FULLSCREEN (NSUInteger)(1 << 7) // Defined as NSWindowCollectionBehaviorFullScreenPrimary in lion's NSWindow.h
#define LION_FULLSCREEN_ENTER_NOTIFICATION_VALUE @"NSWindowWillEnterFullScreenNotification"
#define LION_FULLSCREEN_EXIT_NOTIFICATION_VALUE @"NSWindowDidExitFullScreenNotification"
#endif

@interface ZGrowlDelegate : NSObject <GrowlApplicationBridgeDelegate>
- (void) growlNotificationWasClicked:(id)clickContext;
@end

@implementation ZGrowlDelegate
- (void) growlNotificationWasClicked:(id)clickContext {
    APP->mainWindow()->trayClicked();
}
@end

class PlatformInterfacePrivate : public QObject {
    Q_OBJECT
public:
    PlatformInterfacePrivate(PlatformInterface *qq) : q(qq) {
        QDir binDir(QApplication::applicationDirPath());
        binDir.cdUp();
        binDir.cd("Resources");

        const QString file = binDir.absoluteFilePath("zulip.wav");
        sound = [[NSSound alloc] initWithContentsOfFile:fromQString(file)
                                            byReference:NO];

#ifdef DEBUG_BUILD
        [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES]
                                                                                            forKey:@"WebKitDeveloperExtras"]];
#endif

        QTimer::singleShot(0, this, SLOT(enableFullscreen()));
    }

    ~PlatformInterfacePrivate() {
        [sound release];
    }

public slots:
    void enableFullscreen() {
        // We don't support anything below leopard, so if it's not [snow] leopard it must be lion
        // Can't check for lion as Qt 4.7 doesn't have the enum val, not checking for Unknown as it will be lion
        // on 4.8
        if ( QSysInfo::MacintoshVersion != QSysInfo::MV_SNOWLEOPARD &&
             QSysInfo::MacintoshVersion != QSysInfo::MV_LEOPARD   )
        {
            ZulipWindow *w = APP->mainWindow();

            if (!w)
                return;

{'fraction_non_alphanumeric': 0.09167154281256096, 'fraction_numerical': 0.002730641700799688, 'mean_word_length': 3.636528028933092, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1436605', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1475, 'n_words': 316}