diff --git a/kdecoration/CMakeLists.txt b/kdecoration/CMakeLists.txt index f814a54a..3f36f72e 100644 --- a/kdecoration/CMakeLists.txt +++ b/kdecoration/CMakeLists.txt @@ -1,99 +1,98 @@ add_definitions(-DTRANSLATION_DOMAIN="oxygen_kdecoration") find_package(KDecoration2 REQUIRED) find_package(KF5 REQUIRED COMPONENTS CoreAddons ConfigWidgets WindowSystem) find_package(Qt5 CONFIG REQUIRED COMPONENTS DBus) ### XCB find_package(XCB COMPONENTS XCB) set_package_properties(XCB PROPERTIES DESCRIPTION "X protocol C-language Binding" URL "http://xcb.freedesktop.org" TYPE OPTIONAL PURPOSE "Required to pass style properties to native Windows on X11 Platform" ) include_directories(${CMAKE_SOURCE_DIR}/liboxygen) include_directories(${CMAKE_BINARY_DIR}/liboxygen) if(UNIX AND NOT APPLE) set(OXYGEN_HAVE_X11 ${XCB_XCB_FOUND}) if (XCB_XCB_FOUND) find_package(Qt5 REQUIRED CONFIG COMPONENTS X11Extras) endif() else() set(OXYGEN_HAVE_X11 FALSE) endif() ################# configuration ################# configure_file(config-oxygen.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-oxygen.h ) ################# newt target ################# ### plugin classes set(oxygendecoration_SRCS oxygenbutton.cpp oxygendecohelper.cpp oxygendecoration.cpp oxygenexceptionlist.cpp oxygensettingsprovider.cpp oxygensizegrip.cpp) kconfig_add_kcfg_files(oxygendecoration_SRCS oxygensettings.kcfgc) ### config classes ### they are kept separately because they might move in a separate library in the future set(oxygendecoration_config_SRCS config/oxygenanimationconfigwidget.cpp config/oxygenconfigwidget.cpp config/oxygendetectwidget.cpp config/oxygenexceptiondialog.cpp config/oxygenexceptionlistwidget.cpp config/oxygenexceptionmodel.cpp - config/oxygenitemmodel.cpp ) set(oxygendecoration_config_PART_FORMS config/ui/oxygenconfigurationui.ui config/ui/oxygendetectwidget.ui config/ui/oxygenexceptiondialog.ui config/ui/oxygenexceptionlistwidget.ui ) ki18n_wrap_ui(oxygendecoration_config_PART_FORMS_HEADERS ${oxygendecoration_config_PART_FORMS}) ### build library add_library(oxygendecoration MODULE ${oxygendecoration_SRCS} ${oxygendecoration_config_SRCS} ${oxygendecoration_config_PART_FORMS_HEADERS}) target_link_libraries(oxygendecoration PUBLIC Qt5::Core Qt5::Gui Qt5::DBus PRIVATE oxygenstyle5 oxygenstyleconfig5 KDecoration2::KDecoration KF5::ConfigCore KF5::CoreAddons KF5::ConfigWidgets KF5::GuiAddons KF5::I18n KF5::WindowSystem) if(OXYGEN_HAVE_X11) target_link_libraries(oxygendecoration PUBLIC Qt5::X11Extras XCB::XCB) endif() install(TARGETS oxygendecoration DESTINATION ${PLUGIN_INSTALL_DIR}/org.kde.kdecoration2) install(FILES config/oxygendecorationconfig.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/kdecoration/config/oxygenitemmodel.cpp b/kdecoration/config/oxygenitemmodel.cpp deleted file mode 100644 index 21df2506..00000000 --- a/kdecoration/config/oxygenitemmodel.cpp +++ /dev/null @@ -1,68 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// itemmodel.cpp -// ------------------- -// -// Copyright (c) 2009-2010 Hugo Pereira Da Costa -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -////////////////////////////////////////////////////////////////////////////// - -#include "oxygenitemmodel.h" - -namespace Oxygen -{ - - //_______________________________________________________________ - ItemModel::ItemModel( QObject* parent ): - QAbstractItemModel( parent ) - {} - - //____________________________________________________________ - void ItemModel::sort( int column, Qt::SortOrder order ) - { - - // store column and order - m_sortColumn = column; - m_sortOrder = order; - - // emit signals and call private methods - emit layoutAboutToBeChanged(); - privateSort( column, order ); - emit layoutChanged(); - - } - - //____________________________________________________________ - QModelIndexList ItemModel::indexes( int column, const QModelIndex& parent ) const - { - QModelIndexList out; - int rows( rowCount( parent ) ); - for( int row = 0; row < rows; row++ ) - { - QModelIndex index( this->index( row, column, parent ) ); - if( !index.isValid() ) continue; - out.append( index ); - out += indexes( column, index ); - } - - return out; - - } - -} diff --git a/kdecoration/config/oxygenitemmodel.h b/kdecoration/config/oxygenitemmodel.h deleted file mode 100644 index 38869ce1..00000000 --- a/kdecoration/config/oxygenitemmodel.h +++ /dev/null @@ -1,109 +0,0 @@ -#ifndef ItemModel_h -#define ItemModel_h - -////////////////////////////////////////////////////////////////////////////// -// itemmodel.h -// ------------------- -// -// Copyright (c) 2009-2010 Hugo Pereira Da Costa -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -////////////////////////////////////////////////////////////////////////////// - -#include - -namespace Oxygen -{ - - //* Job model. Stores job information for display in lists - class ItemModel : public QAbstractItemModel - { - - public: - - //* constructor - explicit ItemModel(QObject *parent = 0); - - //* return all indexes in model starting from parent [recursive] - QModelIndexList indexes( int column = 0, const QModelIndex& parent = QModelIndex() ) const; - - //*@name sorting - //@{ - - //* sort - virtual void sort( void ) - { sort( sortColumn(), sortOrder() ); } - - //* sort - void sort( int column, Qt::SortOrder order = Qt::AscendingOrder ) override; - - //* current sorting column - const int& sortColumn( void ) const - { return m_sortColumn; } - - //* current sort order - const Qt::SortOrder& sortOrder( void ) const - { return m_sortOrder; } - - //@} - - protected: - - //* this sort columns without calling the layout changed callbacks - void privateSort( void ) - { privateSort( m_sortColumn, m_sortOrder ); } - - //* private sort, with no signals emmitted - virtual void privateSort( int column, Qt::SortOrder order ) = 0; - - //* used to sort items in list - class SortFTor - { - - public: - - //* constructor - explicit SortFTor( const int& type, Qt::SortOrder order = Qt::AscendingOrder ): - _type( type ), - _order( order ) - {} - - protected: - - //* column - int _type; - - //* order - Qt::SortOrder _order; - - }; - - private: - - //* sorting column - int m_sortColumn = 0; - - //* sorting order - Qt::SortOrder m_sortOrder = Qt::AscendingOrder; - - }; - -} - -#endif