KScreen::Config::current can return null

remotes/origin/KDE/4.13
Albert Astals Cid 12 years ago
parent 67a2a1222c
commit 9252044c0c
  1. 2
      core/utils.cpp

@ -100,6 +100,7 @@ QSizeF Utils::realDpi(QWidget* widgetOnScreen)
// Firstly try to retrieve DPI via LibKScreen // Firstly try to retrieve DPI via LibKScreen
#if HAVE_LIBKSCREEN #if HAVE_LIBKSCREEN
KScreen::Config* config = KScreen::Config::current(); KScreen::Config* config = KScreen::Config::current();
if (config) {
KScreen::OutputList outputs = config->outputs(); KScreen::OutputList outputs = config->outputs();
QPoint globalPos = widgetOnScreen->parentWidget() ? QPoint globalPos = widgetOnScreen->parentWidget() ?
widgetOnScreen->mapToGlobal(widgetOnScreen->pos()): widgetOnScreen->mapToGlobal(widgetOnScreen->pos()):
@ -136,6 +137,7 @@ QSizeF Utils::realDpi(QWidget* widgetOnScreen)
return res; return res;
} }
} }
}
#endif #endif
} }
// this is also fallback for LibKScreen branch if KScreen::Output // this is also fallback for LibKScreen branch if KScreen::Output

Loading…
Cancel
Save