From f1bf8ab528a70824cbce62d2bf05b76a5797dd77 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 30 Jul 2023 07:24:41 +0300 Subject: [PATCH] kcontrol: remove display KCM it is essentially container for other modules and all but the randr module are not valid (not maintained as part of Katana) Signed-off-by: Ivailo Monev --- kcontrol/CMakeLists.txt | 6 +- kcontrol/hardware/CMakeLists.txt | 6 - kcontrol/hardware/display/CMakeLists.txt | 21 --- kcontrol/hardware/display/Messages.sh | 2 - kcontrol/hardware/display/display.cpp | 118 -------------- kcontrol/hardware/display/display.desktop | 187 ---------------------- kcontrol/hardware/display/display.h | 48 ------ kcontrol/{hardware => }/joystick/CMakeLists.txt | 0 kcontrol/{hardware => }/joystick/Messages.sh | 0 kcontrol/{hardware => }/joystick/caldialog.cpp | 0 kcontrol/{hardware => }/joystick/caldialog.h | 0 kcontrol/{hardware => }/joystick/joydevice.cpp | 0 kcontrol/{hardware => }/joystick/joydevice.h | 0 kcontrol/{hardware => }/joystick/joystick.cpp | 0 kcontrol/{hardware => }/joystick/joystick.desktop | 0 kcontrol/{hardware => }/joystick/joystick.h | 0 kcontrol/{hardware => }/joystick/joywidget.cpp | 0 kcontrol/{hardware => }/joystick/joywidget.h | 0 kcontrol/{hardware => }/joystick/poswidget.cpp | 0 kcontrol/{hardware => }/joystick/poswidget.h | 0 kcontrol/randr/krandrtray.cpp | 2 +- kcontrol/randr/module/randrmonitor.cpp | 4 +- 22 files changed, 8 insertions(+), 386 deletions(-) delete mode 100644 kcontrol/hardware/CMakeLists.txt delete mode 100644 kcontrol/hardware/display/CMakeLists.txt delete mode 100644 kcontrol/hardware/display/Messages.sh delete mode 100644 kcontrol/hardware/display/display.cpp delete mode 100644 kcontrol/hardware/display/display.desktop delete mode 100644 kcontrol/hardware/display/display.h rename kcontrol/{hardware => }/joystick/CMakeLists.txt (100%) rename kcontrol/{hardware => }/joystick/Messages.sh (100%) rename kcontrol/{hardware => }/joystick/caldialog.cpp (100%) rename kcontrol/{hardware => }/joystick/caldialog.h (100%) rename kcontrol/{hardware => }/joystick/joydevice.cpp (100%) rename kcontrol/{hardware => }/joystick/joydevice.h (100%) rename kcontrol/{hardware => }/joystick/joystick.cpp (100%) rename kcontrol/{hardware => }/joystick/joystick.desktop (100%) rename kcontrol/{hardware => }/joystick/joystick.h (100%) rename kcontrol/{hardware => }/joystick/joywidget.cpp (100%) rename kcontrol/{hardware => }/joystick/joywidget.h (100%) rename kcontrol/{hardware => }/joystick/poswidget.cpp (100%) rename kcontrol/{hardware => }/joystick/poswidget.h (100%) diff --git a/kcontrol/CMakeLists.txt b/kcontrol/CMakeLists.txt index f67eb932..0832b624 100644 --- a/kcontrol/CMakeLists.txt +++ b/kcontrol/CMakeLists.txt @@ -37,7 +37,6 @@ add_subdirectory( kdebug ) add_subdirectory( kmetainfo ) add_subdirectory( kpasswdstore ) -add_subdirectory( hardware ) add_subdirectory( desktoppaths ) if(FONTCONFIG_FOUND AND FREETYPE_FOUND) @@ -46,3 +45,8 @@ endif() add_subdirectory( ebrowsing ) add_subdirectory( kio ) + +if(CMAKE_SYSTEM_NAME MATCHES "Linux") + # this one doesn't seem to be very portable, Alex + add_subdirectory(joystick) +endif() \ No newline at end of file diff --git a/kcontrol/hardware/CMakeLists.txt b/kcontrol/hardware/CMakeLists.txt deleted file mode 100644 index ff8a995f..00000000 --- a/kcontrol/hardware/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_subdirectory(display) - -if(CMAKE_SYSTEM_NAME MATCHES "Linux") - # this one doesn't seem to be very portable, Alex - add_subdirectory(joystick) -endif() diff --git a/kcontrol/hardware/display/CMakeLists.txt b/kcontrol/hardware/display/CMakeLists.txt deleted file mode 100644 index a82f9a94..00000000 --- a/kcontrol/hardware/display/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -########### next target ############### - -kde4_add_plugin(kcm_display display.cpp) - -target_link_libraries(kcm_display - KDE4::kcmutils - ${QT_QTGUI_LIBRARY} - KDE4::kdeui -) - -install( - TARGETS kcm_display - DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} -) - -########### install files ############### - -install( - FILES display.desktop - DESTINATION ${KDE4_SERVICES_INSTALL_DIR} -) diff --git a/kcontrol/hardware/display/Messages.sh b/kcontrol/hardware/display/Messages.sh deleted file mode 100644 index e920158b..00000000 --- a/kcontrol/hardware/display/Messages.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -$XGETTEXT *.cpp -o $podir/display.pot diff --git a/kcontrol/hardware/display/display.cpp b/kcontrol/hardware/display/display.cpp deleted file mode 100644 index d5068b1b..00000000 --- a/kcontrol/hardware/display/display.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2003-2004 Nadeem Hasan - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include -#include -#include - -#include -#include -#include - -#include "display.h" -#include -#include - -K_PLUGIN_FACTORY(DisplayFactory, - registerPlugin(); - ) -K_EXPORT_PLUGIN(DisplayFactory("display")) - -KCMDisplay::KCMDisplay( QWidget *parent, const QVariantList & ) - : KCModule( DisplayFactory::componentData(), parent ) - , m_changed(false) -{ - m_tabs = new QTabWidget( this ); - - addTab( "randr", i18n( "Size && Orientation" ) ); - addTab( "nvidiadisplay", i18n( "Graphics Adaptor" ) ); - addTab( "nvidia3d", i18n( "3D Options" ) ); - addTab( "kgamma", i18n( "Monitor Gamma" ) ); - if ( QApplication::desktop()->isVirtualDesktop() ) - addTab( "xinerama", i18n( "Multiple Monitors" ) ); - addTab( "energy", i18n( "Power Control" ) ); - - QVBoxLayout *top = new QVBoxLayout( this ); - top->setMargin( 0 ); - top->setSpacing( KDialog::spacingHint() ); - top->addWidget( m_tabs ); - - setButtons( Apply ); - load(); -} - -void KCMDisplay::addTab( const QString &name, const QString &label ) -{ - QWidget *page = new QWidget( m_tabs ); - QVBoxLayout *top = new QVBoxLayout( page ); - top->setMargin( KDialog::marginHint() ); - - KCModule *kcm = KCModuleLoader::loadModule( name, KCModuleLoader::None,page ); - - if ( kcm ) - { - top->addWidget( kcm ); - m_tabs->addTab( page, label ); - - connect( kcm, SIGNAL(changed(bool)), SLOT(moduleChanged(bool)) ); - m_modules.insert(kcm, false); - } - else - delete page; -} - -void KCMDisplay::load() -{ - for (QMap::ConstIterator it = m_modules.constBegin(); it != m_modules.constEnd(); ++it) - it.key()->load(); -} - -void KCMDisplay::save() -{ - for (QMap::Iterator it = m_modules.begin(); it != m_modules.end(); ++it) - if (it.value()) - it.key()->save(); -} - -void KCMDisplay::moduleChanged( bool isChanged ) -{ - QMap::Iterator currentModule = m_modules.find(static_cast(const_cast(sender()))); - Q_ASSERT(currentModule != m_modules.end()); - if (currentModule.value() == isChanged) - return; - - currentModule.value() = isChanged; - - bool c = false; - - for (QMap::ConstIterator it = m_modules.constBegin(); it != m_modules.constEnd(); ++it) { - if (it.value()) { - c = true; - break; - } - } - - if (m_changed != c) { - m_changed = c; - emit changed(c); - } -} - -#include "moc_display.cpp" diff --git a/kcontrol/hardware/display/display.desktop b/kcontrol/hardware/display/display.desktop deleted file mode 100644 index 5b434ceb..00000000 --- a/kcontrol/hardware/display/display.desktop +++ /dev/null @@ -1,187 +0,0 @@ -[Desktop Entry] -Exec=kcmshell4 display -Icon=preferences-desktop-display -Type=Service -X-KDE-ServiceTypes=KCModule - -X-KDE-Library=kcm_display -X-KDE-ParentApp=kcontrol - -Name=Display -Name[af]=Skerm -Name[ar]=العرض -Name[ast]=Pantalla -Name[be]=Экран -Name[be@latin]=Ekran -Name[bg]=Екран -Name[bn]=ডিসপ্লে -Name[bn_IN]=প্রদর্শন -Name[br]=Diskwel -Name[bs]=Ekran -Name[ca]=Pantalla -Name[ca@valencia]=Pantalla -Name[cs]=Obrazovka -Name[csb]=Ekran -Name[cy]= Arddangos -Name[da]=Skærm -Name[de]=Anzeige -Name[el]=Οθόνη -Name[en_GB]=Display -Name[eo]=Vidigilo -Name[es]=Pantalla -Name[et]=Monitor -Name[eu]=Pantaila -Name[fa]=نمایش -Name[fi]=Näyttö -Name[fy]=Byldskerm -Name[ga]=Scáileán -Name[gl]=Pantalla -Name[gu]=ડિસ્પ્લે -Name[he]=תצוגה -Name[hi]=प्रदर्शक -Name[hne]=प्रदर्सक -Name[hr]=Zaslon -Name[hsb]=Wobrazowka -Name[hu]=Megjelenítés -Name[ia]=Monstrator -Name[id]=Tampilan -Name[is]=Skjár -Name[ka]=ჩვენება -Name[kk]=Дисплей -Name[km]=ការ​បង្ហាញ -Name[kn]=ಪ್ರದರ್ಶಕ -Name[ko]=표시 -Name[ku]=Dîmender -Name[lt]=Ekranas -Name[lv]=Ekrāns -Name[mai]=देखाबू -Name[mk]=Приказ -Name[ml]=പ്രദര്‍ശനം -Name[mr]=डिस्प्ले -Name[ms]=Paparan -Name[nb]=Bildeskjerm -Name[nds]=Schirm -Name[ne]=प्रदर्शन गर्नुहोस् -Name[nl]=Beeldscherm -Name[oc]=Visualizar -Name[or]=ପ୍ରଦର୍ଶକ -Name[pa]=ਡਿਸਪਲੇਅ -Name[pl]=Wyświetlanie -Name[pt]=Ecrã -Name[pt_BR]=Tela -Name[ro]=Afișare -Name[ru]=Экран -Name[se]=Šearbma -Name[si]=සංදර්ශනය -Name[sk]=Obrazovka -Name[sl]=Zaslon -Name[sr]=Екран -Name[sr@ijekavian]=Екран -Name[sr@ijekavianlatin]=Ekran -Name[sr@latin]=Ekran -Name[sv]=Bildskärm -Name[ta]=காட்சி -Name[te]=ప్రదర్శన -Name[tg]=Экран -Name[th]=การแสดงผล -Name[tr]=Ekran -Name[ug]=كۆرسەت -Name[uk]=Дисплей -Name[uz]=Displey -Name[uz@cyrillic]=Дисплей -Name[vi]=Màn hình -Name[wa]=Håynaedje -Name[x-test]=xxDisplayxx -Name[zh_CN]=显示 -Name[zh_TW]=顯示 -Comment=Display Settings -Comment[af]=Skerm Instellings -Comment[ar]=إعدادات العرض -Comment[ast]=Preferencies de la pantalla -Comment[be]=Настаўленні экрану -Comment[be@latin]=Nałady ekrana -Comment[bg]=Настройки на екрана -Comment[bn]=ডিসপ্লে সেটিংস -Comment[bn_IN]=প্রদর্শন সংক্রান্ত বৈশিষ্ট্য -Comment[br]=Kefluniañ an diskwel -Comment[bs]=Postavke ekrana -Comment[ca]=Arranjament de la pantalla -Comment[ca@valencia]=Arranjament de la pantalla -Comment[cs]=Nastavení obrazovky -Comment[csb]=Ùstôw ekranu -Comment[cy]=Gosodiadau Arddangos -Comment[da]=Skærmindstillinger -Comment[de]=Anzeige-Einstellungen -Comment[el]=Ρυθμίσεις οθόνης -Comment[en_GB]=Display Settings -Comment[eo]=Vidigila agordo -Comment[es]=Preferencias de la pantalla -Comment[et]=Monitoride seadistused -Comment[eu]=Pantailaren ezarpenak -Comment[fa]=نمایش تنظیمات -Comment[fi]=Näytön asetukset -Comment[fr]=Configuration de l'affichage -Comment[fy]=Byldskerm ynstellings -Comment[ga]=Socruithe an Scáileáin -Comment[gl]=Configuración da pantalla -Comment[gu]=ડિસ્પ્લે ગોઠવણીઓ -Comment[he]=הגדרות תצוגה -Comment[hi]=प्रकटन विन्यास -Comment[hne]=देखइया सेटिंग -Comment[hr]=Postavke zaslona -Comment[hsb]=Nastajenja za wobrazowku -Comment[hu]=Megjelenési beállítások -Comment[ia]=Monstra preferentias -Comment[id]=Pengaturan Tampilan -Comment[is]=Stillingar skjás -Comment[it]=Impostazioni dello schermo -Comment[ja]=ディスプレイの設定 -Comment[ka]=დისპლეის კონფიგურირება -Comment[kk]=Дисплей баптаулары -Comment[km]=កំណត់​ការ​បង្ហាញ -Comment[kn]=ಪ್ರದರ್ಶಕದ ಸಂಯೋಜನೆಗಳು -Comment[ko]=디스플레이 설정 -Comment[ku]=Mîhengên Dîmenderê -Comment[lt]=Ekrano parametrai -Comment[lv]=Ekrāna parametri -Comment[mai]=जमावट देखाबू -Comment[mk]=Поставувања на приказот -Comment[ml]=പ്രദര്‍ശനത്തിന്റെ സജ്ജീകരണങ്ങള്‍ -Comment[mr]=डिस्प्ले संयोजना -Comment[ms]=Seting Paparan -Comment[nb]=Skjerminnstillinger -Comment[nds]=Dorstellen inrichten -Comment[ne]=सेटिङ प्रदर्शन गर्नुहोस् -Comment[nl]=Beeldscherminstellingen -Comment[nn]=Skjerminnstillingar -Comment[or]=ପ୍ରଦର୍ଶକ ସଂରଚନା -Comment[pa]=ਡਿਸਪਲੇਅ ਸੈਟਿੰਗ -Comment[pl]=Ustawienia ekranu -Comment[pt]=Configuração do ecrã -Comment[pt_BR]=Configurações da tela -Comment[ro]=Configurări afișare -Comment[ru]=Настройка экрана -Comment[se]=Šearbmaheivehusat -Comment[si]=සංදර්ශන සැකසුම් -Comment[sk]=Nastavenie obrazovky -Comment[sl]=Nastavitve zaslona -Comment[sr]=Поставке екрана -Comment[sr@ijekavian]=Поставке екрана -Comment[sr@ijekavianlatin]=Postavke ekrana -Comment[sr@latin]=Postavke ekrana -Comment[sv]=Anpassa bildskärm -Comment[ta]=அமைப்புகளை காட்டு -Comment[te]=ప్రదర్శన అమరికలు -Comment[tg]=Танзимоти экран -Comment[th]=ตั้งค่าต่าง ๆ ของการแสดงผล -Comment[tr]=Ekran Ayarları -Comment[ug]=كۆرۈنمە يۈز تەڭشىكى -Comment[uk]=Налаштування дисплея -Comment[uz]=Displeyning moslamalari -Comment[uz@cyrillic]=Дисплейнинг мосламалари -Comment[vi]=Thiết lập hiển thị -Comment[wa]=Apontiaedjes do Håynaedje -Comment[x-test]=xxDisplay Settingsxx -Comment[zh_CN]=显示设置 -Comment[zh_TW]=顯示設定 -Categories=Qt;KDE;X-KDE-settings-hardware; diff --git a/kcontrol/hardware/display/display.h b/kcontrol/hardware/display/display.h deleted file mode 100644 index 82afb315..00000000 --- a/kcontrol/hardware/display/display.h +++ /dev/null @@ -1,48 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2003 Nadeem Hasan - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef DISPLAY_H -#define DISPLAY_H - -#include - -#include - -class KCMDisplay : public KCModule -{ - Q_OBJECT - - public: - KCMDisplay( QWidget *parent, const QVariantList & ); - void load(); - void save(); - - private Q_SLOTS: - void moduleChanged(bool isChanged); - - private: - void addTab( const QString &name, const QString &label ); - - QTabWidget *m_tabs; - QMap m_modules; - bool m_changed; -}; - -#endif // DISPLAY_H - diff --git a/kcontrol/hardware/joystick/CMakeLists.txt b/kcontrol/joystick/CMakeLists.txt similarity index 100% rename from kcontrol/hardware/joystick/CMakeLists.txt rename to kcontrol/joystick/CMakeLists.txt diff --git a/kcontrol/hardware/joystick/Messages.sh b/kcontrol/joystick/Messages.sh similarity index 100% rename from kcontrol/hardware/joystick/Messages.sh rename to kcontrol/joystick/Messages.sh diff --git a/kcontrol/hardware/joystick/caldialog.cpp b/kcontrol/joystick/caldialog.cpp similarity index 100% rename from kcontrol/hardware/joystick/caldialog.cpp rename to kcontrol/joystick/caldialog.cpp diff --git a/kcontrol/hardware/joystick/caldialog.h b/kcontrol/joystick/caldialog.h similarity index 100% rename from kcontrol/hardware/joystick/caldialog.h rename to kcontrol/joystick/caldialog.h diff --git a/kcontrol/hardware/joystick/joydevice.cpp b/kcontrol/joystick/joydevice.cpp similarity index 100% rename from kcontrol/hardware/joystick/joydevice.cpp rename to kcontrol/joystick/joydevice.cpp diff --git a/kcontrol/hardware/joystick/joydevice.h b/kcontrol/joystick/joydevice.h similarity index 100% rename from kcontrol/hardware/joystick/joydevice.h rename to kcontrol/joystick/joydevice.h diff --git a/kcontrol/hardware/joystick/joystick.cpp b/kcontrol/joystick/joystick.cpp similarity index 100% rename from kcontrol/hardware/joystick/joystick.cpp rename to kcontrol/joystick/joystick.cpp diff --git a/kcontrol/hardware/joystick/joystick.desktop b/kcontrol/joystick/joystick.desktop similarity index 100% rename from kcontrol/hardware/joystick/joystick.desktop rename to kcontrol/joystick/joystick.desktop diff --git a/kcontrol/hardware/joystick/joystick.h b/kcontrol/joystick/joystick.h similarity index 100% rename from kcontrol/hardware/joystick/joystick.h rename to kcontrol/joystick/joystick.h diff --git a/kcontrol/hardware/joystick/joywidget.cpp b/kcontrol/joystick/joywidget.cpp similarity index 100% rename from kcontrol/hardware/joystick/joywidget.cpp rename to kcontrol/joystick/joywidget.cpp diff --git a/kcontrol/hardware/joystick/joywidget.h b/kcontrol/joystick/joywidget.h similarity index 100% rename from kcontrol/hardware/joystick/joywidget.h rename to kcontrol/joystick/joywidget.h diff --git a/kcontrol/hardware/joystick/poswidget.cpp b/kcontrol/joystick/poswidget.cpp similarity index 100% rename from kcontrol/hardware/joystick/poswidget.cpp rename to kcontrol/joystick/poswidget.cpp diff --git a/kcontrol/hardware/joystick/poswidget.h b/kcontrol/joystick/poswidget.h similarity index 100% rename from kcontrol/hardware/joystick/poswidget.h rename to kcontrol/joystick/poswidget.h diff --git a/kcontrol/randr/krandrtray.cpp b/kcontrol/randr/krandrtray.cpp index 106d6aee..aa9ca718 100644 --- a/kcontrol/randr/krandrtray.cpp +++ b/kcontrol/randr/krandrtray.cpp @@ -434,7 +434,7 @@ void KRandRSystemTray::slotPrefs() KCMultiDialog *kcm = new KCMultiDialog( associatedWidget() ); kcm->setFaceType( KCMultiDialog::Plain ); kcm->setWindowTitle( i18n( "Configure Display" ) ); - kcm->addModule( "display" ); + kcm->addModule( "randr" ); kcm->setAttribute(Qt::WA_DeleteOnClose); m_kcm = kcm; } else if (KWindowSystem::activeWindow() == m_kcm.data()->winId()) { diff --git a/kcontrol/randr/module/randrmonitor.cpp b/kcontrol/randr/module/randrmonitor.cpp index c2a7ef15..72f5a337 100644 --- a/kcontrol/randr/module/randrmonitor.cpp +++ b/kcontrol/randr/module/randrmonitor.cpp @@ -168,7 +168,7 @@ void RandrMonitorModule::processX11Event( XEvent* e ) void RandrMonitorModule::showKcm() { - KToolInvocation::kdeinitExec("kcmshell4", QStringList() << "display"); + KToolInvocation::kdeinitExec("kcmshell4", QStringList() << "randr"); } void RandrMonitorModule::tryAutoConfig() @@ -298,7 +298,7 @@ void RandrMonitorModule::switchDisplay() return; } // no idea what to do here - KToolInvocation::kdeinitExec( "kcmshell4", QStringList() << "display" ); + KToolInvocation::kdeinitExec( "kcmshell4", QStringList() << "randr" ); } void RandrMonitorModule::resumedFromSuspend() -- 2.11.0