summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold Dumas <contact@arnolddumas.fr>2014-09-28 12:14:19 (GMT)
committerArnold Dumas <contact@arnolddumas.fr>2014-09-28 12:14:19 (GMT)
commitdc74543bac21819f79ef01e00b39d49e3815e9d6 (patch)
tree0d140666adc28b3db05bf6dd2b038396a0c1d5f1
parenta6db7a2655846740a22888a3d2cb68c8e3d697a2 (diff)
Port away from KGlobalSettings::desktopGeometry().
-rw-r--r--ui/pageview.cpp6
-rw-r--r--ui/propertiesdialog.cpp5
-rw-r--r--ui/thumbnaillist.cpp5
3 files changed, 9 insertions, 7 deletions
diff --git a/ui/pageview.cpp b/ui/pageview.cpp
index 9770f52..c3014f4 100644
--- a/ui/pageview.cpp
+++ b/ui/pageview.cpp
@@ -33,6 +33,7 @@
#include <qclipboard.h>
#include <qmenu.h>
#include <QInputDialog>
+#include <qdesktopwidget.h>
#include <kaction.h>
#include <kactionmenu.h>
@@ -41,7 +42,6 @@
#include <klocale.h>
#include <kfiledialog.h>
#include <kglobal.h>
-#include <kglobalsettings.h>
#include <kselectaction.h>
#include <ktoggleaction.h>
#include <QtCore/QDebug>
@@ -1866,7 +1866,7 @@ void PageView::mouseMoveEvent( QMouseEvent * e )
int deltaY = d->mouseMidLastY - mouseY;
// wrap mouse from top to bottom
- const QRect mouseContainer = KGlobalSettings::desktopGeometry( this );
+ const QRect mouseContainer = QApplication::desktop()->screenGeometry( this );
const int absDeltaY = abs(deltaY);
if ( absDeltaY > mouseContainer.height() / 2 )
{
@@ -1953,7 +1953,7 @@ void PageView::mouseMoveEvent( QMouseEvent * e )
QPoint delta = d->mouseGrabPos - mousePos;
// wrap mouse from top to bottom
- const QRect mouseContainer = KGlobalSettings::desktopGeometry( this );
+ const QRect mouseContainer = QApplication::desktop()->screenGeometry( this );
// If the delta is huge it probably means we just wrapped in that direction
const QPoint absDelta(abs(delta.x()), abs(delta.y()));
if ( absDelta.y() > mouseContainer.height() / 2 )
diff --git a/ui/propertiesdialog.cpp b/ui/propertiesdialog.cpp
index ac517f4..736b516 100644
--- a/ui/propertiesdialog.cpp
+++ b/ui/propertiesdialog.cpp
@@ -10,6 +10,8 @@
#include "propertiesdialog.h"
// qt/kde includes
+#include <qapplication.h>
+#include <qdesktopwidget.h>
#include <qfile.h>
#include <qlayout.h>
#include <qformlayout.h>
@@ -27,7 +29,6 @@
#include <klocale.h>
#include <kmessagebox.h>
#include <ksqueezedtextlabel.h>
-#include <kglobalsettings.h>
#include <kurl.h>
// local includes
@@ -171,7 +172,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, Okular::Document *doc)
// width = qMax( width, page2Layout->sizeHint().width() + marginHint() + spacingHint() + 31 );
width = qMax( width, page2Layout->sizeHint().width() + 31 );
// stay inside the 2/3 of the screen width
- QRect screenContainer = KGlobalSettings::desktopGeometry( this );
+ QRect screenContainer = QApplication::desktop()->screenGeometry( this );
width = qMin( width, 2*screenContainer.width()/3 );
resize(width, 1);
diff --git a/ui/thumbnaillist.cpp b/ui/thumbnaillist.cpp
index a01f5e1..dc4dd5f 100644
--- a/ui/thumbnaillist.cpp
+++ b/ui/thumbnaillist.cpp
@@ -10,6 +10,8 @@
#include "thumbnaillist.h"
// qt/kde includes
+#include <qapplication.h>
+#include <qdesktopwidget.h>
#include <qevent.h>
#include <qtimer.h>
#include <qpainter.h>
@@ -22,7 +24,6 @@
#include <kiconloader.h>
#include <kactioncollection.h>
#include <kicon.h>
-#include <kglobalsettings.h>
// local includes
#include "pagepainter.h"
@@ -848,7 +849,7 @@ void ThumbnailListPrivate::mouseMoveEvent( QMouseEvent * e )
m_mouseGrabItem = getPageByNumber( m_pageCurrentlyGrabbed );
}
// wrap mouse from top to bottom
- const QRect mouseContainer = KGlobalSettings::desktopGeometry( this );
+ const QRect mouseContainer = QApplication::desktop()->screenGeometry( this );
QPoint currentMousePos = QCursor::pos();
if ( currentMousePos.y() <= mouseContainer.top() + 4 )
{