From patchwork Tue May 29 18:08:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Programmingkid X-Patchwork-Id: 10436657 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CAFBF601E9 for ; Tue, 29 May 2018 18:09:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB54A28786 for ; Tue, 29 May 2018 18:09:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFEC02879E; Tue, 29 May 2018 18:09:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1EDC128786 for ; Tue, 29 May 2018 18:09:34 +0000 (UTC) Received: from localhost ([::1]:34335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNj3t-0004Me-GH for patchwork-qemu-devel@patchwork.kernel.org; Tue, 29 May 2018 14:09:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNj2v-00045c-34 for qemu-devel@nongnu.org; Tue, 29 May 2018 14:08:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNj2r-0005bX-AH for qemu-devel@nongnu.org; Tue, 29 May 2018 14:08:33 -0400 Received: from mail-it0-x241.google.com ([2607:f8b0:4001:c0b::241]:37154) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNj2r-0005bC-5J for qemu-devel@nongnu.org; Tue, 29 May 2018 14:08:29 -0400 Received: by mail-it0-x241.google.com with SMTP id l6-v6so6402313iti.2 for ; Tue, 29 May 2018 11:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=h9B+6NhWwpr1ZFtcewMBQjM++U9JeQvJGLOl5x67wyE=; b=EAaQekmn8z2N8m/FMHZ7/KY9i0ImSUhydacujYEUJN19wNF5Be2Pw2UXm1Z+SCPvJy EPGkZS6uk84MjSccfhG6qK+i9lsZbJZXgfo3j/QiXESE0NlSBZeGivaIcZ2ZJUsVzwxe JWrhjdCDVD8/JsB0ECMEddxxs3ZWYLxqfCbcvvrZWTzUl5o3BCg5+K9GXO1xptwDSkYF isYdmK02BWTcBzZ9oiZOXtlejqpvI8AGxi14HtDCOX24D7JmU/LVOZaS7z/sSuOd2XyH WW74XZ2pXWKQNGM780mMtjFR1KRho3nMMtNKxN/4vZQhmUlpadqmx8SBdpejw3ABI+PO 660w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=h9B+6NhWwpr1ZFtcewMBQjM++U9JeQvJGLOl5x67wyE=; b=smElHkg+zmCLH+xKtCpWsH0ZrRyjLSdrwOCTtY+bzR/Tr0itfhD7ys4L4Gmez5LApu JoMfxGegfVhiCEA9ciaxLDn6CLkvtFqcdENW+s5gIji4f1AeMg5taUACFSyCP4XsSh/p U2W/BZpKtCZ2Yl9nJ2+jiN4zhQsKPO4EM6gMZRujCr3bCHekBUDahSlXP7fzmQ+cpoFl kPrXTsC7/9KPc0QZOaEGXX/ynbmV+vxg03EQAXOFKdlLYIcphTV5kAVksKa5Ux/zZ3u/ UjHkk9UkW8N7kelAjPGgqNiE7x0aDdpzZjx+5QPETK2VW21Q77hDYFwA7LWQLARnxwCE /nWg== X-Gm-Message-State: ALKqPwfE+e82UEKKYBFCsMKSPy9t8OYLlT5UzI4bKlpKkdGpJh3da1bx xKyF+BOkRwWTXgNfVlpRZjuo3w== X-Google-Smtp-Source: AB8JxZq3z3gHCH9iZ8ka+zBkzUC/yV1DrnzpiGVkzpNGVmRL2cnBra4+C7YFQ8M5C+TK9+w33qJ1wQ== X-Received: by 2002:a24:7451:: with SMTP id o78-v6mr15228459itc.113.1527617308296; Tue, 29 May 2018 11:08:28 -0700 (PDT) Received: from localhost.localdomain ([69.14.184.20]) by smtp.gmail.com with ESMTPSA id d16-v6sm16629036iob.74.2018.05.29.11.08.26 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 29 May 2018 11:08:27 -0700 (PDT) From: John Arbuckle To: qemu-devel@nongnu.org, peter.maydell@linaro.org, patches@linaro.org Date: Tue, 29 May 2018 14:08:13 -0400 Message-Id: <20180529180813.2647-1-programmingkidx@gmail.com> X-Mailer: git-send-email 2.14.3 (Apple Git-98) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::241 Subject: [Qemu-devel] [PATCH] ui/cocoa.m: Suppress NSFileHandlingPanelOKButton depreciation warning X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Arbuckle Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP OSX 10.13 deprecates the NSFileHandlingPanelOKButton constant, and would rather you use NSModalResponseOK, which was introduced in OS 10.9. Use the recommended new constant name, with a backward compatibility define if we're building on an older OSX. Signed-off-by: John Arbuckle --- ui/cocoa.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 110b393..c9473f0 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -79,6 +79,13 @@ #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask #define NSWindowStyleMaskTitled NSTitledWindowMask #endif +/* 10.13 deprecates NSFileHandlingPanelOKButton in favor of + * NSModalResponseOK, which was introduced in 10.9. Define + * it for older versions. + */ +#if !defined MAC_OS_X_VERSION_10_9 || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9 +#define NSModalResponseOK NSFileHandlingPanelOKButton +#endif //#define DEBUG @@ -1218,7 +1225,7 @@ QemuCocoaView *cocoaView; [openPanel setCanChooseFiles: YES]; [openPanel setAllowsMultipleSelection: NO]; [openPanel setAllowedFileTypes: supportedImageFileTypes]; - if([openPanel runModal] == NSFileHandlingPanelOKButton) { + if([openPanel runModal] == NSModalResponseOK) { NSString * file = [[[openPanel URLs] objectAtIndex: 0] path]; if(file == nil) { NSBeep();