From df772d0477d5c6e4c3273b9117964dbe0e39382c Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 10 Mar 2016 18:37:37 +0000 Subject: [PATCH] generic: misc cleanups Signed-off-by: Ivailo Monev --- amarok/src/configdialog/dialogs/NotificationsConfig.cpp | 4 ++-- amarok/src/widgets/Osd.cpp | 2 +- kolourpaint/document/kpDocument.cpp | 1 - kolourpaint/document/kpDocument_Open.cpp | 1 - kolourpaint/document/kpDocument_Selection.cpp | 1 - kolourpaint/kolourpaint.cpp | 1 - kolourpaint/mainWindow/kpMainWindow_File.cpp | 5 +---- kolourpaint/widgets/kpDocumentSaveOptionsWidget.cpp | 1 - ksnapshot/ksnapshot.cpp | 2 +- ksnapshot/main.cpp | 1 - okular/conf/dlgpresentation.cpp | 2 +- okular/ui/presentationwidget.cpp | 6 +++--- yakuake/app/config/windowsettings.cpp | 5 +++-- yakuake/app/mainwindow.cpp | 7 ++++--- 14 files changed, 16 insertions(+), 23 deletions(-) diff --git a/amarok/src/configdialog/dialogs/NotificationsConfig.cpp b/amarok/src/configdialog/dialogs/NotificationsConfig.cpp index 711efcf0..4fc70934 100644 --- a/amarok/src/configdialog/dialogs/NotificationsConfig.cpp +++ b/amarok/src/configdialog/dialogs/NotificationsConfig.cpp @@ -53,8 +53,8 @@ NotificationsConfig::NotificationsConfig( QWidget* parent ) connect( m_osdPreview, SIGNAL(positionChanged()), SLOT(slotPositionChanged()) ); - const int numScreens = QApplication::desktop()->numScreens(); - for( int i = 0; i < numScreens; i++ ) + const int screenCount = QApplication::desktop()->screenCount(); + for( int i = 0; i < screenCount; i++ ) kcfg_OsdScreen->addItem( QString::number( i ) ); connect( kcfg_OsdTextColor, SIGNAL(changed(QColor)), diff --git a/amarok/src/widgets/Osd.cpp b/amarok/src/widgets/Osd.cpp index a6f6e3c0..4a9f0508 100644 --- a/amarok/src/widgets/Osd.cpp +++ b/amarok/src/widgets/Osd.cpp @@ -463,7 +463,7 @@ OSDWidget::setTextColor(const QColor& color) void OSDWidget::setScreen( int screen ) { - const int n = QApplication::desktop()->numScreens(); + const int n = QApplication::desktop()->screenCount(); m_screen = ( screen >= n ) ? n - 1 : screen; } diff --git a/kolourpaint/document/kpDocument.cpp b/kolourpaint/document/kpDocument.cpp index 3e9e03ec..18607aca 100644 --- a/kolourpaint/document/kpDocument.cpp +++ b/kolourpaint/document/kpDocument.cpp @@ -48,7 +48,6 @@ #include #include -#include #include #include #include diff --git a/kolourpaint/document/kpDocument_Open.cpp b/kolourpaint/document/kpDocument_Open.cpp index 1ad78a8c..a56a92ab 100644 --- a/kolourpaint/document/kpDocument_Open.cpp +++ b/kolourpaint/document/kpDocument_Open.cpp @@ -39,7 +39,6 @@ #include #include -#include #include #include #include diff --git a/kolourpaint/document/kpDocument_Selection.cpp b/kolourpaint/document/kpDocument_Selection.cpp index ccd15214..bbb96a20 100644 --- a/kolourpaint/document/kpDocument_Selection.cpp +++ b/kolourpaint/document/kpDocument_Selection.cpp @@ -40,7 +40,6 @@ #include #include -#include #include #include diff --git a/kolourpaint/kolourpaint.cpp b/kolourpaint/kolourpaint.cpp index f8de7661..cdbe36df 100644 --- a/kolourpaint/kolourpaint.cpp +++ b/kolourpaint/kolourpaint.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include diff --git a/kolourpaint/mainWindow/kpMainWindow_File.cpp b/kolourpaint/mainWindow/kpMainWindow_File.cpp index 702a3534..6c55bd4c 100644 --- a/kolourpaint/mainWindow/kpMainWindow_File.cpp +++ b/kolourpaint/mainWindow/kpMainWindow_File.cpp @@ -430,13 +430,10 @@ KUrl::List kpMainWindow::askForOpenURLs(const QString &caption, bool allowMultip { QStringList mimeTypes = KImageIO::mimeTypes (KImageIO::Reading); #if DEBUG_KP_MAIN_WINDOW - QStringList sortedMimeTypes = mimeTypes; - sortedMimeTypes.sort (); kDebug () << "kpMainWindow::askForURLs(allowMultiple=" << allowMultipleURLs << ")" << endl - << "\tmimeTypes=" << mimeTypes << endl - << "\tsortedMimeTypes=" << sortedMimeTypes << endl; + << "\tmimeTypes=" << mimeTypes << endl; #endif QString filter = mimeTypes.join (" "); diff --git a/kolourpaint/widgets/kpDocumentSaveOptionsWidget.cpp b/kolourpaint/widgets/kpDocumentSaveOptionsWidget.cpp index 6b267db2..4fb5dcc6 100644 --- a/kolourpaint/widgets/kpDocumentSaveOptionsWidget.cpp +++ b/kolourpaint/widgets/kpDocumentSaveOptionsWidget.cpp @@ -727,7 +727,6 @@ void kpDocumentSaveOptionsWidget::updatePreview () // Leave as invalid. // TODO: This code path has not been well tested. // Will we trigger divide by zero errors in "m_previewDialog"? - // KDE3: Backport any fixes to KDE 3. } // REFACTOR: merge with kpDocument::getPixmapFromFile() diff --git a/ksnapshot/ksnapshot.cpp b/ksnapshot/ksnapshot.cpp index 7d69253d..95ba84fc 100644 --- a/ksnapshot/ksnapshot.cpp +++ b/ksnapshot/ksnapshot.cpp @@ -149,7 +149,7 @@ KSnapshot::KSnapshot(QWidget *parent, KSnapshotObject::CaptureMode mode ) connect(this, SIGNAL(user1Clicked()), SLOT(slotCopy())); connect(mainWidget->comboMode, SIGNAL(activated(int)), SLOT(slotModeChanged(int))); - if (qApp->desktop()->numScreens() < 2) { + if (qApp->desktop()->screenCount() < 2) { mainWidget->comboMode->removeItem(CurrentScreen); } diff --git a/ksnapshot/main.cpp b/ksnapshot/main.cpp index 4b4f097c..9739fa58 100644 --- a/ksnapshot/main.cpp +++ b/ksnapshot/main.cpp @@ -19,7 +19,6 @@ #include -#include #include #include #include diff --git a/okular/conf/dlgpresentation.cpp b/okular/conf/dlgpresentation.cpp index 67aa8c53..f3a191f5 100644 --- a/okular/conf/dlgpresentation.cpp +++ b/okular/conf/dlgpresentation.cpp @@ -27,7 +27,7 @@ DlgPresentation::DlgPresentation( QWidget * parent ) QStringList choices; choices.append( i18nc( "@label:listbox The current screen, for the presentation mode", "Current Screen" ) ); choices.append( i18nc( "@label:listbox The default screen for the presentation mode", "Default Screen" ) ); - const int screenCount = QApplication::desktop()->numScreens(); + const int screenCount = QApplication::desktop()->screenCount(); for ( int i = 0; i < screenCount; ++i ) { choices.append( i18nc( "@label:listbox %1 is the screen number (0, 1, ...)", "Screen %1", i ) ); diff --git a/okular/ui/presentationwidget.cpp b/okular/ui/presentationwidget.cpp index 55034458..e7f8a76a 100644 --- a/okular/ui/presentationwidget.cpp +++ b/okular/ui/presentationwidget.cpp @@ -194,14 +194,14 @@ PresentationWidget::PresentationWidget( QWidget * parent, Okular::Document * doc m_topBar->addAction( eraseDrawingAct ); addAction( eraseDrawingAct ); QDesktopWidget *desktop = QApplication::desktop(); - if ( desktop->numScreens() > 1 ) + if ( desktop->screenCount() > 1 ) { m_topBar->addSeparator(); m_screenSelect = new KSelectAction( KIcon( "video-display" ), i18n( "Switch Screen" ), m_topBar ); m_screenSelect->setToolBarMode( KSelectAction::MenuMode ); m_screenSelect->setToolButtonPopupMode( QToolButton::InstantPopup ); m_topBar->addAction( m_screenSelect ); - const int screenCount = desktop->numScreens(); + const int screenCount = desktop->screenCount(); for ( int i = 0; i < screenCount; ++i ) { QAction *act = m_screenSelect->addAction( i18nc( "%1 is the screen number (0, 1, ...)", "Screen %1", i ) ); @@ -1230,7 +1230,7 @@ void PresentationWidget::recalcGeometry() { screen = desktop->primaryScreen(); } - else if ( preferenceScreen >= 0 && preferenceScreen < desktop->numScreens() ) + else if ( preferenceScreen >= 0 && preferenceScreen < desktop->screenCount() ) { screen = preferenceScreen; } diff --git a/yakuake/app/config/windowsettings.cpp b/yakuake/app/config/windowsettings.cpp index a753de8e..8063ba82 100644 --- a/yakuake/app/config/windowsettings.cpp +++ b/yakuake/app/config/windowsettings.cpp @@ -30,10 +30,11 @@ WindowSettings::WindowSettings(QWidget* parent) : QWidget(parent) { setupUi(this); - for (int i = 2; i <= QApplication::desktop()->numScreens(); i++) + const int screencount = QApplication::desktop()->screenCount(); + for (int i = 2; i <= screencount; i++) kcfg_Screen->insertItem(i, i18nc("@item:inlistbox", "Screen %1", i)); - if (QApplication::desktop()->numScreens() > 1) + if (screencount > 1) { screenLabel->setEnabled(true); kcfg_Screen->setEnabled(true); diff --git a/yakuake/app/mainwindow.cpp b/yakuake/app/mainwindow.cpp index b43d6c9c..8733783d 100644 --- a/yakuake/app/mainwindow.cpp +++ b/yakuake/app/mainwindow.cpp @@ -596,7 +596,8 @@ void MainWindow::updateScreenMenu() action->setData(0); action->setChecked(Settings::screen() == 0); - for (int i = 1; i <= KApplication::desktop()->numScreens(); i++) + const int screencount = KApplication::desktop()->screenCount(); + for (int i = 1; i <= screencount; i++) { action = m_screenMenu->addAction(i18nc("@item:inmenu", "Screen %1", i)); action->setCheckable(true); @@ -605,7 +606,7 @@ void MainWindow::updateScreenMenu() } action = m_screenMenu->menuAction(); - action->setVisible(KApplication::desktop()->numScreens() > 1); + action->setVisible(screencount > 1); } void MainWindow::updateWindowSizeMenus() @@ -1268,7 +1269,7 @@ QRect MainWindow::getDesktopGeometry() int currentDesktop = KWindowSystem::windowInfo(winId(), NET::WMDesktop).desktop(); - if (KApplication::desktop()->numScreens() > 1) + if (KApplication::desktop()->screenCount() > 1) { const QList allWindows = KWindowSystem::windows(); QList offScreenWindows; -- 2.11.0