D10415: Fix realDpi function for Mac

René J.V. Bertin noreply at phabricator.kde.org
Sun Feb 11 12:38:15 UTC 2018


rjvbb added a comment.


  In D10415#203663 <https://phabricator.kde.org/D10415#203663>, @sbragin wrote:
  
  > It does work. The old one uses deprecated methods, doesn't work properly and can not be even compiled, in fact.
  
  
  How so? I have been building Okular on Mac for a long time (IIRC since before the master branch was KF5 based) and the only change I currently make to utils.cpp is
  
    diff --git a/core/utils.cpp b/core/utils.cpp
    index c9bfc2d56be26ee8a49164eb93f566352adb0696..b8c955fef9a4de7659632d7ee509961b4a540937 100644
    --- a/core/utils.cpp
    +++ b/core/utils.cpp
    @@ -134,7 +134,7 @@ QSizeF Utils::realDpi(QWidget* widgetOnScreen)
             return err;
         }
     
    -double Utils::realDpiX()
    +static double realDpiX()
     {
         double x,y;
         CGDisplayErr err = GetDisplayDPI( CGDisplayCurrentMode(kCGDirectMainDisplay),
    @@ -144,7 +144,7 @@ double Utils::realDpiX()
         return err == CGDisplayNoErr ? x : 72.0;
     }
     
    -double Utils::realDpiY()
    +static double realDpiY()
     {
         double x,y;
         CGDisplayErr err = GetDisplayDPI( CGDisplayCurrentMode(kCGDirectMainDisplay),
  
  Which is probably the equivalent of the proposed change :) The resulting code compiles, however, on 10.9.5 and newer (IIRC also on 10.13).
  
  > Does it apply also [...] on all the supported versions of macOS?
  
  What are the supported versions of OS X anyway, beyond those called macOS? All versions that run an unpatched minimum Qt version (that would mean OS X 10.9)?

REPOSITORY
  R223 Okular

REVISION DETAIL
  https://phabricator.kde.org/D10415

To: sbragin, #okular
Cc: rjvbb, cullmann, aacid, kde-mac, ltoscano, #okular, michaelweghorn, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-mac/attachments/20180211/13343369/attachment.html>


More information about the kde-mac mailing list