![](https://seccdn.libravatar.org/avatar/f850d49374387219fe79b9ca562f7803.jpg?s=120&d=mm&r=g)
Author: tgoettlicher Date: Thu Feb 7 15:44:06 2008 New Revision: 44240 URL: http://svn.opensuse.org/viewcvs/yast?rev=44240&view=rev Log: (empty) Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleinfo.cpp branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleinfo.h Modified: branches/tmp/tgoettlicher/yast2_2nd_rewrite/CMakeLists.txt Modified: branches/tmp/tgoettlicher/yast2_2nd_rewrite/CMakeLists.txt URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/CMakeLists.txt?rev=44240&r1=44239&r2=44240&view=diff ============================================================================== --- branches/tmp/tgoettlicher/yast2_2nd_rewrite/CMakeLists.txt (original) +++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/CMakeLists.txt Thu Feb 7 15:44:06 2008 @@ -1,96 +1,9 @@ -project(KDEBASE_WORKSPACE) +PROJECT(YaST2-Controlcenter) +FIND_PACKAGE(Qt4 REQUIRED) +ADD_SUBDIRECTORY( systemsettings ) + +#set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ) +#add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1) +#include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES}) -# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ) - -#search packages used by KDE -find_package(KDE4 REQUIRED) -find_package(Strigi REQUIRED) -find_package(Blitz REQUIRED) - -macro_optional_find_package(USB) -macro_optional_find_package(Fontconfig) -macro_optional_find_package(OpenGL) - -include (MacroLibrary) -include (KDE4Defaults) - -macro_optional_find_package(OpenGL) - -include(ConfigureChecks.cmake) -configure_file(config-unix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-unix.h ) -configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h ) -configure_file (config-workspace.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h ) -configure_file (startkde.cmake ${CMAKE_CURRENT_BINARY_DIR}/startkde @ONLY) - -add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1) -include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES}) - -set( backgroundlib_SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/kcontrol/kdm/background/bgrender.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/kcontrol/kdm/background/bgsettings.cpp -) - -set( kcmbackgroundlib_SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/kcontrol/kdm/background/bgdialog.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/kcontrol/kdm/background/bgadvanced.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/kcontrol/kdm/background/bgmonitor.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/kcontrol/kdm/background/bgwallpaper.cpp -) - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/kdm - ${CMAKE_CURRENT_SOURCE_DIR}/libs - ${CMAKE_CURRENT_SOURCE_DIR}/libs/kworkspace -) -# libs -add_subdirectory(cmake) -add_subdirectory(libs) - -# system settings (kcontrol replacement) -add_subdirectory( systemsettings ) - -# core apps -add_subdirectory( kcheckpass ) -add_subdirectory( kscreensaver ) -add_subdirectory( solid ) -add_subdirectory( ksmserver ) -add_subdirectory( kcminit ) -add_subdirectory( ksplash ) -add_subdirectory( ksysguard ) -add_subdirectory( ktip ) -add_subdirectory( klipper ) -add_subdirectory( kmenuedit ) -add_subdirectory( krunner ) -add_subdirectory( kwin ) -add_subdirectory( plasma ) -add_subdirectory( kstartupconfig ) - - -add_subdirectory( khotkeys ) - -# apps we need to figure out what to do with -add_subdirectory( kcontrol ) -add_subdirectory( ksystraycmd ) - -# data -add_subdirectory( doc ) -add_subdirectory( wallpapers ) -add_subdirectory( menu ) - -if(X11_Xau_FOUND AND X11_Xdmcp_FOUND) - add_subdirectory( kdm ) -else(X11_Xau_FOUND AND X11_Xdmcp_FOUND) - MESSAGE(STATUS "Xau lib or Xdmcp lib was missing. kdm will not compile") -endif(X11_Xau_FOUND AND X11_Xdmcp_FOUND) - -SET(krunner_DEPENDS "plasma") - -########### install files ############### -install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/startkde DESTINATION ${BIN_INSTALL_DIR}) - -if(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") - macro_display_feature_log() -endif(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleinfo.cpp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleinfo.cpp?rev=44240&view=auto ============================================================================== --- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleinfo.cpp (added) +++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleinfo.cpp Thu Feb 7 15:44:06 2008 @@ -0,0 +1,203 @@ +/* + Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> + Copyright (c) 2000 Matthias Elter <elter@kde.org> + Copyright (c) 2003 Daniel Molkentin <molkentin@kde.org> + Copyright (c) 2003,2006 Matthias Kretz <kretz@kde.org> + + This file is part of the KDE project + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2, as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "kcmoduleinfo.h" + +#include <QtCore/QVariant> + +#include <kdesktopfile.h> +#include <kdebug.h> +#include <kglobal.h> +#include <kstandarddirs.h> +#include <klocale.h> +#include "yservice.h" + +class KCModuleInfo::Private +{ + public: + Private(); + Private( YService::Ptr ); + + QStringList keywords; + QString name, icon, lib, handle, fileName, doc, comment; + bool allLoaded; + int weight; + + YService::Ptr service; + + /** + * Reads the service entries specific for KCModule from the desktop file. + * The usual desktop entries are read in the Private ctor. + */ + void loadAll(); +}; + +KCModuleInfo::Private::Private() +{ +} + +KCModuleInfo::Private::Private( YService::Ptr s ) + : allLoaded( false ) + , service( s ) +{ + if ( !service ) + { +//tg kDebug(712) << "Could not find the service."; + return; + } + + // set the modules simple attributes + name = service->name(); + comment = service->comment(); + icon = service->icon(); +//tg fileName = service->entryPath(); +//tg lib = service->library(); +//tg keywords = service->keywords(); +} + +KCModuleInfo::KCModuleInfo() +{ + d = new Private; +} + +KCModuleInfo::KCModuleInfo(const QString& desktopFile) +{ +// d = new Private( YService::serviceByStorageId(desktopFile) ); +} + +KCModuleInfo::KCModuleInfo( YService::Ptr moduleInfo ) +{ + d = new Private( moduleInfo ); +} + +KCModuleInfo::KCModuleInfo( const KCModuleInfo &rhs ) +{ + d = new Private; + ( *this ) = rhs; +} + +KCModuleInfo &KCModuleInfo::operator=( const KCModuleInfo &rhs ) +{ + *d = *(rhs.d); + return *this; +} + +bool KCModuleInfo::operator==( const KCModuleInfo & rhs ) const +{ + return ( ( d->name == rhs.d->name ) && ( d->lib == rhs.d->lib ) && ( d->fileName == rhs.d->fileName ) ); +} + +bool KCModuleInfo::operator!=( const KCModuleInfo & rhs ) const +{ + return ! operator==( rhs ); +} + +KCModuleInfo::~KCModuleInfo() +{ + delete d; +} + +void KCModuleInfo::Private::loadAll() +{ +#ifdef tg + allLoaded = true; + + if( !service ) /* We have a bogus service. All get functions will return empty/zero values */ + return; + + // get the documentation path + doc = service->property( "X-DocPath", QVariant::String ).toString(); + if (doc.isEmpty()) + doc = service->property( "DocPath", QVariant::String ).toString(); + + // read weight + QVariant tmp = service->property( "X-KDE-Weight", QVariant::Int ); + weight = tmp.isValid() ? tmp.toInt() : 100; + + // factory handle + tmp = service->property("X-KDE-FactoryName", QVariant::String); + handle = tmp.isValid() ? tmp.toString() : lib; +#endif +} + +QString KCModuleInfo::fileName() const +{ +//tg return d->fileName; + +} + +QStringList KCModuleInfo::keywords() const +{ +//tg return d->keywords; +} + +QString KCModuleInfo::moduleName() const +{ + return d->name; +} + +YService::Ptr KCModuleInfo::service() const +{ + return d->service; +} + +QString KCModuleInfo::comment() const +{ + return d->comment; +} + +QString KCModuleInfo::icon() const +{ + return d->icon; +} + +QString KCModuleInfo::library() const +{ + return d->lib; +} + +QString KCModuleInfo::docPath() const +{ + if (!d->allLoaded) + d->loadAll(); + + return d->doc; +} + +QString KCModuleInfo::handle() const +{ + if (!d->allLoaded) + d->loadAll(); + + return d->handle; +} + +int KCModuleInfo::weight() const +{ + if (!d->allLoaded) + d->loadAll(); + + return d->weight; +} + +// vim: ts=2 sw=2 et Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleinfo.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleinfo.h?rev=44240&view=auto ============================================================================== --- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleinfo.h (added) +++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleinfo.h Thu Feb 7 15:44:06 2008 @@ -0,0 +1,164 @@ +/* + Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> + Copyright (c) 2000 Matthias Elter <elter@kde.org> + Copyright (c) 2003 Daniel Molkentin <molkentin@kde.org> + Copyright (c) 2003,2006 Matthias Kretz <kretz@kde.org> + + This file is part of the KDE project + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2, as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KCMODULEINFO_H +#define KCMODULEINFO_H + +//#include <kutils_export.h> +#include "yservice.h" + +class QString; +class QStringList; + +/** + * A class that provides information about a KCModule + * + * KCModuleInfo provides various technical information, such as icon, library + * etc. about a KCModule.n + * @note Any values set with the set* functions is not + * written back with KCModuleInfo it only reads value from the desktop file. + * + * @internal + * @author Matthias Hoelzer-Kluepfel <mhk@kde.org> + * @author Matthias Elter <elter@kde.org> + * @author Daniel Molkentin <molkentin@kde.org> + * + */ +//class KUTILS_EXPORT KCModuleInfo // krazy:exclude=dpointer (implicitly shared) +class KCModuleInfo // krazy:exclude=dpointer (implicitly shared) +{ + +public: + + /** + * Constructs a KCModuleInfo. + * @note a KCModuleInfo object will have to be manually deleted, it is not + * done automatically for you. + * @param desktopFile the desktop file representing the module, or + * the name of the module. + */ + KCModuleInfo(const QString& desktopFile); + + /** + * Same as above but takes a KService::Ptr as argument. + * + * @note @p moduleInfo must be a valid pointer. + * + * @param moduleInfo specifies the module + */ + KCModuleInfo( YService::Ptr moduleInfo ); + + + /** + * Same as above but takes a KCModuleInfo as argument. + * + * @param rhs specifies the module + */ + KCModuleInfo( const KCModuleInfo &rhs ); + + /** + * Same as above but creates an empty KCModuleInfo. + * You should not normally call this. + */ + KCModuleInfo(); + + /** + * Assignment operator + */ + KCModuleInfo &operator=( const KCModuleInfo &rhs ); + + /** + * Returns true if @p rhs describes the same KCModule as this object. + */ + bool operator==( const KCModuleInfo &rhs ) const; + + /** + * @return true if @p rhs is not equal itself + */ + bool operator!=( const KCModuleInfo &rhs ) const; + + /** + * Default destructor. + */ + ~KCModuleInfo(); + + /** + * @return the filename of the .desktop file that describes the KCM + */ + QString fileName() const; + + /** + * @return the keywords associated with this KCM. + */ + QStringList keywords() const; + + /** + * @return the module\'s (translated) name + */ + QString moduleName() const; + + /** + * @return a KSharedPtr to KService created from the modules .desktop file + */ + YService::Ptr service() const; + + /** + * @return the module's (translated) comment field + */ + QString comment() const; + + /** + * @return the module's icon name + */ + QString icon() const; + + /** + * @return the path of the module's documentation + */ + QString docPath() const; + + /** + * @return the library name + */ + QString library() const; + + /** + * @return a handle (the contents of the X-KDE-FactoryName field if it exists, + * else the same as the library name) + */ + QString handle() const; + + /** + * @return the weight of the module which determines the order of the pages in + * the KCMultiDialog. It's set by the X-KDE-Weight field. + */ + int weight() const; + +private: + class Private; + Private * d; +}; + +#endif // KCMODULEINFO_H + +// vim: ts=2 sw=2 et -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org