diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,8 +81,6 @@ ecm_find_qmlmodule(org.kde.kirigami 2.5) -configure_file(config-project-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-project-version.h) -configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_KEYWORDS) @@ -97,48 +95,19 @@ include(ECMOptionalAddSubdirectory) ecm_optional_add_subdirectory( doc ) -include_directories( ToolTips ) - -set( kinfocenter_SRCS -infocenter.cpp -main.cpp -sidepanel.cpp -kcmcontainer.cpp -kcmtreeitem.cpp -kcmcategoryitem.cpp -infokcmmodel.cpp -infokcmproxymodel.cpp -ToolTips/tooltipmanager.cpp -) - -add_executable( kinfocenter ${kinfocenter_SRCS} ) -target_compile_definitions(kinfocenter PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}") - -target_link_libraries( kinfocenter - KF5::Completion - KF5::ConfigWidgets - KF5::CoreAddons - KF5::Crash - KF5::DBusAddons - KF5::I18n - KF5::IconThemes - KF5::KCMUtils - KF5::Service - KF5::Solid - KF5::WidgetsAddons - KF5::WindowSystem - KF5::XmlGui -) # add clang-format target for all our real source files file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) ##install -install( TARGETS kinfocenter ${INSTALL_TARGETS_DEFAULT_ARGS} ) install( FILES org.kde.kinfocenter.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) install( PROGRAMS org.kde.kinfocenter.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) -install( FILES kinfocenterui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kinfocenter ) + +ADD_CUSTOM_TARGET(kinfocenter_link ALL + COMMAND ${CMAKE_COMMAND} -E create_symlink ${KDE_INSTALL_FULL_BINDIR}/systemsettings5 ${CMAKE_CURRENT_BINARY_DIR}/kinfocenter) + +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/kinfocenter DESTINATION ${KDE_INSTALL_FULL_BINDIR}/ ) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/Categories/CMakeLists.txt b/Categories/CMakeLists.txt --- a/Categories/CMakeLists.txt +++ b/Categories/CMakeLists.txt @@ -1,5 +1,5 @@ install( FILES kinfocentercategory.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) -install( FILES deviceinfocategory.desktop graphicalinfocategory.desktop networkinfocategory.desktop lostfoundcategory.desktop +install( FILES deviceinfocategory.desktop graphicalinfocategory.desktop networkinfocategory.desktop lostfoundcategory.desktop basicinformation.desktop detailedinformation.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) diff --git a/Categories/basicinformation.desktop b/Categories/basicinformation.desktop new file mode 100644 --- /dev/null +++ b/Categories/basicinformation.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Service +X-KDE-ServiceTypes=KInfoCenterCategory +X-KDE-KInfoCenter-Category=basic_information +Icon=dialog-information + +Name=Basic Information diff --git a/Categories/detailedinformation.desktop b/Categories/detailedinformation.desktop new file mode 100644 --- /dev/null +++ b/Categories/detailedinformation.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Service +X-KDE-ServiceTypes=KInfoCenterCategory +X-KDE-KInfoCenter-Category=detailed_information +Icon=dialog-information + +Name=Detailed Information diff --git a/Categories/deviceinfocategory.desktop b/Categories/deviceinfocategory.desktop --- a/Categories/deviceinfocategory.desktop +++ b/Categories/deviceinfocategory.desktop @@ -2,9 +2,10 @@ Type=Service X-KDE-ServiceTypes=KInfoCenterCategory X-KDE-KInfoCenter-Category=device_information +X-KDE-KInfoCenter-Parent-Category=detailed_information Icon=hwinfo -Name=Device Information +Name=Devices Name[ar]=معلومات الأجهزة Name[be@latin]=Źviestki z pryłady Name[bg]=Данни за устройства diff --git a/Categories/graphicalinfocategory.desktop b/Categories/graphicalinfocategory.desktop --- a/Categories/graphicalinfocategory.desktop +++ b/Categories/graphicalinfocategory.desktop @@ -2,9 +2,10 @@ Type=Service X-KDE-ServiceTypes=KInfoCenterCategory X-KDE-KInfoCenter-Category=graphical_information +X-KDE-KInfoCenter-Parent-Category=detailed_information Icon=applications-graphics -Name=Graphical Information +Name=Graphics Name[ar]=المعلومات الرّسوميّة Name[bg]=Данни за графичната система Name[bs]=Podaci o grafici diff --git a/Categories/kinfocentercategory.desktop b/Categories/kinfocentercategory.desktop --- a/Categories/kinfocentercategory.desktop +++ b/Categories/kinfocentercategory.desktop @@ -65,4 +65,5 @@ # Cat Ident [PropertyDef::X-KDE-KInfoCenter-Category] Type=QString - +[PropertyDef::X-KDE-KInfoCenter-Parent-Category] +Type=QString diff --git a/Categories/networkinfocategory.desktop b/Categories/networkinfocategory.desktop --- a/Categories/networkinfocategory.desktop +++ b/Categories/networkinfocategory.desktop @@ -2,9 +2,10 @@ Type=Service X-KDE-ServiceTypes=KInfoCenterCategory X-KDE-KInfoCenter-Category=network_information +X-KDE-KInfoCenter-Parent-Category=detailed_information Icon=preferences-system-network -Name=Network Information +Name=Network Name[ar]=معلومات الشّبكة Name[bg]=Мрежови данни Name[bs]=Podaci o mreži diff --git a/Modules/about-distro/src/about-distro.desktop b/Modules/about-distro/src/about-distro.desktop --- a/Modules/about-distro/src/about-distro.desktop +++ b/Modules/about-distro/src/about-distro.desktop @@ -8,6 +8,7 @@ X-KDE-ParentApp=kinfocenter X-KDE-PluginKeyword=kcm-about-distro X-KDE-System-Settings-Parent-Category=system-administration +X-KDE-KInfoCenter-Category=basic_information X-KDE-Weight=0 X-KDE-Keywords=about,info,information,distribution,distro,system,kernel,qt,kde X-KDE-Keywords[ca]=quant a,info,informació,distribució,distro,sistema,nucli,qt,kde diff --git a/Modules/energy/kcm_energyinfo.desktop b/Modules/energy/kcm_energyinfo.desktop --- a/Modules/energy/kcm_energyinfo.desktop +++ b/Modules/energy/kcm_energyinfo.desktop @@ -5,8 +5,9 @@ X-KDE-ServiceTypes=KCModule X-KDE-Library=kcm_energyinfo X-KDE-ParentApp=kinfocenter +X-KDE-KInfoCenter-Category=basic_information -Name=Energy Information +Name=Energy Name[ar]=معلومات عن الطّاقة Name[ca]=Informació de l'energia Name[ca@valencia]=Informació de l'energia diff --git a/Modules/fileindexermonitor/kcm_fileindexermonitor.desktop b/Modules/fileindexermonitor/kcm_fileindexermonitor.desktop --- a/Modules/fileindexermonitor/kcm_fileindexermonitor.desktop +++ b/Modules/fileindexermonitor/kcm_fileindexermonitor.desktop @@ -5,6 +5,7 @@ X-KDE-ServiceTypes=KCModule X-KDE-Library=kcm_fileindexermonitor X-KDE-ParentApp=kinfocenter +X-KDE-KInfoCenter-Category=basic_information Name=File Indexer Monitor Name[ar]=مرقاب مفهرس الملفّات diff --git a/Modules/memory/kcm_memory.desktop b/Modules/memory/kcm_memory.desktop --- a/Modules/memory/kcm_memory.desktop +++ b/Modules/memory/kcm_memory.desktop @@ -7,6 +7,7 @@ X-KDE-Weight=1 X-KDE-Library=kcm_memory X-KDE-ParentApp=kinfocenter +X-KDE-KInfoCenter-Category=basic_information X-DocPath=kinfocenter/index.html#kcm_memory Name=Memory diff --git a/ToolTips/tooltipmanager.h b/ToolTips/tooltipmanager.h deleted file mode 100644 --- a/ToolTips/tooltipmanager.h +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2008 by Konstantin Heil * - * * - * 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; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - *******************************************************************************/ - -#ifndef TOOLTIPMANAGER_H -#define TOOLTIPMANAGER_H - -#include - -#include - -class QLayout; -class QAbstractItemView; - -/** - * @brief Manages the tooltips for an item view. - * - * When hovering an item, a tooltip is shown after - * a short timeout. The tooltip is hidden again when the - * viewport is hovered or the item view has been left. - */ -class ToolTipManager : public QObject -{ - Q_OBJECT - -public: - /** - * Standard constructor. The ToolTipManager will start handling ToolTip events on the provided - * view immediately. - * - * @param parent The view which will have the tooltips displayed for. - */ - explicit ToolTipManager(QAbstractItemView* parent); - ~ToolTipManager() override; - -public Q_SLOTS: - /** - * Hides the currently shown tooltip. Invoking this method is - * only needed when the tooltip should be hidden although - * an item is hovered. - */ - void hideToolTip(); - -protected: - /** - * Please see the Qt documentation for more details. - * - * @param watched The object that was being watched. - * @param event The event object. - * @returns true if the event was handled in this filter, or false if it was not. - */ - bool eventFilter( QObject* watched, QEvent* event ) override; - -private Q_SLOTS: - void prepareToolTip(); - void requestToolTip(const QModelIndex& index); - -private: - void showToolTip( const QModelIndex& menuItem ); - QWidget * createTipContent( const QModelIndex& item ); - QLayout * generateToolTipLine( const QModelIndex& item, QWidget * toolTip, const QSize& iconSize, bool comment ); - - class Private; - ToolTipManager::Private* d; -}; - -#endif diff --git a/ToolTips/tooltipmanager.cpp b/ToolTips/tooltipmanager.cpp deleted file mode 100644 --- a/ToolTips/tooltipmanager.cpp +++ /dev/null @@ -1,208 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2008 by Konstantin Heil * - * * - * 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; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - *******************************************************************************/ - -#include "tooltipmanager.h" - -#include "kcmtreeitem.h" -#include "sidepanel.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -class IconLoaderSingleton -{ -public: - IconLoaderSingleton() = default; - - KIconLoader self; -}; - -Q_GLOBAL_STATIC(IconLoaderSingleton, privateIconLoaderSelf) - -class ToolTipManager::Private -{ -public: - KToolTipWidget *tooltip = nullptr; - QAbstractItemView* view = nullptr; - QTimer* timer = nullptr; - QModelIndex item; - QRect itemRect; - int delay = QApplication::style()->styleHint(QStyle::SH_ToolTip_WakeUpDelay); -}; - -ToolTipManager::ToolTipManager(QAbstractItemView* parent) - : QObject(parent) - , d(new ToolTipManager::Private) -{ - d->view = parent; - d->tooltip = new KToolTipWidget(d->view); - d->tooltip->setHideDelay(0); - - connect(parent, &QAbstractItemView::viewportEntered, this, &ToolTipManager::hideToolTip); - connect(parent, &QAbstractItemView::entered, this, &ToolTipManager::requestToolTip); - - d->timer = new QTimer(this); - d->timer->setSingleShot(true); - connect(d->timer, &QTimer::timeout, this, &ToolTipManager::prepareToolTip); - - // When the mousewheel is used, the items don't get a hovered indication - // (Qt-issue #200665). To assure that the tooltip still gets hidden, - // the scrollbars are observed. - connect(parent->horizontalScrollBar(), &QAbstractSlider::valueChanged, this, &ToolTipManager::hideToolTip); - connect(parent->verticalScrollBar(), &QAbstractSlider::valueChanged, this, &ToolTipManager::hideToolTip); - - d->view->viewport()->installEventFilter(this); -} - -ToolTipManager::~ToolTipManager() -{ - delete d; -} - -bool ToolTipManager::eventFilter(QObject* watched, QEvent* event) -{ - if ( watched == d->view->viewport() ) { - switch ( event->type() ) { - case QEvent::Leave: - case QEvent::MouseButtonPress: - hideToolTip(); - break; - case QEvent::ToolTip: - return true; - default: - break; - } - } - - return QObject::eventFilter(watched, event); -} - -void ToolTipManager::requestToolTip(const QModelIndex& index) -{ - // only request a tooltip for the name column and when no selection or - // drag & drop operation is done (indicated by the left mouse button) - if ( !(QApplication::mouseButtons() & Qt::LeftButton) ) { - d->tooltip->hide(); - - d->itemRect = d->view->visualRect(index); - const QPoint pos = d->view->viewport()->mapToGlobal(d->itemRect.topLeft()); - d->itemRect.moveTo(pos); - d->item = index; - d->timer->start(d->delay); - } else { - hideToolTip(); - } -} - -void ToolTipManager::hideToolTip() -{ - d->timer->stop(); - d->tooltip->hideLater(); -} - -void ToolTipManager::prepareToolTip() -{ - showToolTip( d->item ); -} - -void ToolTipManager::showToolTip( const QModelIndex& menuItem ) -{ - if (QApplication::mouseButtons() & Qt::LeftButton) { - return; - } - - QWidget * tip = createTipContent( menuItem ); - connect(d->tooltip, &KToolTipWidget::hidden, tip, &QObject::deleteLater); - - d->tooltip->showBelow(d->itemRect, tip, d->view->nativeParentWidget()->windowHandle()); -} - -QWidget * ToolTipManager::createTipContent( const QModelIndex& item ) -{ - QWidget * tipContent = new QWidget(); - QGridLayout* tipLayout = new QGridLayout(); - - QLayout * primaryLine = generateToolTipLine( item, tipContent, QSize(32,32), true ); - tipLayout->addLayout( primaryLine, 0, 0 ); - - for ( int done = 0; d->view->model()->rowCount( item ) > done; done = 1 + done ) { - QModelIndex childItem = d->view->model()->index( done, 0, item ); - QLayout * subLine = generateToolTipLine( childItem, tipContent, QSize(24,24), false ); - tipLayout->addLayout( subLine, done + 2, 0 ); - } - - tipLayout->setVerticalSpacing( 0 ); - tipContent->setLayout( tipLayout ); - - if( d->view->model()->rowCount( item ) > 0 ) { - QFrame * separatorLine = new QFrame( tipContent ); - separatorLine->setFrameStyle( QFrame::HLine ); - tipLayout->addWidget( separatorLine, 1, 0 ); - } - - return tipContent; -} - -QLayout * ToolTipManager::generateToolTipLine( const QModelIndex & item, QWidget * toolTip, const QSize& iconSize, bool comment ) -{ - SidePanel *sidePanel = static_cast(d->view); - KcmTreeItem *menuItem = static_cast( sidePanel->mapToProxySource(item).internalPointer() ); - - QString text = menuItem->data(); - if ( comment ) { - text = QStringLiteral( "%1" ).arg( menuItem->data() ); - } - - QLabel * textLabel = new QLabel( toolTip ); - textLabel->setForegroundRole(QPalette::ToolTipText); - textLabel->setText( text ); - - // Get icon - QPalette pal = textLabel->palette(); - for (auto state : { QPalette::Active, QPalette::Inactive, QPalette::Disabled }) { - pal.setBrush(state, QPalette::WindowText, pal.toolTipText()); - pal.setBrush(state, QPalette::Window, pal.toolTipBase()); - } - - privateIconLoaderSelf->self.setCustomPalette(pal); - - QIcon icon = KDE::icon(menuItem->iconName(), &privateIconLoaderSelf->self); - QLabel * iconLabel = new QLabel( toolTip ); - iconLabel->setPixmap( icon.pixmap(iconSize) ); - iconLabel->setMaximumSize( iconSize ); - - // Generate layout - QHBoxLayout * layout = new QHBoxLayout(); - layout->addWidget( iconLabel ); - layout->addWidget( textLabel ); - - return layout; -} - diff --git a/config-X11.h.cmake b/config-X11.h.cmake deleted file mode 100644 --- a/config-X11.h.cmake +++ /dev/null @@ -1,2 +0,0 @@ -/* Set to 1 if you have X11 at all */ -#cmakedefine01 HAVE_X11 diff --git a/config-project-version.h.cmake b/config-project-version.h.cmake deleted file mode 100644 --- a/config-project-version.h.cmake +++ /dev/null @@ -1 +0,0 @@ -#define PROJECT_VERSION "${PROJECT_VERSION}" diff --git a/infocenter.h b/infocenter.h deleted file mode 100644 --- a/infocenter.h +++ /dev/null @@ -1,160 +0,0 @@ - -/* - * infocenter.h - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef INFOCENTER -#define INFOCENTER - -//KDE -#include -#include -#include -#include -#include - -//QT -#include -#include -#include -#include -#include - -//Local -#include "sidepanel.h" -#include "kcmcontainer.h" -#include "infokcmmodel.h" -#include "kcmtreeitem.h" -#include "tooltipmanager.h" - -class KcmContainer; -class ToolTipManager; -class KcmTreeItem; - -class KInfoCenter : public KXmlGuiWindow -{ - Q_OBJECT - - public: - - /** - * Create KInfoCenter main window - */ - KInfoCenter(); - - /** - * Destory KInfoCenter object - */ - ~KInfoCenter() override; - - /** - * Event filter to move KCMContainer to be level with - * the side menu. - * - * @param watched object being watched - * @param event event object containing event information - */ - bool eventFilter(QObject *watched, QEvent *event) override; - - public Q_SLOTS: - - /** - * Triggered when mouse is clicked on a treeview item - * - * @param item item selected via mouse - */ - void itemClickedSlot(const KcmTreeItem *item); - - /** - * Triggered when help toolbar action is used. - */ - void helpClickedSlot(); - - /** - * Triggered when the about KCM action is used - * in the help menu. - */ - void aboutKcmSlot(); - - /** - * Show a error message box - * - * @param parent parent object - * @param errorMessage error message text - */ - static void showError(QWidget *parent, const QString& errorMessage); - - private: - - /** - * Create main window and splitter - */ - void createMainFrame(); - - /** - * Create top toolbar on main window and setup toolbar - * actions. - */ - void createToolBar(); - - /** - * Create side menu frame including search bar - */ - void createMenuFrame(); - - /** - * Detect if export and help buttons should be enabled - * - * @param buttons buttons to check - */ - void setButtons(const KCModule::Buttons buttons); - - /** - * Load KCM into KCMContainer - * - * @param kcmItem KCM to be loaded - */ - void setKcm(const KcmTreeItem *kcmItem); - - /** - * Set enable state on KCM About menu action, - * export toolbar action and help toolbar action. - */ - void resetCondition(); - - void clearSearchLine(); - - const KcmTreeItem *m_kcmItem = nullptr; - KcmContainer *m_contain = nullptr; - QSplitter *m_splitter = nullptr; - - QAction *m_aboutKcm = nullptr; - QAction *m_searchAction = nullptr; - QAction *m_moduleHelpAction = nullptr; - KActionMenu *m_helpAction = nullptr; - - QWidget *m_cWidget = nullptr; - KLineEdit *m_searchText = nullptr; - - SidePanel *m_sideMenu = nullptr; - ToolTipManager *m_toolTips = nullptr; -}; - -#endif //INFOCENTER diff --git a/infocenter.cpp b/infocenter.cpp deleted file mode 100644 --- a/infocenter.cpp +++ /dev/null @@ -1,255 +0,0 @@ - -/* - * infocenter.cpp - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -//Local -#include "infocenter.h" - -//KDE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//QT -#include -#include -#include -#include -#include -#include -#include -#include - -KInfoCenter::KInfoCenter() : KXmlGuiWindow( 0, Qt::WindowContextHelpButtonHint ) -{ - setWindowIcon(QIcon::fromTheme(QStringLiteral("hwinfo"))); - setWindowTitle(i18nc("Main window title", "KInfocenter")); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - - setMinimumWidth(800); - setMinimumHeight(600); - - m_cWidget = new QWidget(this); - setCentralWidget(m_cWidget); - - QVBoxLayout *cLayout = new QVBoxLayout(m_cWidget); - - cLayout->setSpacing(0); - cLayout->setContentsMargins(0, 0, 0, 0); - createMainFrame(); - createToolBar(); - - //TreeWidget - connect(m_sideMenu,SIGNAL(clicked(const KcmTreeItem*)),this,SLOT(itemClickedSlot(const KcmTreeItem*))); - - //SearchBox - connect(m_searchText, &QLineEdit::textChanged, m_sideMenu, &SidePanel::filterSideMenuSlot); - connect(m_searchAction, SIGNAL(triggered()),m_searchText,SLOT(setFocus())); - - //Buttons - connect(m_moduleHelpAction, &QAction::triggered,this,&KInfoCenter::helpClickedSlot); - - //Menu - connect(m_aboutKcm, &QAction::triggered, this, &KInfoCenter::aboutKcmSlot); - - //Startup - m_searchText->completionObject()->setItems(m_sideMenu->allChildKeywords()); - m_sideMenu->setFocus(Qt::OtherFocusReason); - m_sideMenu->changeToFirstValidItem(); - - m_toolTips = new ToolTipManager(m_sideMenu); - setupGUI(QSize(800,600), ToolBar | Keys | Save | Create, QStringLiteral("kinfocenterui.rc")); - - delete m_helpAction->menu(); - m_helpAction->setMenu( dynamic_cast( factory()->container(QStringLiteral("help"), this) ) ); - menuBar()->hide(); - - QAction *aboutApp = actionCollection()->action(QStringLiteral("help_about_app")); - aboutApp->setIcon(QIcon::fromTheme(QStringLiteral("hwinfo"))); -} - -KInfoCenter::~KInfoCenter() -{ - delete m_toolTips; - - //TreeWidget - disconnect(m_sideMenu,SIGNAL(clicked(const KcmTreeItem*)),this,SLOT(itemClickedSlot(const KcmTreeItem*))); - - //SearchBox - disconnect(m_searchText, &QLineEdit::textChanged, m_sideMenu, &SidePanel::filterSideMenuSlot); - disconnect(m_searchAction, SIGNAL(triggered()),m_searchText, SLOT(setFocus())); - - //Buttons - disconnect(m_moduleHelpAction, &QAction::triggered, this, &KInfoCenter::helpClickedSlot); - - //Menu - disconnect(m_aboutKcm, &QAction::triggered, this, &KInfoCenter::aboutKcmSlot); -} - -bool KInfoCenter::eventFilter(QObject *watched, QEvent *event) -{ - if (watched == m_sideMenu && event->type() == QEvent::Move) { - m_contain->setKcmTopEdge(m_sideMenu->y()); - } - return false; -} - -void KInfoCenter::createToolBar() -{ - KStandardAction::quit(this, &KInfoCenter::close, actionCollection()); - KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection()); - - toolBar()->setMovable(false); - - m_aboutKcm = actionCollection()->addAction(QStringLiteral("help_about_module")); - m_aboutKcm->setText(i18nc("Information about current module located in about menu","About Current Information Module")); - m_aboutKcm->setIcon(QIcon::fromTheme(QStringLiteral("help-about"))); - m_aboutKcm->setEnabled(false); - - m_moduleHelpAction = new QAction(this); - m_moduleHelpAction->setText(i18nc("Module help button label", "Module Help")); - m_moduleHelpAction->setIcon(QIcon::fromTheme(QStringLiteral("help-contextual"))); - - m_helpAction = new KActionMenu( QIcon::fromTheme(QStringLiteral("help-contents")), i18nc("Help button label","Help"), this ); - m_helpAction->setDelayed( false ); - - actionCollection()->addAction(QStringLiteral("helpModule"), m_moduleHelpAction); - actionCollection()->addAction(QStringLiteral("helpMenu"), m_helpAction); -} - -void KInfoCenter::createMainFrame() -{ - QWidget *mainDisplay = new QWidget(); - mainDisplay->setContentsMargins(0,0,0,0); - - QHBoxLayout *mainLayout = new QHBoxLayout(mainDisplay); - - m_splitter = new QSplitter(m_cWidget); - m_splitter->setContentsMargins(0, 0, 0, 0); - m_splitter->setHandleWidth(5); - mainLayout->addWidget(m_splitter); - - createMenuFrame(); - - m_contain = new KcmContainer(m_splitter); - m_splitter->addWidget(m_contain); - - m_splitter->setStretchFactor(0, 0); - m_splitter->setStretchFactor(1, 1); - - m_cWidget->layout()->addWidget(mainDisplay); -} - -void KInfoCenter::createMenuFrame() -{ - QWidget *sideFrame = new QWidget(m_splitter); - sideFrame->setContentsMargins(0,0,0,0); - - QVBoxLayout *menuLayout = new QVBoxLayout(sideFrame); - menuLayout->setContentsMargins(0, 0, 0, 0); - - m_searchText = new KLineEdit(sideFrame); - m_searchText->setClearButtonEnabled(true); - m_searchText->setPlaceholderText( i18nc( "Search Bar Click Message", "Search" ) ); - m_searchText->setCompletionMode( KCompletion::CompletionPopup ); - m_searchText->completionObject()->setIgnoreCase(true); - - m_searchAction = new QAction(this); - m_searchAction->setText(i18nc("Kaction search label", "Search Modules")); - m_searchAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-find"))); - - actionCollection()->addAction(QStringLiteral("search"),m_searchAction); - actionCollection()->setDefaultShortcut(m_searchAction, QKeySequence(Qt::CTRL + Qt::Key_F)); - - m_sideMenu = new SidePanel(sideFrame); - m_sideMenu->installEventFilter(this); - connect(m_sideMenu, &SidePanel::clearSearchLine, this, &KInfoCenter::clearSearchLine); - - menuLayout->addWidget(m_searchText); - menuLayout->addWidget(m_sideMenu); - m_splitter->addWidget(sideFrame); -} - -void KInfoCenter::clearSearchLine() -{ - m_searchText->clear(); -} - -void KInfoCenter::itemClickedSlot(const KcmTreeItem *item) -{ - if (item != m_kcmItem) { - resetCondition(); - if(item->type() != KcmTreeItem::CATEGORY) { - setKcm(item); - } - } - m_kcmItem = item; -} - -void KInfoCenter::setKcm(const KcmTreeItem *kcmItem) -{ - m_contain->setKcm(kcmItem->kcm()); - - setButtons(m_contain->buttons()); - m_aboutKcm->setEnabled(true); -} - -void KInfoCenter::setButtons(const KCModule::Buttons buttons) -{ - if (buttons & KCModule::Help && !m_contain->helpPath().isEmpty()) { - m_moduleHelpAction->setEnabled(true); - } -} - -void KInfoCenter::resetCondition() -{ - m_moduleHelpAction->setEnabled(false); - - m_aboutKcm->setEnabled(false); -} - -void KInfoCenter::helpClickedSlot() -{ - // Nicked from Ben, could not use KToolInvocation due to docpath. - QString docPath = m_contain->helpPath(); - - QUrl url(QStringLiteral("help:/") + docPath ); - QProcess::startDetached(QStringLiteral("khelpcenter"), QStringList() << url.url()); -} - -void KInfoCenter::aboutKcmSlot() -{ - KAboutApplicationDialog kcmAboutDialog(*(m_contain->kcmAboutData())); - kcmAboutDialog.exec(); -} - -void KInfoCenter::showError(QWidget *parent, const QString& errorMessage) -{ - KMessageBox::sorry(parent, errorMessage); -} diff --git a/infokcmmodel.h b/infokcmmodel.h deleted file mode 100644 --- a/infokcmmodel.h +++ /dev/null @@ -1,136 +0,0 @@ - -/* - * infokcmmodel.h - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef INFOKCMMODEL -#define INFOKCMMODEL - -//KDE -#include - -//QT -#include -#include -#include -#include -#include -#include - -//Local -#include "kcmtreeitem.h" - -class KcmTreeItem; - -class InfoKcmModel : public QAbstractItemModel -{ - Q_OBJECT - - public: - - /** - * Create InfoKcmModel object. - * Abstract data model to display KCM's for a tree view - * - * @param parent objects parent - */ - explicit InfoKcmModel(QObject *parent); - - ~InfoKcmModel() override; - - /** - * Get index of item in model - * - * @param row row position - * @param column column position - * @param parent parent of object - * @return index of object - */ - QModelIndex index(int row, int column, const QModelIndex& parent) const override; - QModelIndex index(int row, int column, KcmTreeItem *parent) const; - - /** - * Get parent of item in model - */ - QModelIndex parent(const QModelIndex& index) const override; - - /** - * Get amount of rows under parent - */ - int rowCount(const QModelIndex& parent) const override; - - /** - * Get amount of columns under parent - */ - int columnCount(const QModelIndex& parent) const override; - - /** - * Get the stored data for a role - * - * @param index objects index - * @param role role to retrieve data about - */ - QVariant data(const QModelIndex& index, int role) const override; - - /** - * Get header information - */ - QVariant headerData(int, Qt::Orientation, int) const override; - - /** - * Get set flags for a treeitem - */ - Qt::ItemFlags flags(const QModelIndex &) const override; - - /** - * Get the first valid item on the treeview - * Checks main root items only - * - * @return index of valid item - */ - QModelIndex firstValid() const; - - /** - * Get all KCM keywords for all KCMs stored in the model - */ - QStringList allChildrenKeywords(); - - /** - * Get QModelIndex of a KcmTreeItem - */ - QModelIndex indexOf(KcmTreeItem *item); - - private: - - /** - * Init tree items - */ - void createTreeItems(); - - /** - * Get a certain KCM's keywords - */ - QStringList childrenKeywords(KcmTreeItem *kcmItem); - - KService::List m_moduleList; - KcmTreeItem *m_root; -}; - -#endif // INFOKCMMODEL diff --git a/infokcmmodel.cpp b/infokcmmodel.cpp deleted file mode 100644 --- a/infokcmmodel.cpp +++ /dev/null @@ -1,233 +0,0 @@ - -/* - * infokcmmodel.h - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -//Local -#include "infokcmmodel.h" -#include "kcmcategoryitem.h" - -//KDE -#include -#include -#include - -InfoKcmModel::InfoKcmModel(QObject *parent) - : QAbstractItemModel(parent), - m_root(new KcmCategoryItem(i18n("Information Modules"))) -{ - createTreeItems(); -} - -InfoKcmModel::~InfoKcmModel() -{ - delete m_root; -} - -void InfoKcmModel::createTreeItems() -{ - const KService::List categoryList = KServiceTypeTrader::self()->query(QStringLiteral("KInfoCenterCategory")); - - for(const KService::Ptr &categoryModule : categoryList) { - m_root->addChild(new KcmCategoryItem(categoryModule,m_root)); - } - - const KService::List moduleList = KServiceTypeTrader::self()->query(QStringLiteral("KCModule"), QStringLiteral("[X-KDE-ParentApp] == 'kinfocenter'")); - - for (const KService::Ptr &kcmModule : moduleList) { - if (kcmModule->isType(KST_KService) == true) { - - QString category = kcmModule->property(QStringLiteral("X-KDE-KInfoCenter-Category")).toString().trimmed(); - - if(!category.isEmpty() || !category.isNull()) { - KcmTreeItem *item = m_root->containsCategory(category); - if(item != nullptr) { - item->addChild(new KcmTreeItem(kcmModule,item)); - } else { - KcmTreeItem *lost = m_root->containsCategory(QStringLiteral("lost_and_found")); - if(lost != nullptr) { - lost->addChild(new KcmTreeItem(kcmModule,lost)); - } else { - qWarning() << "Lost and found category not found, unable to display lost Kcontrol modules"; - } - } - } else { - m_root->addChild(new KcmTreeItem(kcmModule,m_root)); - } - } - } -} - -QModelIndex InfoKcmModel::index(int row, int column, const QModelIndex &parent) const -{ - KcmTreeItem *parentItem; - - if (!parent.isValid()) { - parentItem = m_root; - } else { - parentItem = static_cast(parent.internalPointer()); - } - - KcmTreeItem *childItem = parentItem->child(row); - - if (childItem) { - return createIndex(row, column, childItem); - } - return QModelIndex(); -} - -QModelIndex InfoKcmModel::index(int row, int column, KcmTreeItem *parent) const -{ - KcmTreeItem *childItem = parent->child(row); - - if (childItem) { - return createIndex(row, column, childItem); - } - return QModelIndex(); -} - -QModelIndex InfoKcmModel::parent(const QModelIndex &index) const -{ - if (!index.isValid()) { - return QModelIndex(); - } - - KcmTreeItem *child = static_cast(index.internalPointer()); - KcmTreeItem *parent = child->parent(); - - if (parent == m_root) { - return QModelIndex(); - } - - return createIndex(parent->row(), 0, parent); -} - -QModelIndex InfoKcmModel::indexOf(KcmTreeItem *item) -{ - QModelIndex tmpIndex = createIndex(item->row(), 0, item); - - if(!tmpIndex.isValid()) { - return QModelIndex(); - } - return tmpIndex; -} - -int InfoKcmModel::rowCount(const QModelIndex &parent) const -{ - KcmTreeItem *parentItem; - - if (!parent.isValid()) { - parentItem = m_root; - } else { - parentItem = static_cast(parent.internalPointer()); - } - - return parentItem->childCount(); -} - -int InfoKcmModel::columnCount(const QModelIndex &parent) const -{ - // Hard coded, menu should never have more than one column - - Q_UNUSED(parent); - return 1; -} - -QVariant InfoKcmModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid()) { - return QVariant(); - } - - KcmTreeItem *item = static_cast(index.internalPointer()); - - switch(role) { - case Qt::DisplayRole: - return item->data(); - case Qt::UserRole: - return item->weight(); - case Qt::DecorationRole: - return QIcon::fromTheme(item->iconName()); - default: - return QVariant(); - } -} - -QVariant InfoKcmModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - Q_UNUSED(section); - - if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { - return m_root->data(); - } - - return QVariant(); -} - -Qt::ItemFlags InfoKcmModel::flags(const QModelIndex &index) const -{ - if (!index.isValid()) { - return Qt::ItemIsEnabled; - } - - return Qt::ItemIsEnabled | Qt::ItemIsSelectable; -} - -QModelIndex InfoKcmModel::firstValid() const -{ - int rows = m_root->childCount(); - - // Massive large number to max compare - unsigned int winner = 0; winner--; - - QModelIndex winnerIndex = QModelIndex(); - - for(int i=0;ichild(i); - if(item->type() == KcmTreeItem::KCM) { - if(winner >= (unsigned int)item->weight()) { - winner = item->weight(); - winnerIndex = index(item->row(),0,item->parent()); - } - } - } - return winnerIndex; -} - -QStringList InfoKcmModel::allChildrenKeywords() -{ - return childrenKeywords(m_root); -} - -QStringList InfoKcmModel::childrenKeywords(KcmTreeItem *kcmItem) -{ - QStringList childKeywords; - - int rows = kcmItem->childCount(); - for(int i=0;ichild(i); - if(item->type() == KcmTreeItem::CATEGORY) { - childKeywords = childKeywords + childrenKeywords(item); - } else { - childKeywords = childKeywords + item->keywords(); - } - } - return childKeywords; -} diff --git a/infokcmproxymodel.h b/infokcmproxymodel.h deleted file mode 100644 --- a/infokcmproxymodel.h +++ /dev/null @@ -1,61 +0,0 @@ - -/* - * infokcmproxymodel.h - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef INFOKCMPROXYMODEL -#define INFOKCMPROXYMODEL - -//QT -#include -#include -#include - -//Local -#include "kcmtreeitem.h" - -class InfoKcmProxyModel : public QSortFilterProxyModel -{ - public: - - /** - * Create InfoKcMProxyModel object. Used to filter out - * and sort a tree view. - * - * @param parent objects parent - */ - explicit InfoKcmProxyModel(QObject *parent); - - /** - * Check if left item is less than right item - * Uses X-KDE-Weight for measurements - */ - bool lessThan(const QModelIndex &, const QModelIndex &) const override; - - private: - - /** - * Filter out rows - * Used in search implementation - */ - bool filterAcceptsRow(int, const QModelIndex &) const override; -}; - -#endif // INFOKCMPROXYMODEL diff --git a/infokcmproxymodel.cpp b/infokcmproxymodel.cpp deleted file mode 100644 --- a/infokcmproxymodel.cpp +++ /dev/null @@ -1,56 +0,0 @@ - -/* - * infokcmproxymodel.cpp - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -//Local -#include "infokcmproxymodel.h" - - -InfoKcmProxyModel::InfoKcmProxyModel(QObject *parent) : QSortFilterProxyModel(parent) -{ - setSortRole(Qt::UserRole); -} - -bool InfoKcmProxyModel::lessThan(const QModelIndex &leftIndex, const QModelIndex &rightIndex) const -{ - if(!leftIndex.isValid() && !rightIndex.isValid()) { - return true; - } - - KcmTreeItem *leftItem = static_cast(leftIndex.internalPointer()); - KcmTreeItem *rightItem = static_cast(rightIndex.internalPointer()); - - return (leftItem->weight() < rightItem->weight()); -} - -bool InfoKcmProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const -{ - QModelIndex index=sourceModel()->index(sourceRow, 0, sourceParent); - KcmTreeItem *indexItem = static_cast(index.internalPointer()); - - if(indexItem->type() == KcmTreeItem::CATEGORY) { - if(indexItem->childrenRegExp(filterRegExp()) == true) { - return true; - } - } - - return !indexItem->keywords().filter(filterRegExp()).isEmpty(); -} diff --git a/kcmcategoryitem.h b/kcmcategoryitem.h deleted file mode 100644 --- a/kcmcategoryitem.h +++ /dev/null @@ -1,98 +0,0 @@ - -/* - * kcmcategoryitem.h - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef KCMCATEGORYITEM -#define KCMCATEGORYITEM - -#include "kcmtreeitem.h" - -//KDE -#include -#include - -class KcmCategoryItem : public KcmTreeItem -{ - public: - - /** - * Category Tree Item for InfoKcmModel. Holds information about a Category - * - * @param module pointer to KCM module - * @param parent objects parent - */ - explicit KcmCategoryItem(const KService::Ptr &module, KcmTreeItem *parent=nullptr); - - /** - * Category Tree Item for InfoKcmModel. Holds information about a Category - * - * @note Used for root folder objects - */ - explicit KcmCategoryItem(const QString& category); - - /** - * Get data of tree item - */ - QString data() const override; - - /** - * Get category of tree item. - * Set in X-KDE-KInfoCenter-Category - */ - QString category() const override; - - /** - * Gets the item type. - */ - itemType type() const override; - - /** - * Get tree item KCMs Data - */ - KCModuleInfo kcm() const override; - - /** - * Get tree items KCM's weight - */ - int weight() const override; - - /** - * Get icon tied to KCM - */ - QString iconName() const override; - - /** - * Get whatsThis information from KCM - */ - QString whatsThis() const override; - - /** - * Get KCM tree item keywords - */ - QStringList keywords() const override; - - private: - - const QString m_category; -}; - -#endif //KCMCATEGORYITEM - diff --git a/kcmcategoryitem.cpp b/kcmcategoryitem.cpp deleted file mode 100644 --- a/kcmcategoryitem.cpp +++ /dev/null @@ -1,85 +0,0 @@ - -/* - * kcmcategoryitem.cpp - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "kcmcategoryitem.h" - -KcmCategoryItem::KcmCategoryItem(const KService::Ptr &module, KcmTreeItem *parent) : - KcmTreeItem(module, parent) -{ -} - -KcmCategoryItem::KcmCategoryItem(const QString& categoryName) : - KcmTreeItem(), m_category(categoryName) -{ -} - -QString KcmCategoryItem::data() const -{ - if(m_category.isEmpty()) { - return m_moduleInfo->moduleName(); - } - - return category(); -} - -KcmTreeItem::itemType KcmCategoryItem::type() const -{ - return CATEGORY; -} - -QString KcmCategoryItem::category() const -{ - if(m_category.isEmpty()) - { - return m_module->property(QStringLiteral("X-KDE-KInfoCenter-Category")).toString().trimmed(); - } - return m_category; -} - -KCModuleInfo KcmCategoryItem::kcm() const -{ - return KCModuleInfo(); -} - -int KcmCategoryItem::weight() const -{ - return (category().count() + 1000); -} - -QString KcmCategoryItem::iconName() const -{ - if(m_category.isEmpty()) - { - return m_moduleInfo->icon(); - } - return QString(); -} - -QString KcmCategoryItem::whatsThis() const -{ - return QString(); -} - -QStringList KcmCategoryItem::keywords() const -{ - return QStringList(); -} diff --git a/kcmcontainer.h b/kcmcontainer.h deleted file mode 100644 --- a/kcmcontainer.h +++ /dev/null @@ -1,114 +0,0 @@ - -/* - * kcmcontainer.h - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef KCMCONTAINER -#define KCMCONTAINER - -//KDE -#include -#include -#include -#include - -//QT -#include -#include -#include -#include - -class KcmContainer : public QScrollArea -{ - public: - - /** - * Widget to display and receive information - * about displayed KCM. - * - * @param parent objects parent - */ - explicit KcmContainer(QWidget *parent); - - /** - * Destory KCMContainer - */ - ~KcmContainer(); - - /** - * Set and show KCM in KCMContainer window - */ - void setKcm(const KCModuleInfo &); - - /** - * Move KCMContainer top edge to a certain position - * - * @param y y coordinates of top edge - */ - void setKcmTopEdge(int y); - - /** - * Get currently selected KCMs document path - * for .desktop - * X-KDE-DocPath - */ - QString helpPath() const; - - /** - * Get currently selected KCMs - * information on which buttons need to be shown - */ - KCModule::Buttons buttons() const; - - /** - * Get about data for currently selected KCM - */ - const KAboutData *kcmAboutData() const; - - /** - * Get currently selected KCMs name - */ - QString name() const; - - /** - * Get currently selected KCMs .desktop file name - */ - QString fileName() const; - - private: - - /** - * Init and set KCMContainer Layout - */ - void setContainerLayout(); - - /** - * Set top title in KCMContainer - */ - void setKcmTitle(const KCModuleInfo &); - - QLabel *m_titleLabel; - QWidget *m_centerWidget; - KCModuleProxy *m_mod; - KCModuleInfo m_modInfo; - int m_kcmTopEdge; -}; - -#endif //KCMCONTAINER diff --git a/kcmcontainer.cpp b/kcmcontainer.cpp deleted file mode 100644 --- a/kcmcontainer.cpp +++ /dev/null @@ -1,146 +0,0 @@ - -/* - * kcmcontainer.cpp - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "kcmcontainer.h" - -//KDE -#include - -//QT -#include -#include -#include - -KcmContainer::KcmContainer(QWidget *parent) : QScrollArea(parent), m_titleLabel(nullptr), - m_centerWidget(nullptr), m_mod(nullptr), m_kcmTopEdge(-1) -{ - setWidgetResizable( true ); - setFrameStyle( QFrame::NoFrame ); - - setContainerLayout(); -} - -KcmContainer::~KcmContainer() -{ - delete m_mod; -} - -void KcmContainer::setContainerLayout() -{ - if (!m_mod && m_centerWidget) { - // we have no module, but a widget set up for one, - // so just return for now - return; - } - - m_mod = nullptr; // will be deleted on the line below - delete m_centerWidget; - m_centerWidget = new QWidget(this); - m_centerWidget->setContentsMargins(0,0,0,0); - - QVBoxLayout *centerWidgetLayout = new QVBoxLayout(m_centerWidget); - centerWidgetLayout->setContentsMargins(0, 0, 0, 0); - - QFont font; - // Adapted from KTitleWidget to match KCM qml title size - font.setPointSize(qRound(QApplication::font().pointSize() * 1.6)); - - m_titleLabel = new QLabel(m_centerWidget); - m_titleLabel->setFont(font); - m_titleLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); - m_titleLabel->setContentsMargins(style()->pixelMetric(QStyle::PM_DefaultFrameWidth), 0, 0, 0); - m_titleLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); - - centerWidgetLayout->addWidget(m_titleLabel); - setWidget(m_centerWidget); - m_centerWidget->setAutoFillBackground(false); - setKcmTopEdge(m_kcmTopEdge); -} - -void KcmContainer::setKcm(const KCModuleInfo &info) -{ - setContainerLayout(); - - m_mod = new KCModuleProxy(info); - m_modInfo = info; - - // Adpated from systemsettings ModuleView::updatePageIconHeader similar hack - if (!m_mod->realModule()->inherits("KCModuleQml") ) { - m_centerWidget->setContentsMargins(5,5,5,5); - } - - setKcmTitle(info); - - m_mod->setWhatsThis(m_mod->quickHelp()); - m_centerWidget->layout()->addWidget(m_mod); -} - -void KcmContainer::setKcmTopEdge(int y) -{ - m_kcmTopEdge = y; - if (m_kcmTopEdge < 0) { - return; - } - - if (m_titleLabel) { - int spacing = style()->layoutSpacing(QSizePolicy::DefaultType, QSizePolicy::DefaultType, Qt::Vertical); - m_titleLabel->setMinimumHeight(m_kcmTopEdge - spacing); - } -} - -void KcmContainer::setKcmTitle(const KCModuleInfo &info) -{ - //HACK: not much other ways to detect is a qml kcm - // Adpated from systemsettings ModuleView::updatePageIconHeader similar hack - if (m_mod->realModule()->inherits("KCModuleQml") ) { - m_titleLabel->setVisible(false); - } - m_titleLabel->setText(info.comment()); -} - -QString KcmContainer::helpPath() const -{ - if(m_mod == nullptr) { - return QString(); - } - return m_modInfo.docPath(); -} - -KCModule::Buttons KcmContainer::buttons() const -{ - return m_mod->buttons(); -} - -const KAboutData *KcmContainer::kcmAboutData() const -{ - return m_mod->aboutData(); -} - -QString KcmContainer::name() const -{ - return m_modInfo.moduleName(); -} - -QString KcmContainer::fileName() const -{ - return m_modInfo.fileName(); -} diff --git a/kcmtreeitem.h b/kcmtreeitem.h deleted file mode 100644 --- a/kcmtreeitem.h +++ /dev/null @@ -1,165 +0,0 @@ - -/* - * kcmtreeitem.h - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef KCMTREEITEM -#define KCMTREEITEM - -//KDE -#include -#include - -//QT -#include -#include - -class KcmTreeItem -{ - public: - - /** - * KCM Tree Item for InfoKcmModel. Holds information about a KCM - * - * @param module pointer to KCM module - * @param parent objects parent - */ - explicit KcmTreeItem(const KService::Ptr &module, KcmTreeItem *parent=nullptr); - - /** - * KCM Tree Item for InfoKcmModel. Holds information about a KCM - * - * @note Used for root folder objects - * - */ - KcmTreeItem(); - - /** - * Enumeration of the possible tree item types - * - */ - enum itemType { KCM=0, CATEGORY }; - - /** - * Destory KcmTreeItem - */ - virtual ~KcmTreeItem(); - - /** - * Add child tree item to parent - */ - void addChild(KcmTreeItem *); - - /** - * Get child tree item - * - * @param row row where child is located - */ - KcmTreeItem *child(const int row); - - /** - * Get amount of children - */ - int childCount() const; - - /** - * Get parent of current tree item - */ - KcmTreeItem *parent() const; - - /** - * Get index of tree item - */ - int indexOf(KcmTreeItem *); - - /** - * Get amount of columns that tree item contains. - * Hardcoded to 1 - */ - int columnCount() const; - - /** - * Get row of tree item - */ - int row(); - - /** - * Get data of tree item - */ - virtual QString data() const; - - /** - * Get category of tree item. - * Set in X-KDE-KInfoCenter-Category - */ - virtual QString category() const; - - /** - * Gets the item type. - */ - virtual itemType type() const; - - /** - * Check if children of tree item contains a category. - * Used in search implementation - */ - KcmTreeItem *containsCategory(const QString&); - - /** - * Get tree item KCMs Data - */ - virtual KCModuleInfo kcm() const; - - /** - * Get tree items KCM's weight - */ - virtual int weight() const; - - /** - * Get icon tied to KCM - */ - virtual QString iconName() const; - - /** - * Get whatsThis information from KCM - */ - virtual QString whatsThis() const; - - /** - * Check if there are any children tree items keywords that - * have a certain regexp pattern - */ - bool childrenRegExp(const QRegExp& pattern); - - /** - * Get KCM tree item keywords - */ - virtual QStringList keywords() const; - - protected: - - QList m_children; - KcmTreeItem *m_parent; - const KService::Ptr m_module; - - const KCModuleInfo *m_moduleInfo; -}; - -#endif // KCMTREEITEM diff --git a/kcmtreeitem.cpp b/kcmtreeitem.cpp deleted file mode 100644 --- a/kcmtreeitem.cpp +++ /dev/null @@ -1,154 +0,0 @@ - -/* - * kcmtreeitem.h - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -//Local -#include "kcmtreeitem.h" - -KcmTreeItem::KcmTreeItem(const KService::Ptr &module, KcmTreeItem *parent) : m_parent(parent), m_module(module), - m_moduleInfo(new KCModuleInfo(m_module)) -{ -} - -KcmTreeItem::KcmTreeItem() : m_parent(nullptr), m_moduleInfo(new KCModuleInfo()) -{ -} - -KcmTreeItem::~KcmTreeItem() -{ - qDeleteAll(m_children); - delete m_moduleInfo; -} - -void KcmTreeItem::addChild(KcmTreeItem *child) -{ - m_children.append(child); -} - -KcmTreeItem *KcmTreeItem::child(const int row) -{ - if(childCount() > row) { - return m_children.value(row); - } - return nullptr; -} - -int KcmTreeItem::childCount() const -{ - return m_children.count(); -} - -int KcmTreeItem::columnCount() const -{ - // Hard coded, menu should never have more than one column - return 1; -} - -KcmTreeItem *KcmTreeItem::parent() const -{ - return m_parent; -} - -int KcmTreeItem::row() -{ - if (m_parent) { - return indexOf(const_cast(this)); - } - - return 0; -} - -int KcmTreeItem::indexOf(KcmTreeItem *item) -{ - if (m_parent) { - return m_parent->m_children.indexOf(item); - } - - return 0; -} - -QString KcmTreeItem::data() const -{ - return m_moduleInfo->moduleName(); -} - -QString KcmTreeItem::category() const -{ - return m_module->property(QStringLiteral("X-KDE-KInfoCenter-Category")).toString().trimmed(); -} - -KcmTreeItem::itemType KcmTreeItem::type() const -{ - return KCM; -} - -KcmTreeItem *KcmTreeItem::containsCategory(const QString& category) -{ - foreach(KcmTreeItem *item, m_children) { - if(item->type() == CATEGORY) { - if(item->category().contains(category)) { - return item; - } - if(item->containsCategory(category)) { - return item; - } - } - } - return nullptr; -} - -KCModuleInfo KcmTreeItem::kcm() const -{ - return *m_moduleInfo; -} - -int KcmTreeItem::weight() const -{ - return m_moduleInfo->weight(); -} - -QString KcmTreeItem::iconName() const -{ - return m_moduleInfo->icon(); -} - -QString KcmTreeItem::whatsThis() const -{ - return m_moduleInfo->comment(); -} - -bool KcmTreeItem::childrenRegExp(const QRegExp& pattern) -{ - foreach(KcmTreeItem *item, m_children) { - if(item->keywords().filter(pattern).count() > 0) { - return true; - } - } - return false; -} - -QStringList KcmTreeItem::keywords() const -{ - if(m_moduleInfo->keywords().isEmpty()) { - return QStringList(data()); - } - return m_moduleInfo->keywords(); -} diff --git a/kinfocenterui.rc b/kinfocenterui.rc deleted file mode 100644 --- a/kinfocenterui.rc +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/main.h b/main.h deleted file mode 100644 --- a/main.h +++ /dev/null @@ -1,48 +0,0 @@ - -/* - * main.h - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef INFOCENTERMAIN -#define INFOCENTERMAIN - -//KDE -#include - -//Local -#include "infocenter.h" - -class KInfoCenter; - -class KicApp : public QApplication { - - Q_OBJECT - - public: - /** - * Init main window of application - */ - KicApp(int &argc, char **argv); - - private: - KInfoCenter *display; -}; - -#endif // INFOCENTERMAIN diff --git a/main.cpp b/main.cpp deleted file mode 100644 --- a/main.cpp +++ /dev/null @@ -1,80 +0,0 @@ - -/* - * main.cpp - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -//Local -#include "main.h" - -//KDE -#include -#include -#include -#include -#include -#include - -//Qt -#include - -KicApp::KicApp(int &argc, char **argv) - : QApplication(argc, argv) -{ - QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - KLocalizedString::setApplicationDomain("kinfocenter"); - - const auto displayName = i18n("Info Center"); - KAboutData aboutData( QStringLiteral("kinfocenter"), displayName, - QLatin1String(PROJECT_VERSION), displayName, KAboutLicense::GPL, - i18n("Copyright 2009-2018 KDE")); - - aboutData.addAuthor(i18n("David Hubner"),i18n("Current Maintainer"), QStringLiteral("hubnerd@ntlworld.com")); - aboutData.addAuthor(i18n("Helge Deller"), i18n("Previous Maintainer"), QStringLiteral("deller@kde.org")); - aboutData.addAuthor(i18n("Matthias Hoelzer-Kluepfel"),QString(), QStringLiteral("hoelzer@kde.org")); - aboutData.addAuthor(i18n("Matthias Elter"), QString(), QStringLiteral("elter@kde.org")); - aboutData.addAuthor(i18n("Matthias Ettrich"), QString(), QStringLiteral("ettrich@kde.org")); - aboutData.addAuthor(i18n("Waldo Bastian"), QString(), QStringLiteral("bastian@kde.org")); - aboutData.addAuthor(i18n("Nicolas Ternisien"), QString(), QStringLiteral("nicolas.ternisien@gmail.com")); - KAboutData::setApplicationData(aboutData); - QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("hwinfo"))); - - QCommandLineParser parser; - aboutData.setupCommandLine(&parser); - parser.process(*this); - aboutData.processCommandLine(&parser); - - auto *service = new KDBusService(KDBusService::Unique, this); - - display = new KInfoCenter(); - display->show(); - - connect(service, &KDBusService::activateRequested, this, [this]() { - KWindowSystem::forceActiveWindow(display->winId()); - }); -} - -int main(int argc, char *argv[]) -{ - KicApp Kic(argc, argv); - - KCrash::initialize(); - - return Kic.exec(); -} diff --git a/sidepanel.h b/sidepanel.h deleted file mode 100644 --- a/sidepanel.h +++ /dev/null @@ -1,141 +0,0 @@ - -/* - * sidepanel.h - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef SIDEPANEL -#define SIDEPANEL - -//QT -#include -#include -#include -#include -#include -#include - -//Local -#include "infokcmmodel.h" -#include "infokcmproxymodel.h" - -class InfoKcmModel; -class InfoKcmProxyModel; - -class SidePanel : public QTreeView -{ - Q_OBJECT - - public: - - /** - * Create Side Panel Widget, including search line edit. - * - * @param parent objects parent - */ - explicit SidePanel(QWidget *parent); - - /** - * Destory SidePanel object - */ - ~SidePanel() override; - - /** - * Select the first valid item in TreeView - */ - void changeToFirstValidItem(); - - /** - * Map a QAbstractItemModel index to a QSortFilterProxyModel index - */ - QModelIndex mapToProxySource(const QModelIndex&); - - /** - * Get all the treeview items keywords - */ - QStringList allChildKeywords(); - - /** - * Expand and collapse an Item ( if an expandable item ) - */ - void toggleExpand(const KcmTreeItem *); - - Q_SIGNALS: - - /** - * Emitted when menu item is clicked - */ - void clicked(const KcmTreeItem *); - - private Q_SLOTS: - - /** - * Triggered when treeview item is clicked - */ - void clickedSlot(const QModelIndex &index); - - public Q_SLOTS: - - /** - * Triggered when collapseAll is selected from tree view - * item menu - */ - void collapseAllSlot(); - - /** - * Triggered when ExpandAll is selected from tree view - * item menu - */ - void expandAllSlot(); - - /** - * Filter out all but menu items that fit certain keywords - */ - void filterSideMenuSlot(const QString &); - - /** - * Triggered when Reset Search is selected from tree view - * item menu - */ - void resetSearchSlot(); - -Q_SIGNALS: - void clearSearchLine(); - - private: - - /** - * Created actions for the tree view item menu - */ - void createMenuActions(); - - /** - * Create treeview item menu - */ - void contextMenuEvent(QContextMenuEvent *event) override; - - InfoKcmModel *m_model; - InfoKcmProxyModel *m_proxyModel; - - QAction *colAct; - QAction *expAct; - QAction *resetAct; -}; - -#endif //SIDEPANEL diff --git a/sidepanel.cpp b/sidepanel.cpp deleted file mode 100644 --- a/sidepanel.cpp +++ /dev/null @@ -1,145 +0,0 @@ - -/* - * sidepanel.cpp - * - * Copyright (C) 2010 David Hubner - * - * 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; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -//Local -#include "sidepanel.h" - -//KDE -#include - -//QT -#include -#include -#include - -SidePanel::SidePanel(QWidget *parent) - : QTreeView(parent) -{ - setHeaderHidden(true); - setSortingEnabled(true); - setAnimated(true); - sortByColumn(0, Qt::AscendingOrder); - m_model = new InfoKcmModel(this); - - m_proxyModel = new InfoKcmProxyModel(this); - m_proxyModel->setSourceModel(m_model); - - createMenuActions(); - - setMouseTracking(true); - setModel(m_proxyModel); - // Mind that activated does not include clicked when the system is in - // double-click mode https://bugs.kde.org/show_bug.cgi?id=405373 - connect(this, &QAbstractItemView::clicked, this, &SidePanel::clickedSlot); - connect(this, &QAbstractItemView::activated, this, &SidePanel::clickedSlot); -} - -SidePanel::~SidePanel() -{ - delete m_proxyModel; - delete m_model; -} - -void SidePanel::clickedSlot(const QModelIndex &index) -{ - if(index.isValid() == false) { - return; - } - - const KcmTreeItem *item = static_cast(m_proxyModel->mapToSource(index).internalPointer()); - emit clicked(item); -} - -void SidePanel::changeToFirstValidItem() -{ - QModelIndex rootIndex = m_proxyModel->mapFromSource(m_model->firstValid()); - if(rootIndex.isValid() == false) { - return; - } - - setCurrentIndex(rootIndex); - emit clickedSlot(rootIndex); -} - -QModelIndex SidePanel::mapToProxySource(const QModelIndex& index) -{ - QModelIndex tmp = m_proxyModel->mapToSource(index); - - if(tmp.isValid() == true) { - return tmp; - } - return QModelIndex(); -} - -void SidePanel::filterSideMenuSlot(const QString &pattern) -{ - if(pattern.isEmpty()) { - collapseAll(); - } else { - expandAll(); - } - m_proxyModel->setFilterRegExp(QRegExp(pattern,Qt::CaseInsensitive)); -} - -void SidePanel::createMenuActions() -{ - resetAct = new QAction(i18n("Clear Search"), this); - connect(resetAct, &QAction::triggered, this, &SidePanel::resetSearchSlot); - - expAct = new QAction(i18n("Expand All Categories"), this); - connect(expAct, &QAction::triggered, this, &SidePanel::expandAllSlot); - - colAct = new QAction(i18n("Collapse All Categories"), this); - connect(colAct, &QAction::triggered, this, &SidePanel::collapseAllSlot); -} - -void SidePanel::contextMenuEvent(QContextMenuEvent *event) -{ - QMenu menu(this); - - menu.addAction(colAct); - menu.addAction(expAct); - menu.addAction(resetAct); - menu.exec(event->globalPos()); -} - -void SidePanel::collapseAllSlot() -{ - collapseAll(); -} - -void SidePanel::expandAllSlot() -{ - expandAll(); -} - -QStringList SidePanel::allChildKeywords() -{ - return m_model->allChildrenKeywords(); -} - -void SidePanel::resetSearchSlot() -{ - filterSideMenuSlot(QLatin1String("")); - Q_EMIT clearSearchLine(); -} -